Create an order (or update, skip or refuse the one it duplicates)

Customer by { id }, { externalId } or an inline document (upserted like POST /v1/customers). Lines resolve their product by id, externalId in the channel, sku, barcode; compositions expand into their components. Totals follow the legacy rules: with items the line amounts must add up to the subtotal and the lines to the total (422 totals_mismatch with the computed values); the order total itself is refused only when totals.paid (default the total) equals the total, else stored as sent. Duplicates (externalId, then displayId, in the channel): onDuplicate update (the default) updates the existing order in the same unit (200 updated, or unchanged when nothing differs; PATCH /v1/orders/:id rules, the body read as the channel document); skip answers 200 skipped; error 409 duplicate. invoicing.generateInvoice and generatePayment create the order's invoice and record the paid amount as a payment in the same unit. Unknown fields are refused (400).

Scope: orders:write, channel:write or admin. A permission group made before the Channel API scopes existed grants it as orders:manage.

Idempotency: send Idempotency-Key; a retry with the same key replays the first answer.

Rate limit: write class, 1,200 requests per minute per tenant by default (read class 6,000). Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset; a refusal is 429 rate_limited with Retry-After.

Body Params
string
^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|[0-9a-fA-F]{24})$

Sales channel id: a uuid, or a legacy 24-hex id.

string
length between 1 and 255

The integration's own id for the document, unique within its channel.

string
length between 1 and 100

The channel's human order number (#1001): the order's displayId.

string
length between 1 and 500
date-time

ISO-8601, UTC.

date-time

ISO-8601, UTC.

string
length between 1 and 100
customer
object
shipTo
object
billTo
object
items
array of objects
required
length ≤ 1000

May be empty (legacy OC:175-222: orderItems defaults to [] with no minimum): a refund-only order (the Shopify fulfillment-order backfill sends refundItems alone) or an order with no lines at all is stored paused, as legacy stored it (OC:1378, FF:15-17).

items*
refundItems
array of objects
length ≤ 1000

The lines the channel refunded off the order (legacy refundItems): the order's refund lines, resolved like items (product precedence, kits expanded, merged) and stored beside them, outside the totals, the stock and the fulfillment (refund invoices stay POST /v1/invoices type refund). Read by the order view, the shipment credits and the invoice bounds.

refundItems
totals
object
required

Recomputed by the server: subtotal from the lines, total from subtotal + shipping + salesTax + dutyTax + vat - discount; every amount signed (a negative total is stored as sent). A mismatch is 422 totals_mismatch with the computed values. paid absent: the total on create (the channel collected it); the stored amount on an update.

discounts
array of objects
length ≤ 50
discounts
taxLines
array of objects
length ≤ 50
taxLines
tags
array of strings
length ≤ 50

Tag names; channel tagging rules may add or remove tags.

tags
metadata
object

Keys 1 to 100 characters, values up to 1000.

string
length ≤ 10000
fulfillment
object
invoicing
object
^[0-9]{4}-[0-9]{2}-[0-9]{2}$

YYYY-MM-DD (anchored at 12:00 UTC) or an ISO-8601 timestamp.


A date: stored at 12:00 UTC.

boolean
boolean

Records an order the channel already canceled: status canceled, no fulfillment.

integer
0 to 4

Line allocation rounding in places of hundredths of the currency unit; default 0.

enum

Default error (422 unresolved_reference). placeholder keeps an unknown product as a custom line and warns.

enum

What a POST does when the document already exists. Default 'update' (D7).

string
^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|[0-9a-fA-F]{24})$

The B2B storefront (a portal of the order's sales channel): the database assigns its storefront number on insert (storefrontOrderReference); never changes later.

string
^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|[0-9a-fA-F]{24})$

The cart the order was placed from. A second create for the same cart in the channel is a duplicate however late it arrives: onDuplicate skip answers the existing order; error and update refuse (409 duplicate).

integer
0 to 3650

Payment terms in days (invoices, packing slips, accounting exports read it).

enum

Default N/A. no with a balance due: the order and its lines start paused and its fulfillment orders held awaiting payment; a payment that clears the balance releases them.

string
length between 1 and 255

The purchase identity the caller keys the order to (stored as sent).

string
^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|[0-9a-fA-F]{24})$

A uuid, or a legacy 24-hex id.

selectedRate
object
string
^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|[0-9a-fA-F]{24})$

A uuid, or a legacy 24-hex id.

string
^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|[0-9a-fA-F]{24})$

Default: the customer's price list.

string
^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|[0-9a-fA-F]{24})$

A uuid, or a legacy 24-hex id.

enum
boolean
appliedCouponCodes
array of strings
length ≤ 50

The codes the caller applied (recorded; the discount itself is discounts).

appliedCouponCodes
enum

externally (default): recorded from a channel. internally: created by Kentro; a service caller only (403 forbidden otherwise).

boolean

true: the order waits for a manual stock check (status stock-review): no invoice, no fulfillment orders, and order-stock-review instead of order.created / order-created. POST /v1/orders/:id/stock-review/accept continues it; .../reject rejects it. Not with invoicing, isCanceled, fulfillment.skip or fulfillment.skipInventoryAdjustment.

Headers
string
length between 7 and 50

Any string of 7 to 50 characters that identifies this request (an order number, a webhook id). A retry with the same key and the same body answers the first result with Idempotent-Replayed: true; the same key with a different body is 422 idempotency_key_reused; a concurrent request with the same key is 409 in_progress with Retry-After. Recommended on every write.

Responses

Language
Credentials
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json