Create order

POST /api/v1/orders write:order

Fulfillment, step 2. Commits a PENDING_PAYMENT order (from POST /shipping-quote) to one of its quoted rate_ids: the order moves to PENDING and is queued for pick-pack, its ship-by date and order number are assigned, and you are billed exactly what that rate quoted. Since 2026-10-26 this call does not buy the shipping label: the warehouse buys it, against the rate you committed, at the moment it packs the parcel (carrier label links expire four days after purchase, and labels bought at pack time can be manifested for pickup the same day). So the response carries no tracking number, and the call no longer contacts the carrier: it answers in well under a second. The tracking number arrives when the parcel ships, as an order.shipped event in GET /inventory/events and on GET /orders/:order_id. Retrying is always safe: every failure mode leaves the order in PENDING_PAYMENT with nothing committed, and card preparation is all-or-nothing. Returns 201.

Try it POST /api/v1/orders money

These inputs are shared across all docs pages, so an id entered here carries over.

request body
object · 2 keys
{
  "order_id": 0,
  "rate_id": ""
}
response

Not run yet. Press Run to make a live call against https://service.rip.fun (through this demo's server-side proxy; the API key never reaches the browser).

curl (tracks the inputs above)
curl -X POST 'https://service.rip.fun/api/v1/orders' \
  -H 'X-API-Key: rip_…' \
  -H 'Content-Type: application/json' \
  -d '{"order_id":0,"rate_id":""}'

Request fields

FieldTypeRequiredDescription
order_idnumberyesThe PENDING_PAYMENT order id from /shipping-quote
rate_idstringyesA rate_id from that order's quoted rates[]
external_referencestring—Your own id for this order, 1–128 printable characters after trimming. Sets it, or replaces the one you sent with the quote; leave it out to keep the quote’s. Use it when your order id only exists once the customer checks out

Response fields (data)

FieldDescription
order_id / statusThe committed order + its new status ("PENDING")
external_referenceYour id for the order: the one sent here, else the quote’s; null if neither
referenceThe order’s human-readable number, assigned by this commit: its ship-by day as MMDDYY, then the shared sequence — e.g. 101326AA0042 for an order due out by October 13, 2026. It does not change after this. A quote referenced before 2026-10-07 keeps the random code it was given (KPTX4821)
unique_ids / ship_by_atCards on the order + target ship date, set by this commit: five business days from now, noon cutoff
shippo_rate_id / shippo_address_id / shippo_shipment_idThe committed (quoted) rate + shipment objects
shippo_tracking_number / shippo_tracking_url / shippo_label_url / label_purchased_atAll null here: the label is bought when the warehouse packs the parcel. Read them from GET /orders/:order_id, or take the tracking number from the order.shipped event
previous_tracking_numbersstring[] — tracking numbers of labels this order was moved off, oldest first; empty unless we re-labelled it. Those labels will never move — see order.tracking_updated in the events feed
tracking_status / tracking_status_atLatest carrier status of the current label (PRE_TRANSIT | TRANSIT | DELIVERED | RETURNED | FAILURE) and when the carrier recorded it; null until first checked (every 2 hours). A carrier RETURNED is the parcel on its way back to us; the order’s own status turns RETURNED only once the warehouse receives it and reinstates its cards
returned_at / returnnull on a fresh commit. Set if the carrier sends the package back and the warehouse scans its cards back into your inventory — the order is RETURNED then. Same shape as on GET /orders/:order_id

Errors

StatusCodeWhen
403Insufficient permissionskey is tenant-scoped but carries neither write:order nor admin — a read-only key can list and fetch orders but not open, commit or cancel one
400invalid inputorder_id or rate_id missing/invalid
400Invalid request bodyexternal_reference is not a string, is empty or longer than 128 characters after trimming, or contains control or invisible characters (the error says which). Nothing was committed
404order not foundorder not part of your account
409already submittedorder is not PENDING_PAYMENT (already committed) — carries data: {order_id, status, unique_ids}
409Order is no longer awaiting paymenta concurrent POST /shipping-quote for the same cards superseded this order while it was being committed. Nothing was committed or bought; quote again
409LABEL_FAILED_REPEATEDLY / SHIPPO_REJECTED / RATE_UNAVAILABLE / …only an order quoted before 2026-10-26 whose label purchase already failed for good then (GET /orders/:order_id says action_required: "requote"). retryable: false, with the last failure in data.last_label_failure. Committing it would only move the same failure to the warehouse; quote the cards again
400card not preparablea card’s status changed after you quoted — the order is untouched; re-quote (or poll GET /cards) if the card is no longer available

See Errors for the response envelope and the full code list.

Flow

  1. Needs order_id + a rate_id from POST /api/v1/shipping-quote. See the Shipping quote flow.
  2. Before 2026-10-26 this call bought the label itself and answered with the tracking number, and could fail with SHIPPO_REJECTED, RATE_UNAVAILABLE, SHIPPO_ERROR, SHIPPO_PURCHASE_AMBIGUOUS or LABEL_FAILED_REPEATEDLY. None of those apply to a quote made since: a label problem at pack time is handled by the warehouse, and the order stays PENDING until it ships. An order whose purchase already failed for good before the change is refused with its last code (409, retryable: false); quote its cards again.