Orders

Capture an order

Capture an authorized order. An order can be captured multiple times up to the full authorized amount.

post/orders/{order_id}/capture

Request

Path parameters

order_idstring required

ID of the order to capture.

Request body

amountnumber double required

Amount to capture in USD. Must not exceed the remaining authorized amount.

idempotency_keystring required

Unique key to ensure idempotent capture requests.

numberstring

Invoice or shipment number for this capture.

merchant_invoice_urlstring uri

URL of the merchant invoice PDF. Provide either this or line_items, not both.

Example request

{
  "amount": 500,
  "idempotency_key": "capture-2024-001",
  "number": "inv_100001",
  "merchant_invoice_url": "https://example.com/invoice.pdf",
  "line_items": [
    {
      "name": "Widget A",
      "quantity": 2,
      "unit_price": 50,
      "sku": "ABC-123",
      "total_price": 100,
      "type": "product",
      "tax_amount": 8.5
    }
  ]
}

Response

An object representing an order.

idstring

Unique identifier for the order.

checkout_idstring

ID of the checkout session associated with this order.

numberstring

Order number identifier.

po_numberstring

Purchase order number associated with the order.

advance_requestedboolean

Whether an advance was requested for this order.

sourcestring

Source channel that created the order.

statusstring

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

Timestamp when the authorization expires.

authorization_expiry_sourcestring

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",
  "checkout_id": "CHKabc123",
  "number": "ord_100001",
  "po_number": "PO-555",
  "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",
  "capture_events": [
    {
      "amount": 500,
      "idempotency_key": "capture-2024-001",
      "processed_at": "2024-01-15T10:00:00.000Z",
      "invoice_id": "INabc123"
    }
  ],
  "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
  }
}

Changes

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