latestOpenAPI 3.1.02026-08-141866831.1 MB

77e4ef94fcc3

orders
public

Create Order

Create a draft order for an off-session charge against a saved payment method. The order is created with status=draft and no invoice number; call POST /v1/orders/{id}/finalize to attempt the charge.

The organization must have the off_session_charges_enabled feature flag.

Scopes: orders:write

post/v1/orders/

Request body

custom_field_dataobject

Key-value object storing custom field values.

metadataobject

Key-value object allowing you to store additional information.

The key must be a string with a maximum length of 40 characters. The value must be either:

  • A string with a maximum length of 500 characters
  • An integer
  • A floating-point number
  • A boolean

You can store up to 50 key-value pairs.

organization_idstring uuid4 nullable

The organization ID.

customer_idstring uuid4 required

The ID of the customer the order is for. Must belong to the order's organization.

product_idstring uuid4 required

The ID of the one-time product to charge for. Must belong to the order's organization. Only fixed-price and free products are supported.

currencystring nullable

The currency to charge in (ISO 4217, lowercase, e.g. usd). Defaults to the organization's default currency; specify it to force a different one, or when the product isn't priced in the organization's default currency.

amountinteger nullable

A custom amount to charge, in the smallest currency unit. Overrides the product's price; defaults to the product's configured price (0 for free products). A positive amount must be at least the currency's minimum.

descriptionstring nullable

A custom description for the order's line item, shown on the invoice and receipt (e.g. 5,000 tokens). Defaults to the product name.

Example request

{
  "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"
}

Response

Successful Response

Order required— unresolved $ref