> For the complete documentation index, see [llms.txt](https://docs.hotwax.co/documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hotwax.co/documents/learn-shopify/shopify-reference/order-fulfillment.md).

# Order Fulfillment

Learn how HotWax Commerce fulfills orders and updates fulfillment status to Shopify.

Once an order is routed to a fulfillment center in HotWax Commerce, it can be fulfilled using either the HotWax Commerce Fulfillment App or an external system such as a warehouse management system (WMS).

## Fulfillment by HotWax Commerce Fulfillment App

HotWax Commerce provides [**Fulfillment App**](https://github.com/hotwax/oms-documentation/tree/user-guides-pub/documents/store-operations/fulfillment/README.md) that enables picking, packing, and shipping of orders from stores. Shipping completes the store shipment’s fulfillment work. Other shipments on the same order can still be open.

## Fulfillment by an external system

For shipments fulfilled by an external system, HotWax Commerce receives the fulfillment quantities and status from that system. The configured fulfillment sync then sends the shipped quantities and available tracking details to Shopify.

## Updating fulfillment status to Shopify

Sync follows the eligible shipped quantities. A shipment can sync while other items on the order remain unfulfilled; creating one fulfillment does not establish that the entire order is fulfilled.

```mermaid
sequenceDiagram
    accTitle: HotWax shipment fulfillment sync to Shopify
    accDescr: A shipped HotWax shipment enters its configured event or feed sync path. The connector reads Shopify fulfillment orders and sends the shipped line quantities and tracking through fulfillmentCreate. A successful response supplies the fulfillment ID for recording; an error requires checking the message outcome before recovery.
    participant H as HotWax shipment
    participant C as Fulfillment sync
    participant S as Shopify
    H->>C: Shipped quantities and tracking
    C->>C: Configured event or file-feed handoff
    C->>S: Read fulfillment orders and remaining lines
    S-->>C: Fulfillment-order IDs and line details
    C->>S: fulfillmentCreate: shipped quantities and tracking
    alt Fulfillment ID returned without errors
        S-->>C: Fulfillment ID and status
        C->>C: Record fulfillment ID and history
    else Request or fulfillment error
        S-->>C: Error details
        C->>C: Inspect message outcome before recovery
    end
```

### 1. Collecting shipped quantities

The entry path depends on the instance's fulfillment configuration:

| Path                  | Handoff to Shopify sync                                                                                                                                                                                       |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Shipment event        | The shipped-status event queues a `CreateShopifyFulfillment` message. The dedicated `send_CreateShopifyFulfillmentProducedSystemMessages` job sends queued messages.                                          |
| Fulfillment file feed | The configured feed supplies eligible shipment records. In the current connector, `poll_SystemMessageFileSftp_OMSFulfillmentFeed` polls the fulfillment feed; its consumer creates the per-shipment messages. |

Check which path your instance uses and whether its required jobs are running. The polling interval belongs to the file-feed path; it does not describe every fulfillment integration. A queued message is a handoff, not proof that Shopify accepted the fulfillment.

### 2. Retrieving fulfillment orders from Shopify

The connector reads Shopify fulfillment-order IDs, line-item IDs, and remaining quantities for the order. It matches the shipped line quantities to fulfillment orders that can still be fulfilled.

### 3. Creating fulfillment on Shopify

HotWax Commerce sends the GraphQL [`fulfillmentCreate` mutation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/fulfillmentCreate) with the matched line quantities and any available tracking information. Shopify creates a fulfillment for those items. The order can remain `Partially Fulfilled` when other items still need fulfillment.

<figure><img src="https://1292394199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq42f0puI9OYah51t08oQ%2Fuploads%2Fgit-blob-8317dab6c1cf470775b90b18c7688c88e3c0516a%2Fshopify-partially-fulfilled-order.jpg?alt=media" alt="Shopify demo order with one unfulfilled Autumn Pullie item at Broadway and one fulfilled Erica Evercool Sports Bra item at Brooklyn"><figcaption><p>A Shopify demo order showing separate fulfilled and unfulfilled items. One fulfillment does not complete the remaining item.</p></figcaption></figure>

### 4. Checking the result

The connector checks for errors and requires a returned fulfillment ID before recording success. Verify the fulfillment record and quantities in Shopify, rather than relying only on the local shipment status or a completed job run.

If the update is missing, check the shipment's eligibility, the configured feed or sender job, and the `CreateShopifyFulfillment` message outcome. If Shopify may already have accepted the request, verify its fulfillment ID and line quantities before retrying. Keep the affected shipment distinct from other shipments on the same order.

## Troubleshooting Shopify quantity errors

When Shopify rejects a fulfillment update with a quantity error, such as `Invalid fulfillment order line item quantity requested`, do not retry the failed update until the current Shopify fulfillment order is checked.

Before retrying:

* Retrieve the latest fulfillment orders for the Shopify order.
* Confirm that the fulfillment order is still open and eligible for fulfillment.
* Match the Shopify order line item to the current fulfillment order line item.
* Verify that the remaining fulfillable quantity is greater than or equal to the quantity HotWax Commerce is sending.
* Check whether the item was already fulfilled, canceled, moved to a different fulfillment order, or partially fulfilled outside the current HotWax Commerce retry.

Retrying without this check can keep sending a quantity that Shopify no longer considers fulfillable. If the Shopify fulfillment order has changed, update the HotWax Commerce fulfillment data or stop the retry until the order state is corrected.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hotwax.co/documents/learn-shopify/shopify-reference/order-fulfillment.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
