Passa al contenuto principale

Importazione Ordini

Gli ordini di Channel Engine vengono recuperati attivamente da Flowlyze.

Le informazioni recuperate sugli ordini includono:

  • il canale di vendita (Channel).
  • le informazioni di base dell'ordine (per esempio nome, identificativo, ecc.).
  • i prezzi associati all'ordine.
  • gli sconti presenti nell'ordine.
  • il cliente associato (Customer): informazioni sul cliente associato all'ordine.
  • gli indirizzi di spedizione e fatturazione (ShippingAddress e BillingAddress): dettagli degli indirizzi di spedizione e fatturazione dell'ordine.
  • gli articoli presenti (OrderItems): dettagli sugli articoli inclusi nell'ordine.
  • le location assegnate (AssignedLocations): indica quali SKU e quantità devono essere prelevati da ogni location.
  • i resi (Returns): l'elenco dei resi associati all'ordine.
  • i rimborsi (Refunds): l'elenco dei rimborsi associati all'ordine.
  • le spedizioni (Fulfillments): l'elenco delle spedizioni associate all'ordine.

Configurazione del Flusso Ordini (attivo)

Dopo aver creato la destinazione, che nel caso di un flusso attivo può essere un database o un endpoint, è necessario configurare il flusso attivando la schedulazione (Schedulation Enabled) e impostandolo come segue:

CampoValoreNote
Namees. active-flow-orderNome della schedulazione
Cron Expression*/5 * * * *Ogni quanto si vuole eseguire il recupero degli ordini (es. */5 * * * * -> ogni 5 minuti)
Source TypehttpIl tipo di sorgente che deve essere utilizzata
Urlhttps://adapt.flowlyze.com/api/adp/channel-engine/ingress/get-order-updated-afterUrl dell'endpoint che deve essere richiamato (vedi nota a fine tabella)
MethodGETIl metodo con cui richiamare l'endpoint
Headers :: x-api-key**********L'api key di verifica per l'interazione con l'endpoint
Headers :: x-ce-urlhttps://CEURL.channelengine.net/apiurl del Channel Engine con cui connettersi
Headers :: x-ce-tokenCODICEALFANUMERICOtoken per l'integrazione
Headers :: x-last-order-updated-processedes. 2025-11-19T10:59:00.2238217ZData da cui partire per recuperare gli ordini
Headers :: x-number-of-orders10Numero di ordini da recuperare ad ogni chiamata (default 10)

Il valore dell'header x-last-order-updated-processed su Flowlyze per poter recuperare gli ordini automaticamente secondo la data di ultimo aggiornamento è necessario impostarlo come valore incrementale (vedi qui). Infatti i campi da impostare nella voce Incremental fields del form del flusso (Setp 2 - Source) sono:

  • Name: il nome della variabile associata al campo incrementale. Esempio di uso: x-last-order-updated-processed = {{lastOrderUpdatedProcessed}}, il nome della variabile incrementale sarà lastOrderUpdatedProcessed
  • Message JSON Path: il campo da utilizzare per la lettura dell'incrementale nel corpo del messaggio json. Esempio: updatedAt
  • Aggregator: criterio di aggregazione per determinare il valore del campo incrementale. Esempio: max
  • Current Value: il valore associato al campo incrementale, che inizialmente può essere fornito vuoto così da poter recuperare anche gli ordini aggiornati meno recentemente

Esempio delle informazioni recuperate

