Create Order
Intent
Creates an order from the values supplied in the request.
When to call it
Call this when your application has collected the required values and is ready to create an order.
Access boundary
Authorize the request with a token that carries orders:write.
Successful result
A successful request returns 201. The response schema below defines the body your integration receives.
Operational notes
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
Authorizations
Body
Schema to create a draft order for an off-session charge.
The ID of the customer the order is for. Must belong to the order's organization.
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.
Key-value object storing custom field values.
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.
The organization ID.
"1dbfc517-0bbf-4301-9ba8-555ca42b9737"
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.
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.
x >= 0A custom description for the order's line item, shown on the invoice and receipt (e.g. 5,000 tokens). Defaults to the product name.
500Response
Successful Response
The stable identifier for this record.
The time Ruba created this record.
The time this record last changed.
draft, pending, paid, refunded, partially_refunded, void "paid"
Whether the order has been paid for.
true
Amount in cents, before discounts and taxes.
10000
Discount amount in cents.
1000
Amount in cents, after discounts but before taxes.
9000
Sales tax amount in cents.
720
Amount in cents, after discounts and taxes.
9720
Customer's balance amount applied to this invoice. Can increase the total amount paid, if the customer has a negative balance, or decrease it, if the customer has a positive balance.Amount in cents.
0
Amount in cents that is due for this order.
0
Amount refunded in cents.
0
Sales tax refunded in cents.
0
"usd"
purchase, subscription_create, subscription_cycle, subscription_update The name of the customer that should appear on the invoice.
The invoice number associated with this order. null while the order is in draft status; assigned at finalize.
Whether an invoice has been generated for this order.
The receipt number for this order. Set once the order is paid for organizations with receipts enabled. When set, a downloadable receipt PDF can be obtained via the receipt endpoint.
Platform fee amount in cents.
500
Currency of the platform fee.
"usd"
- DiscountFixedOnceForeverDurationBase
- DiscountFixedRepeatDurationBase
- DiscountPercentageOnceForeverDurationBase
- DiscountPercentageRepeatDurationBase
Line items composing the order.
A summary description of the order.
"Pro Plan"
Amount in cents that can still be refunded (net, before taxes). Accounts for any applied customer balance and previous refunds.
9000
Sales tax in cents that would be refunded if the full refundable amount is refunded.
720
Number of seats purchased (for seat-based one-time orders).
When the next automatic payment retry is scheduled. null if the order is not in dunning or all retries have been exhausted.
Key-value object storing custom field values.