For the complete documentation index, see llms.txt. This page is also available as Markdown.

Orders

Orders capture commerce transactions — purchases, plan changes, add-on attaches.


GET /api/v1/orders

List orders in this tenant.

  • Auth scope: read

Response 200

{
  "data": [
    {
      "id": "ord_01H...",
      "tenantId": "ten_01H...",
      "orderNumber": "ORD-1714672883000",
      "status": "draft",
      "items": [{ "productId": "prod_01H...", "quantity": 2 }],
      "totalCents": 9800,
      "currency": "USD",
      "createdAt": "2026-05-02T14:01:23Z"
    }
  ],
  "nextActions": [
    { "rel": "createOrder", "method": "POST", "href": "/api/v1/orders" }
  ]
}

cURL


POST /api/v1/orders

Create an order. The platform:

  1. Evaluates order_create policies. Any blocking policy returns 403.

  2. Resolves prices through the pricing engine for each line item with a modeled product.

  3. If any line references a product with non-modeled (passthrough) charges, calls the active billing adapter's quoteCart to get an authoritative live quote. If the adapter lacks quoteCart, returns 502.

  4. Persists the order with the authoritative total (mixed-cart safe).

  • Auth scope: commerce

Body

Field
Type
Required
Description

contactId

UUID

no

Contact placing the order

organizationId

UUID

no

Account

items

array

no

Line items (default [])

totalCents

integer

no

Hint total (defaults to 0); ignored when pricing rules apply

currency

string (≤10)

no

Defaults to USD

customerContext

object

no

Passed to the pricing engine (segment, locale, partner)

journeyId

UUID

no

Journey that produced the order

Item shape

Field
Type
Description

productId

UUID

Product reference (recommended)

quantity

integer

Defaults to 1

priceCents

integer

Hint; resolved at server-side

Response 201

Errors

Status
When

400

Validation failed

403

Blocked by an order_create policy

502

Order needs a live billing-system quote and adapter cannot fulfill it

cURL


GET /api/v1/orders/{id}

Retrieve an order.

  • Auth scope: read

Response 200

Same shape as data from POST, minus rulesApplied (the rules block is recorded at creation time only).

Errors

Status
When

404

Order not found

cURL


PATCH /api/v1/orders/{id}

Update an order's status, items, or total. Evaluates order_update policies first.

  • Auth scope: commerce

Body (all optional)

Field
Type

status

string (≤50)

items

array

totalCents

integer

Response 200

Errors

Status
When

403

Blocked by an order_update policy

404

Order not found

cURL


Last updated

Was this helpful?