Orders

An order is a committed cart with a charged payment method. Orders are immutable in all fields except status, fulfilment, and metadata.

Object

FieldTypeNotes
idstringorder_…, ULID
cart_idstringcart_…, frozen at order creation
customer_idstring?cust_… if a known customer
line_items[]arraySnapshot of cart at order creation
currencystringISO 4217
subtotal_centsintegerBefore tax + shipping
tax_total_centsinteger
shipping_total_centsinteger
total_centsintegerCharged to the customer
tax_calculation_sourceenumzephyr, stripe_tax, avalara
statusenumcreated, paid, partially_refunded, refunded, cancelled
livemodebooleanfalse in test mode
placed_attimestampWhen the customer confirmed the order

Endpoints

MethodPathPurpose
GET/v1/ordersList, paginated
GET/v1/orders/{id}Retrieve
PATCH/v1/orders/{id}Update (status, fulfilment, metadata only)
POST/v1/orders/{id}/refundsRefund full or partial
POST/v1/orders/{id}/cancelCancel before fulfilment

Refunds

curl -sS https://api.zephyrcart.io/v1/orders/order_01HXY8.../refunds \
  -H "Authorization: Bearer $ZEPHYR_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "amount_cents": 1490,
    "reason": "requested_by_customer",
    "metadata": { "ticket": "ZD-31427" }
  }'

reason is one of requested_by_customer, duplicate, fraudulent. The deprecated free-text note field still works but will be removed in v2 — see the Changelog 2026-05-30.

Cancellation

An order can be cancelled before its first fulfilment is recorded. After that, you refund instead. The transition is irreversible.

curl -X POST https://api.zephyrcart.io/v1/orders/order_…/cancel \
  -H "Authorization: Bearer $ZEPHYR_API_KEY"

Webhook events

  • order.created — fired once, on placement.
  • order.updated — fired on any mutable-field change.
  • order.refunded — fired on each refund, including partials.
  • order.cancelled — fired once.

Full reference: Webhooks.