Skip to main content

Receive items on a Purchase Order

Marks items on an existing Purchase Order as received — the same action as clicking the "Receive" button in the app, including updating Shopify inventory (when location_id is provided) and moving the Purchase Order through its normal status stages.

Endpoint: https://po.mimoran.com/api/v1/graphql.php

mutation {
receivePurchaseOrder(
purchase_order_id: 1 //int, required
location_id: "string" //Shopify location ID to receive into. Optional — if provided, Shopify inventory is updated for this location; if omitted, only the internal received quantity is updated (Shopify inventory is left untouched)
items: [
{
purchase_order_product_id: 1 //int, required
qty_received: "float" //required, must be > 0
}
]
invoice_number: "string" //optional
invoice_date: "string" //optional, Eg: "2023-10-25"
note: "string" //optional
received_date: "string" //optional, Eg: "2023-10-25" - defaults to today if omitted
) {
purchase_order_id
status
items {
purchase_order_product_id
qty_received
}
}
}

Notes:

  • Can be called multiple times on the same Purchase Order to receive in partial batches — quantities accumulate across calls.
  • The whole mutation is rejected (no partial writes) if any line item is invalid: unknown purchase_order_product_id, a purchase_order_product_id that doesn't belong to purchase_order_id, or a qty_received that exceeds the remaining quantity still to be received for that line.
  • status is returned exactly as stored (pending, confirm, tranferring, completed, canceled).