Skip to content

Create a draft order

POST/admin/v1/stores/{store_id}/draft-orders
  • orders:write
  • Idempotency-Key supported

Create a draft order: items (catalog variants, optionally at a staff price), the customer, addresses, shipping (a store rate, a custom charge or none) and a discount. Priced like a cart.

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

  • customer_idstring · or null

    An existing customer; their email, phone and language fill in what is left blank.

  • emailstring · or null
  • phonestring · or null
  • localestring · or null

    The customer's language for the invoice, e.g. ar.

  • linesarray of objects
  • shipping_addressobject · or null

    An address for a checkout. Named apart from customers' saved addresses in the API documents.

  • billing_addressobject · or null

    An address for a checkout. Named apart from customers' saved addresses in the API documents.

  • shippingobject | object · or null

    How the order is delivered.

Returns

201 Created, priced.

Errors

  • 403forbiddenMissing permission.
  • 422validation_failedValidation failed.