Skip to content

Create purchase order

POST/admin/v1/stores/{store_id}/inventory/purchase-orders
  • Idempotency-Key supported

Draft a purchase order: what's ordered from a supplier, delivered to one location.

Path parameters

  • store_idstringrequired

    The store's ID, like store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.

Headers

  • Idempotency-Keystring

    Send the same key to retry safely: the first answer is replayed for 24 hours.

  • shop-api-versionYYYY-MM

    The version to answer in. Without it, your app’s pinned version, else the newest.

Body

  • supplier_idstringrequired

    TypeID with the supl prefix.

  • destination_idstringrequired

    Where the stock arrives; an active location.

  • linesarray of objectsrequired

    What's ordered, in order (1–250 different items).

  • currency_codestring · or null

    Three letters; blank for the supplier's currency. Fixed once anything arrives.

  • referencestring · or null

    The supplier's quote or invoice number (up to 100 characters).

  • notestring · or null

    Up to 1,000 characters.

  • expected_ondate · or null

    When it should arrive (YYYY-MM-DD).

  • adjustmentsarray of objects

    Shipping, customs, a discount (up to 10): a label and a signed amount.

Returns

201 The draft.

Errors

  • 403forbiddenMissing permission, or a location you don't work at.
  • 422validation_failedAn unknown or archived supplier, an inactive location, an unknown or uncounted item, or a bad quantity or cost.