Fulfillments
What the shop sent of an order: units of its lines shipped together, each fulfillment with the tracking of its parcel. An order is sent in one or in several; a fulfillment is marked delivered, or cancelled to send its units again.
List fulfillments
Lists the order's fulfillments, the oldest first, cancelled ones too — all of them in one page by default: an order holds at most 100. Neither filters nor sorts.
path Parameters
website_idId of the parent website.
order_idId of the parent order.
query Parameters
page_sizeRows per page. Over the maximum is clamped, not rejected.
page_tokenOpaque token from a previous next_page_token. A token minted under a different order_by/filter is rejected.
skipRows to skip before the page (AIP-158). skip + page_size is capped at 10000; beyond that is OUT_OF_RANGE.
order_byComma-separated field [asc|desc], at most 3 keys. Default: create_time desc. Sortable: none — this collection serves its documented order only.
filterAIP-160 subset (§8). Filterable: none. A field outside the list is INVALID_ARGUMENT.
List fulfillments › Responses
One page of fulfillments.
This page of fulfillments, in the requested order.
next_page_tokenOpaque. Absent or empty means this was the last page.
total_sizeRows in the whole filtered collection, not in this page.
Create fulfillment
Records units of the order as sent, paid or not. Without a body — or without lines — it sends every unit left to send of every line; {"lines": [{"line_id": "Xk9_a2Lm", "quantity": 1}]} sends that much of the lines named, each line once, and tracking — {carrier?, tracking_number?, tracking_uri?} — says how the parcel is followed. The fulfillment is SHIPPED, the lines' fulfilled_quantity grows by what it sends, and the order becomes PARTIALLY_FULFILLED, or FULFILLED once every unit not cancelled is sent — COMPLETED when nothing is outstanding. The stock does not change: the order took it when it was placed. The customer is sent the order_shipped email — what this parcel holds, the tracking and where it goes, in the language of the view the order was placed on — unless the body says "notify_customer": false. A fulfillment cancelled before its email went takes the email with it. FAILED_PRECONDITION answers, nothing recorded and no email sent: FULFILLMENT_QUANTITY for lines asked more of than is left of them, or that the order has not, one violation each with its line_id and the units remaining; NOTHING_TO_FULFILL when every unit is sent or cancelled already; ORDER_STATUS for a cancelled order; LIMIT for a 101st fulfillment, or one that would take the order's fulfillments past 20000 lines. {"request_id": "…"} makes the call safe to repeat: a repeat answers the fulfillment it recorded. Two at once never send more than is left: the one that comes second is checked against what the first left. Answers 201 and the fulfillment.
path Parameters
website_idId of the parent website.
order_idId of the parent order.
Create fulfillment › Request Body
linesThe units it sends: [{line_id, quantity}], line_id the id of a line of the order, each line once, and how many of its units — no more than are left to send of it (quantity − cancelled_quantity − fulfilled_quantity). Left out on Create, every unit left to send of every line. Set on Create alone.
trackingHow the parcel is followed, each part when the shop has it: {carrier?, tracking_number?, tracking_uri?} — the carrier's name and its tracking number, up to 100 characters each, and the page that follows the parcel, an http or https URL of up to 2000. Absent when none was given; Update with update_mask=tracking replaces it whole, null clears it.
request_idAn idempotency key you choose, at most 64 characters. Creating with a key the order already has a fulfillment of answers that fulfillment and sends nothing again.
notify_customerWhether the customer is sent the order_shipped email of the fulfillment — what this parcel holds, its tracking and where it goes — in the language of the view the order was placed on. True unless you send false; read on Create alone.
Create fulfillment › Responses
The created resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
statusWhere the fulfillment is: SHIPPED once it is recorded — its units are on their way; DELIVERED once :mark_delivered says they arrived; CANCELLED once :cancel took it back, its units left to send again. DELIVERED and CANCELLED move no more.
linesThe units it sends: [{line_id, quantity}], line_id the id of a line of the order, each line once, and how many of its units — no more than are left to send of it (quantity − cancelled_quantity − fulfilled_quantity). Left out on Create, every unit left to send of every line. Set on Create alone.
trackingHow the parcel is followed, each part when the shop has it: {carrier?, tracking_number?, tracking_uri?} — the carrier's name and its tracking number, up to 100 characters each, and the page that follows the parcel, an http or https URL of up to 2000. Absent when none was given; Update with update_mask=tracking replaces it whole, null clears it.
ship_timeWhen the units were sent: when the fulfillment was recorded.
deliver_timeWhen :mark_delivered said the units arrived; absent before.
cancel_timeWhen :cancel took the fulfillment back; absent on one not cancelled.
actorWho recorded the fulfillment: {type, id?} — type USER and id the user of the account who created it.
Get fulfillment
A fulfillment of an order: units of its lines the shop sent together, with the tracking of their parcel. An order is sent in one fulfillment or in several; each counts in its lines' fulfilled_quantity and the order's fulfillment_status while it is not CANCELLED. A fulfillment is never deleted: a mistaken one is cancelled. An order holds at most 100, of 20000 lines in all; listed the oldest first.
path Parameters
website_idId of the parent website.
order_idId of the parent order.
fulfillment_idId of the parent fulfillment.
Headers
If-None-MatchA matching etag answers 304 with no body (§16).
Get fulfillment › Responses
The resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
statusWhere the fulfillment is: SHIPPED once it is recorded — its units are on their way; DELIVERED once :mark_delivered says they arrived; CANCELLED once :cancel took it back, its units left to send again. DELIVERED and CANCELLED move no more.
linesThe units it sends: [{line_id, quantity}], line_id the id of a line of the order, each line once, and how many of its units — no more than are left to send of it (quantity − cancelled_quantity − fulfilled_quantity). Left out on Create, every unit left to send of every line. Set on Create alone.
trackingHow the parcel is followed, each part when the shop has it: {carrier?, tracking_number?, tracking_uri?} — the carrier's name and its tracking number, up to 100 characters each, and the page that follows the parcel, an http or https URL of up to 2000. Absent when none was given; Update with update_mask=tracking replaces it whole, null clears it.
ship_timeWhen the units were sent: when the fulfillment was recorded.
deliver_timeWhen :mark_delivered said the units arrived; absent before.
cancel_timeWhen :cancel took the fulfillment back; absent on one not cancelled.
actorWho recorded the fulfillment: {type, id?} — type USER and id the user of the account who created it.
Update fulfillment
Changes the fulfillment's tracking — the one thing of it that changes so: {"tracking": {"carrier": "DHL", "tracking_number": "…", "tracking_uri": "https://…"}} (update_mask=tracking) replaces it whole, and null under the mask clears it. lines is fixed and refused here; status moves by :mark_delivered and :cancel. A cancelled fulfillment's tracking answers FAILED_PRECONDITION FULFILLMENT_STATUS. Answers the fulfillment.
path Parameters
website_idId of the parent website.
order_idId of the parent order.
fulfillment_idId of the parent fulfillment.
query Parameters
update_maskComma-separated field paths to merge. A field named here and sent as null is cleared; without the mask a null is dropped (§7, §11).
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Update fulfillment › Request Body
trackingHow the parcel is followed, each part when the shop has it: {carrier?, tracking_number?, tracking_uri?} — the carrier's name and its tracking number, up to 100 characters each, and the page that follows the parcel, an http or https URL of up to 2000. Absent when none was given; Update with update_mask=tracking replaces it whole, null clears it.
request_idAn idempotency key you choose, at most 64 characters. Creating with a key the order already has a fulfillment of answers that fulfillment and sends nothing again.
notify_customerWhether the customer is sent the order_shipped email of the fulfillment — what this parcel holds, its tracking and where it goes — in the language of the view the order was placed on. True unless you send false; read on Create alone.
Update fulfillment › Responses
The updated resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
statusWhere the fulfillment is: SHIPPED once it is recorded — its units are on their way; DELIVERED once :mark_delivered says they arrived; CANCELLED once :cancel took it back, its units left to send again. DELIVERED and CANCELLED move no more.
linesThe units it sends: [{line_id, quantity}], line_id the id of a line of the order, each line once, and how many of its units — no more than are left to send of it (quantity − cancelled_quantity − fulfilled_quantity). Left out on Create, every unit left to send of every line. Set on Create alone.
trackingHow the parcel is followed, each part when the shop has it: {carrier?, tracking_number?, tracking_uri?} — the carrier's name and its tracking number, up to 100 characters each, and the page that follows the parcel, an http or https URL of up to 2000. Absent when none was given; Update with update_mask=tracking replaces it whole, null clears it.
ship_timeWhen the units were sent: when the fulfillment was recorded.
deliver_timeWhen :mark_delivered said the units arrived; absent before.
cancel_timeWhen :cancel took the fulfillment back; absent on one not cancelled.
actorWho recorded the fulfillment: {type, id?} — type USER and id the user of the account who created it.
Cancel (fulfillment)
Takes a fulfillment back that did not go out: SHIPPED becomes CANCELLED, with cancel_time, and the units it sent are left to send again — each line's fulfilled_quantity goes down by them, and the order's fulfillment_status and status follow (a COMPLETED order is OPEN again). The stock does not change. Takes no body. A fulfillment delivered or cancelled already answers FAILED_PRECONDITION FULFILLMENT_STATUS with its status. Answers the fulfillment.
path Parameters
website_idId of the parent website.
order_idId of the parent order.
fulfillment_idId of the parent fulfillment.
Cancel (fulfillment) › Request Body optional
Cancel (fulfillment) › Responses
The affected resource, or the method’s own response object (§10).
Mark delivered (fulfillment)
Records that the fulfillment's units arrived: SHIPPED becomes DELIVERED, with deliver_time. Takes no body. A fulfillment delivered or cancelled already answers FAILED_PRECONDITION FULFILLMENT_STATUS with its status. Answers the fulfillment.
path Parameters
website_idId of the parent website.
order_idId of the parent order.
fulfillment_idId of the parent fulfillment.
Mark delivered (fulfillment) › Request Body optional
Mark delivered (fulfillment) › Responses
The affected resource, or the method’s own response object (§10).