# Fulfill an order Record the quantities included in one shipment and verify the result against the order. A fulfillment is separate from payment capture and the order's overall business status. ## Before you begin Use an Admin credential, an existing order ID, and your warehouse's shipment information. Check the order and payment state against your operational policy before shipping. Use a stable mapping from the warehouse shipment ID to the Thor fulfillment ID to prevent duplicate creation. ## 1. Read the current order Admin API ```graphql query PrepareFulfillment($id: ID!) { order(id: $id) { id orderNumber orderState paymentState shipmentState lineItems(first: 100) { nodes { id quantity } pageInfo { hasNextPage endCursor } } fulfillments { id status lines { lineItemId quantity } } } } ``` Variables ```json { "id": "" } ``` Paginate order lines if needed. Calculate remaining quantities from current, relevant fulfillment records and their statuses. Use the order-line ID for each shipment line, not the variant ID. Do not rely on a snapshot captured before another operator shipped part of the order. ## 2. Create a fulfillment Admin API ```graphql mutation FulfillOrder($input: OrderFulfillmentCreateInput!) { orderFulfillmentCreate(input: $input) { orderFulfillment { id status carrier trackingNumber trackingUrl shippedAt lines { lineItemId quantity } } errors { __typename ... on UserError { message } } } } ``` Variables ```json { "input": { "orderId": "", "supplyChannelId": "", "lines": [ { "lineItemId": "", "quantity": 1 } ] } } ``` This input creates a ready fulfillment without shipment tracking. Add actual carrier, tracking, or `shippedAt` data only when the shipment should be recorded as shipped; those fields change the creation outcome. Use [orderFulfillmentUpdate](/api/admin-graphql/mutations/order-fulfillment-update) to progress an existing fulfillment instead of creating another copy. ## 3. Verify and reconcile Read the order again and confirm the fulfillment ID, line quantity, and shipment state. Save the warehouse-to-Thor mapping before processing the next delivery of the same source event. If the creation response is lost, inspect existing fulfillments before retrying. Reconcile stock and shipment quantities through your inventory workflow. A successful fulfillment response does not replace that operational check or capture a payment. See [Fulfillments](/concepts/orders/fulfillments) and [Allocation and inventory lifecycle](/concepts/inventory/allocation).