Fulfillments¶
The Fulfillments push fulfils orders in Shopify, from a shipment the warehouse or carrier system recorded. Each record fulfils one order, in full or chosen lines, and gives the shipment's carrier and tracking.
On a push connector, select Fulfillments as the Shopify Import Type.
Shopify fulfils an order through its fulfillment orders. A fulfillment order groups the lines one location is due to ship. For each record, IMan reads the order's open fulfillment orders, works out which lines and quantities to fulfil from them, and sends one fulfillmentCreate for each location involved.
Records¶
| Record | Under | One for each |
|---|---|---|
| Fulfillment | shipment of an order | |
| LineItems | Fulfillment | order line to fulfil |
Fulfillment¶
| Field | Rule |
|---|---|
| Order Id | Required. The order to fulfil, as a numeric id or a gid |
| Location Id | Fulfils only what Shopify has assigned to this location. Blank fulfils from every location |
| Tracking Company | The carrier |
| Tracking Number | One tracking number, or several separated by | |
| Tracking URL | One tracking link, or several separated by |, in the order of the numbers. Blank lets Shopify make them from the carrier and number |
| Notify Customer | True emails the customer the shipment. Blank is False |
| Message | A message about the fulfillment |
| Origin Address 1, Origin Address 2, Origin City, Origin Zip, Origin Province Code, Origin Country Code | Where the shipment left from. Origin Country Code is required with any other origin field |
| Id | Written back with the fulfillment's id, or the first one's when the shipment came from more than one location |
| Use Bulk Operations | True sends the run through bulk operations |
The tracking fields take | between values, not commas. A comma inside a tracking link therefore stays part of it.
LineItems¶
| Field | Rule |
|---|---|
| Order Line Id | Required on each LineItems record. The order's line, as a numeric id or a gid |
| Quantity | The quantity to fulfil. Blank fulfils all that is left of the line |
A record without LineItems fulfils everything left on the order, or everything left at Location Id.
How IMan Chooses What to Fulfil¶
IMan counts only the order's open fulfillment orders, at Location Id when the record gives one. It then takes each line's quantity from the fulfillment orders holding that line, in turn. Two LineItems records for one line share what is left of it.
A record fails before IMan sends anything when the order has nothing left to fulfil, or a line has less left than the record asks for:
A shipment that covers several locations makes one fulfillment for each. If Shopify refuses one of them after making another, the fulfillments already made stay, and the record fails naming the first:
Shopify shows IMan only the fulfillment orders its access scopes cover. A line that a third-party fulfillment service holds reads as having nothing left unless the app has that service's scope. See Access Scopes.
Bulk Operations¶
With Use Bulk Operations on, IMan first reads every open fulfillment order in the store with one bulk query. A run of one record takes as long to read as a run of thousands. IMan then plans each record as above and sends the fulfillments as bulk operations. Records that name the same order go in successive rounds. Each round plans against what earlier rounds took. If the bulk query fails, IMan sends nothing and fails every record. See Bulk Operations.
Access Scopes¶
The push needs read_merchant_managed_fulfillment_orders and write_merchant_managed_fulfillment_orders for the store's own locations. It needs the matching third_party or assigned scopes for fulfillment orders a fulfillment service holds. See Access Scopes.
Shopify Reference¶
fulfillmentCreate and FulfillmentOrder in Shopify's GraphQL Admin API reference.