Orders

Create an order

Authorize a new order for a customer of one of your sub-merchants. The order is placed with the sub-merchant the customer belongs to; a customer outside your partner account is rejected.

post/orders

Request

Request body

amountnumber double required

Amount to authorize for the order in USD.

customer_idstring required

Unique identifier of the customer placing the order. The order is placed with the sub-merchant this customer belongs to.

order_numberstring

The sub-merchant's order number.

po_numberstring

Purchase order number.

advance_requestedboolean

Whether to place the order on net terms against the customer's credit line. Defaults to true.

sourcestring

Source channel creating the order. Defaults to api.

metadataobject

Custom metadata to attach to the order.

Example request

{
  "amount": 1000,
  "customer_id": "X50sgfRd",
  "line_items": [
    {
      "name": "Widget A",
      "quantity": 2,
      "unit_price": 50,
      "sku": "ABC-123",
      "total_price": 100,
      "type": "product",
      "tax_amount": 8.5
    }
  ],
  "order_number": "5055",
  "po_number": "PO-555",
  "advance_requested": true,
  "source": "api",
  "metadata": {
    "internal_ref": "ref-001"
  }
}

Response

An object representing an order.

idstring

Unique identifier for the order.

merchant_idstring

ID of the sub-merchant this order belongs to.

checkout_idstring nullable

ID of the checkout session that produced this order when a buyer authorized it through the sub-merchant's Checkout SDK. null for orders created through the API.

numberstring nullable

Order number identifier.

po_numberstring nullable

Purchase order number associated with the order.

advance_requestedboolean

Whether the order is placed on net terms against the customer's credit line.

sourcestring

Channel that created the order, for example checkout for Checkout SDK orders or api for orders created through the API.

status'authorized' | 'partially_captured' | 'fully_captured' | 'canceled'

Current status of the order.

amount_authorizednumber double

Total authorized amount for the order in USD.

amount_capturednumber double

Total captured amount for the order in USD.

amount_cancelednumber double

Total canceled amount for the order in USD.

amount_remainingnumber double

Remaining authorized amount available for capture in USD.

first_captured_atstring date-time nullable

Timestamp of the first capture event.

authorization_expires_atstring date-time nullable

Timestamp when the authorization expires.

authorization_expiry_sourcestring nullable

Source that determined the authorization expiry.

authorized_atstring date-time

Timestamp when the order was authorized.

updated_atstring date-time

Timestamp when the order was last updated.

Example response

{
  "id": "ORDlaE5wbg0",
  "merchant_id": "MER456789",
  "checkout_id": "CHKabc123",
  "number": "ord_100001",
  "po_number": "PO-555",
  "advance_requested": true,
  "source": "checkout",
  "status": "authorized",
  "amount_authorized": 1000,
  "amount_captured": 500,
  "amount_remaining": 500,
  "first_captured_at": "2024-01-15T10:00:00.000Z",
  "line_items": [
    {
      "name": "Widget A",
      "quantity": 2,
      "unit_price": 50,
      "sku": "ABC-123",
      "total_price": 100,
      "type": "product",
      "tax_amount": 8.5
    }
  ],
  "authorization_expires_at": "2024-02-15T10:00:00.000Z",
  "authorization_expiry_source": "system",
  "authorized_at": "2024-01-01T00:00:00.000Z",
  "updated_at": "2024-01-15T10:00:00.000Z",
  "customer": {
    "id": "X50sgfRd",
    "name": "Acme Corp",
    "remaining_credit": 5000
  },
  "capture_events": [
    {
      "amount": 500,
      "idempotency_key": "capture-2024-001",
      "processed_at": "2024-01-15T10:00:00.000Z",
      "invoice_id": "INabc123"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.