Skip to main content
POST
commerce.order.create

Authorizations

Authorization
string
header
required

API key: sk_live_…

Headers

Idempotency-Key
string
required

Required: this capability has an external effect.

Maximum string length: 255
Pramaan-Account
string

Optional. One of your account ids (GET /v1/accounts): run on that account, whatever your routing rules say. The response header X-Pramaan-Account names the account that ran.

Pramaan-End-User
string

Optional. Your own tag for your end user: a sticky: end_user rule keeps them on the account that first served them.

Maximum string length: 256
Pramaan-End-User-Group
string

Optional. Your end user's group, matched by rules with endUserGroup.

Maximum string length: 64

Body

application/json
locationId
string
required

Location from local.locations.list.

Required string length: 1 - 255
Pattern: ^[A-Za-z0-9_-]+$
lineItems
object[]
required

1 to 100 order line items.

Required array length: 1 - 100 elements
customerId
string

Optional customer from your connected account.

Required string length: 1 - 255
Pattern: ^[A-Za-z0-9_-]+$
state
enum<string>
default:open

Initial state; draft orders cannot be paid or fulfilled.

Available options:
draft,
open
taxes
object[]

Explicit taxes; no automatic tax calculation.

Maximum array length: 20
discounts
object[]

Explicit discounts.

Maximum array length: 20
serviceCharges
object[]

Fixed service charges added after taxes.

Maximum array length: 20
fulfillment
object

Optional pickup or shipping recipient and instructions; contains personal contact data.

Response

The result

orderId
string
required

Order id in your connected commerce account.

locationId
string
required

Location associated with the order.

status
enum<string>
required

Current order state.

Available options:
open,
completed,
canceled,
draft,
unknown
lineItems
object[]
required

Order line items.

customerId
string

Customer associated with the order.

version
integer

Current version for updates.

Required range: -9007199254740991 <= x <= 9007199254740991
createdAt
string

Creation time, ISO 8601.

updatedAt
string

Last update time, ISO 8601.

total
object

Order total, including tax.

tax
object

Total taxes.

discount
object

Total discounts.

serviceCharge
object

Total service charges.

fulfillments
object[]

Selected fulfillment contact details; only returned when requested.