Send a draft (or approve and send one waiting for approval) to the vendor

Needs a ship-to warehouse with a queue location and at least one line (409 otherwise). The purchase order becomes ordered, incoming stock is reserved at the warehouse queue per product line (a custom item or a charge reserves nothing) and the vendor is emailed unless notifyVendor is false (then nobody is emailed and nobody is saved, whatever recipients says). The email goes To recipients (one address once, in the order given; absent on a send: the vendor contacts who get purchase orders), CC the user who sends it unless they are a recipient, and reply-to that user (the purchase order's creator when the caller is an API key). A recipient with saveAsContact: true needs a name and is saved to the vendor in the same request: a new contact who gets purchase orders, or the vendor's contact with that address switched to get them (and named when it has no name); 422 when the purchase order has no vendor. emailed answers who the email was addressed to and how many contacts were saved; it is absent when nobody was emailed. A draft that was sent before and still holds incoming stock from that time is not reserved a second time: what it holds counts, only what is missing is reserved, and what it holds beyond its lines (or at another date or warehouse) is released. The purchase order gets its order date now: orderDate when sent, else the one it already has, else the moment it is sent. A balance due date and a ship-not-before date that were derived (a draft counts them from the day it was created) move to count from that order date; dates the caller set are kept. A purchase order that was already sent is 409: stock is never reserved twice.

Scope: outgoing-purchase-orders:write, channel:write or admin. A permission group made before the Channel API scopes existed grants it as inventory:manage or supply-chain: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.

Path Params
string
required
length between 1 and 64

The purchase order's uuid or 24-hex id.

Body Params
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