Skip to main content

ingress-draft-orders

Shopify Draft Orders are actively retrieved by Flowlyze.

The retrieved order information includes:

  • the sales channel (Channel).
  • the basic order information (e.g. name, ID, etc.).
  • the prices associated with the order.
  • the customer associated with it (Customer): information about the customer linked to the order.
  • the shipping and billing addresses (ShippingAddress and BillingAddress): details of the order’s shipping and billing addresses.
  • the line items (LineItems): details about the items included in the order.

The Adapter adds a tag to the order to verify that it has been exported (DRAFT_EXPORT) and to avoid duplicate sends to the destination, but only if the single-sync header is set to true. This behavior allows an order to be synchronized only once, ignoring any subsequent updates (optional behavior, configurable via header). If the header is not set, the tag is not added and the order can be exported multiple times.

💡 Recent draft orders ignored for data consistency

During the draft order download process, orders updated in the last 10 seconds are excluded. This ensures greater data consistency, as some information may not yet be fully synchronized immediately after a change in Shopify.

With proper flow configuration and the use of the incremental value, the temporarily excluded orders will be automatically retrieved in the next iteration, ensuring that no data is lost.

warning

Shopify Plan Compatibility

When using this endpoint with a Shopify store on a Basic plan, only limited customer information will be available within the order data due to Shopify API restrictions.

Active Order Flow Configuration

After creating the destination, which in the case of an active flow can be a database or an endpoint, you must configure the flow by enabling scheduling (Schedulation Enabled) and setting it up as follows:

FieldValueNotes
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/shopify/ingress/get-draft-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-shopify-graphql-urlhttps://SHOPIFYURL.myshopify.com/Url dello shopify con cui connettersi
Headers :: x-shopify-access-tokenshpat_CODICEALFANUMERICOSecret della custom app creata per l'integrazione
Headers :: x-last-draft-order-updated-processed"es. 2024-11-15T12:00:00ZData da cui partire per recuperare gli ordini
Headers :: x-sync-draft-order-oncetrueBooleano per inserire l'ordine una sola volta, non propaga aggiornamenti (default false)
Headers :: channel-code"Your Shopify StoreIl nome o il codice del tuo shop di Shopify
Headers :: x-number-of-draft-orders10Numero di ordini da recuperare ad ogni chiamata (default 10)

The value of the x-last-draft-order-updated-processed header in Flowlyze must be set as an incremental value (see here) in order to automatically retrieve orders based on their last update date.

In fact, the fields to configure under Incremental fields in the flow form (Step 2 – Source) are:

  • Name: the name of the variable associated with the incremental field. Example usage: x-last-draft-order-updated-processed = {{lastDraftOrderUpdatedProcessed}}. The name of the incremental variable will be lastDraftOrderUpdatedProcessed.
  • Message JSON Path: the field used to read the incremental value from the JSON message body. Example: updatedAt
  • Aggregator: aggregation criterion used to determine the incremental field value. Example: max
  • Current Value: the value associated with the incremental field. It can initially be left empty to allow retrieval of older updated orders as well.

Example of retrieved information