{
"id": "167",
"orderNumber": null,
"orderName": "TEST_ORD_4",
"channel": "Amazon.it (v3)",
"srcName": "Amazon.it (v3)",
"note": null,
"tags": [],
"test": true,
"orderNotes": {},
"paymentStatus": "PENDING",
"fulfillmentStatus": "UNFULFILLED",
"isPickupInStore": false,
"pickupInStoreLocation": null,
"shippingAddress": {
"firstName": "Mario",
"lastName": "Rossi",
"company": "Company 1",
"street1": "Via Roma 1",
"street2": null,
"city": "Firenze",
"zip": "50051",
"province": null,
"provinceCode": null,
"country": null,
"countryCode": "IT",
"phone": null
},
"billingAddress": {
"firstName": "Mario",
"lastName": "Rossi",
"company": "Company 1",
"street1": "Via Roma 1",
"street2": null,
"city": "Firenze",
"zip": "50051",
"province": null,
"provinceCode": null,
"country": null,
"countryCode": "IT",
"phone": null
},
"customer": {
"id": "123456789",
"channel": null,
"email": "m.rossi@test.it",
"createdAt": null,
"updatedAt": null,
"firstName": null,
"lastName": null,
"phone": "0148759847",
"locale": null,
"tags": null,
"acceptsEmailMarketing": false,
"acceptsEmailMarketingDate": null,
"acceptsSmsMarketing": false,
"acceptsSmsMarketingDate": null,
"totalSpent": 0,
"ordersCount": 0
},
"cancelReason": null,
"cancelledAt": null,
"orderItems": [
{
"id": "280",
"sku": "BGSM001C2116",
"productId": null,
"variantId": null,
"imageUrl": null,
"bundleCode": null,
"name": "Product Test 1 Con Varianti",
"requiresShipping": false,
"vendor": null,
"isGiftCard": false,
"giftCards": [],
"metadata": {},
"shopTotals": {
"currencyCode": null,
"unitPrice": 15.99,
"originalUnitPrice": 15.99,
"totalNetPrice": 26.43,
"totalPrice": 31.98,
"originalTotalPrice": 31.98
},
"customerTotals": {
"currencyCode": "EUR",
"unitPrice": 15.99,
"originalUnitPrice": 15.99,
"totalNetPrice": 26.43,
"totalPrice": 31.98,
"originalTotalPrice": 31.98
},
"taxLines": [],
"taxBreakdown": {},
"unitWeight": null,
"duties": {},
"discountAllocations": [],
"qtyOrdered": 2,
"qtyShipped": 0,
"qtyRefunded": 0,
"unitAmountDiscounted": 0,
"orderItemNotes": {},
"itemGroup": null
},
{
"id": "281",
"sku": "BGSM002C001",
"productId": null,
"variantId": null,
"imageUrl": null,
"bundleCode": null,
"name": "Borsa Nera in Pelle",
"requiresShipping": false,
"vendor": null,
"isGiftCard": false,
"giftCards": [],
"metadata": {},
"shopTotals": {
"currencyCode": null,
"unitPrice": 109.99,
"originalUnitPrice": 109.99,
"totalNetPrice": 90.9,
"totalPrice": 109.99,
"originalTotalPrice": 109.99
},
"customerTotals": {
"currencyCode": "EUR",
"unitPrice": 109.99,
"originalUnitPrice": 109.99,
"totalNetPrice": 90.9,
"totalPrice": 109.99,
"originalTotalPrice": 109.99
},
"taxLines": [],
"taxBreakdown": {},
"unitWeight": null,
"duties": {},
"discountAllocations": [],
"qtyOrdered": 1,
"qtyShipped": 0,
"qtyRefunded": 0,
"unitAmountDiscounted": 0,
"orderItemNotes": {},
"itemGroup": null
}
],
"shopTotals": {
"currencyCode": null,
"subTotalPrice": 141.97,
"totalNetPrice": 125.59,
"totalPrice": 151.97,
"totalShippingPrice": 10,
"totalDiscounts": 0
},
"customerTotals": {
"currencyCode": "EUR",
"subTotalPrice": 141.97,
"totalNetPrice": 125.59,
"totalPrice": 151.97,
"totalShippingPrice": 10,
"totalDiscounts": 0
},
"taxExempt": false,
"taxesIncluded": true,
"taxLines": [],
"fulfillments": [
{
"id": "TEST_SHIPMENT_4_1",
"status": "PENDING",
"orderName": "TEST_ORD_4",
"shipmentDate": null,
"lineItems": [
{
"sku": "BGSM001C2116",
"qty": 1
}
],
"trackingInfo": {
"company": "DHL",
"number": "123",
"url": "https://www.dhl.com/nl-en/home/tracking/tracking-freight.html?submit=1&tracking-id={TrackTraceLink}"
},
"notifyCustomer": true,
"locationReference": ""
},
{
"id": "TEST_SHIPMENT_4_1",
"status": "PENDING",
"orderName": "TEST_ORD_4",
"shipmentDate": null,
"lineItems": [
{
"sku": "BGSM001C2116",
"qty": 1
},
{
"sku": "BGSM002C001",
"qty": 1
}
],
"trackingInfo": {
"company": "UPS",
"number": "1234",
"url": "http://wwwapps.ups.com/WebTracking/track?trackNums=1234&track.x=Traceren"
},
"notifyCustomer": true,
"locationReference": ""
}
],
"transactions": [],
"discounts": [],
"createdAt": "2025-11-28T11:07:21.7146242+01:00",
"updatedAt": "2025-11-28T11:10:24.8641714+01:00",
"processedAt": null,
"closedAt": "2025-11-28T11:09:33.3202112+01:00",
"returns": [
{
"id": "52",
"name": "TEST_RETURN_4_1",
"status": "CLOSED",
"totalQuantity": 1,
"note": "",
"returnItems": [
{
"id": "280",
"sku": "BGSM001C2116",
"quantity": 1
}
],
"returnShipping": null
},
{
"id": "53",
"name": "TEST_RETURN_4_2",
"status": "OPEN",
"totalQuantity": 1,
"note": "",
"returnItems": [
{
"id": "281",
"sku": "BGSM002C001",
"quantity": 1
}
],
"returnShipping": null
}
],
"refunds": [],
"shippingLines": [],
"metafields": [],
"metadata": {
"VAT_CALCULATION_METHOD_KEY": "FROM_PRICE_INCL"
},
"assignedLocations": [
{
"locationCode": "1",
"locationName": "Default Warehouse",
"assignedItems": [
{
"sku": "BGSM001C2116",
"quantity": 2
},
{
"sku": "BGSM002C001",
"quantity": 1
}
]
}
]
}