{
"orderReference": "gid://shopify/Order/1243",
"orderReferenceName": "#1001",
"status": "OPEN",
"id": "gid://shopify/DraftOrder/1243775402291",
"orderNumber": null,
"orderName": "#D87",
"channel": "demoipaas",
"srcName": null,
"note": "2 gift card + 1 item",
"tags": [],
"test": false,
"orderNotes": {},
"paymentStatus": "PENDING",
"fulfillmentStatus": "UNFULFILLED",
"isPickupInStore": false,
"pickupInStoreLocation": null,
"shippingAddress": {
"firstName": "Mario",
"lastName": "Rossi",
"company": null,
"street1": "Via Roma, 16",
"street2": null,
"city": "Firenze",
"zip": "50051",
"province": null,
"provinceCode": null,
"country": null,
"countryCode": null,
"phone": "057-1487"
},
"billingAddress": {
"firstName": "Mario",
"lastName": "Rossi",
"company": null,
"street1": "Via Roma, 16",
"street2": null,
"city": "Firenze",
"zip": "50051",
"province": null,
"provinceCode": null,
"country": null,
"countryCode": null,
"phone": "057-1487"
},
"customer": {
"id": "gid://shopify/Customer/9289121628467",
"channel": null,
"email": "m.rossi@test.com",
"createdAt": null,
"updatedAt": null,
"firstName": "Mario",
"lastName": "Rossi",
"phone": null,
"locale": "en",
"tags": [],
"acceptsEmailMarketing": false,
"acceptsEmailMarketingDate": null,
"acceptsSmsMarketing": false,
"acceptsSmsMarketingDate": null,
"totalSpent": 0,
"ordersCount": 0
},
"cancelReason": null,
"cancelledAt": null,
"orderItems": [
{
"id": "gid://shopify/DraftOrderLineItem/58565284266291",
"sku": "",
"productId": "gid://shopify/Product/9289226256691",
"variantId": "gid://shopify/ProductVariant/49362251972915",
"imageUrl": null,
"bundleCode": null,
"name": "Gift Card - $100",
"requiresShipping": false,
"vendor": "Snowboard Vendor",
"isGiftCard": true,
"giftCards": [],
"metadata": null,
"shopTotals": {
"currencyCode": "EUR",
"unitPrice": 100,
"originalUnitPrice": 100,
"totalNetPrice": 100,
"totalPrice": 100,
"originalTotalPrice": 100
},
"customerTotals": {
"currencyCode": "EUR",
"unitPrice": 100,
"originalUnitPrice": 100,
"totalNetPrice": 100,
"totalPrice": 100,
"originalTotalPrice": 100
},
"taxLines": [],
"taxBreakdown": {},
"unitWeight": null,
"duties": {},
"discountAllocations": [],
"qtyOrdered": 1,
"qtyShipped": 0,
"qtyRefunded": 0,
"unitAmountDiscounted": 0,
"orderItemNotes": {},
"itemGroup": null
},
{
"id": "gid://shopify/DraftOrderLineItem/58565284299059",
"sku": "9000Redirect",
"productId": "gid://shopify/Product/9325815791923",
"variantId": "gid://shopify/ProductVariant/49503933530419",
"imageUrl": null,
"bundleCode": null,
"name": "1 Redirect Polo Nord",
"requiresShipping": false,
"vendor": "Nike",
"isGiftCard": false,
"giftCards": [],
"metadata": null,
"shopTotals": {
"currencyCode": "EUR",
"unitPrice": 43,
"originalUnitPrice": 43,
"totalNetPrice": 43,
"totalPrice": 43,
"originalTotalPrice": 43
},
"customerTotals": {
"currencyCode": "EUR",
"unitPrice": 43,
"originalUnitPrice": 43,
"totalNetPrice": 43,
"totalPrice": 43,
"originalTotalPrice": 43
},
"taxLines": [],
"taxBreakdown": {},
"unitWeight": null,
"duties": {},
"discountAllocations": [],
"qtyOrdered": 1,
"qtyShipped": 0,
"qtyRefunded": 0,
"unitAmountDiscounted": 0,
"orderItemNotes": {},
"itemGroup": null
},
{
"id": "gid://shopify/DraftOrderLineItem/58565284331827",
"sku": "",
"productId": "gid://shopify/Product/9289226256691",
"variantId": "gid://shopify/ProductVariant/49362251776307",
"imageUrl": null,
"bundleCode": null,
"name": "Gift Card - $10",
"requiresShipping": false,
"vendor": "Snowboard Vendor",
"isGiftCard": true,
"giftCards": [],
"metadata": null,
"shopTotals": {
"currencyCode": "EUR",
"unitPrice": 10,
"originalUnitPrice": 10,
"totalNetPrice": 10,
"totalPrice": 10,
"originalTotalPrice": 10
},
"customerTotals": {
"currencyCode": "EUR",
"unitPrice": 10,
"originalUnitPrice": 10,
"totalNetPrice": 10,
"totalPrice": 10,
"originalTotalPrice": 10
},
"taxLines": [],
"taxBreakdown": {},
"unitWeight": null,
"duties": {},
"discountAllocations": [],
"qtyOrdered": 1,
"qtyShipped": 0,
"qtyRefunded": 0,
"unitAmountDiscounted": 0,
"orderItemNotes": {},
"itemGroup": null
}
],
"shopTotals": {
"currencyCode": "EUR",
"subTotalPrice": 153,
"totalNetPrice": 153,
"totalPrice": 153,
"totalShippingPrice": 0,
"totalDiscounts": 0
},
"customerTotals": {
"currencyCode": "EUR",
"subTotalPrice": 153,
"totalNetPrice": 153,
"totalPrice": 153,
"totalShippingPrice": 0,
"totalDiscounts": 0
},
"taxExempt": false,
"taxesIncluded": true,
"taxLines": [],
"fulfillments": [],
"transactions": [],
"discounts": [],
"createdAt": "2025-12-03T13:34:07+00:00",
"updatedAt": "2025-12-03T13:34:20+00:00",
"processedAt": null,
"closedAt": null,
"returns": [],
"refunds": [],
"shippingLines": [],
"metafields": [],
"metadata": {},
"assignedLocations": []
}