Skip to main content
POST
Create Order

Authorizations

Authorization
string
header
required

You can generate a Personal Access Token from your settings.

Body

application/json

Schema to create a draft order for an off-session charge.

customer_id
string<uuid4>
required

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

product_id
string<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.

custom_field_data
Custom Field Data · object

Key-value object storing custom field values.

metadata
Metadata · object

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_id
string<uuid4> | null

The organization ID.

Example:

"1dbfc517-0bbf-4301-9ba8-555ca42b9737"

currency
string | null

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.

amount
integer | null

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.

Required range: x >= 0
description
string | null

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.

Maximum string length: 500

Response

Successful Response

id
string<uuid4>
required

The stable identifier for this record.

created_at
string<date-time>
required

The time Ruba created this record.

modified_at
string<date-time> | null
required

The time this record last changed.

status
enum<string>
required
Available options:
draft,
pending,
paid,
refunded,
partially_refunded,
void
Example:

"paid"

paid
boolean
required

Whether the order has been paid for.

Example:

true

subtotal_amount
integer
required

Amount in cents, before discounts and taxes.

Example:

10000

discount_amount
integer
required

Discount amount in cents.

Example:

1000

net_amount
integer
required

Amount in cents, after discounts but before taxes.

Example:

9000

tax_amount
integer
required

Sales tax amount in cents.

Example:

720

total_amount
integer
required

Amount in cents, after discounts and taxes.

Example:

9720

applied_balance_amount
integer
required

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.

Example:

0

due_amount
integer
required

Amount in cents that is due for this order.

Example:

0

refunded_amount
integer
required

Amount refunded in cents.

Example:

0

refunded_tax_amount
integer
required

Sales tax refunded in cents.

Example:

0

currency
string
required
Example:

"usd"

billing_reason
enum<string>
required
Available options:
purchase,
subscription_create,
subscription_cycle,
subscription_update
billing_name
string | null
required

The name of the customer that should appear on the invoice.

billing_address
Address · object | null
required
invoice_number
string | null
required

The invoice number associated with this order. null while the order is in draft status; assigned at finalize.

is_invoice_generated
boolean
required

Whether an invoice has been generated for this order.

receipt_number
string | null
required

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.

customer_id
string<uuid4>
required
product_id
string<uuid4> | null
required
discount_id
string<uuid4> | null
required
subscription_id
string<uuid4> | null
required
checkout_id
string<uuid4> | null
required
metadata
object
required
platform_fee_amount
integer
required

Platform fee amount in cents.

Example:

500

platform_fee_currency
string | null
required

Currency of the platform fee.

Example:

"usd"

customer
OrderCustomer · object
required
product
OrderProduct · object | null
required
discount
DiscountFixedOnceForeverDurationBase · object
required
subscription
OrderSubscription · object | null
required
items
OrderItemSchema · object[]
required

Line items composing the order.

description
string
required

A summary description of the order.

Example:

"Pro Plan"

refundable_amount
integer
required
read-only

Amount in cents that can still be refunded (net, before taxes). Accounts for any applied customer balance and previous refunds.

Example:

9000

refundable_tax_amount
integer
required
read-only

Sales tax in cents that would be refunded if the full refundable amount is refunded.

Example:

720

seats
integer | null

Number of seats purchased (for seat-based one-time orders).

next_payment_attempt_at
string<date-time> | null

When the next automatic payment retry is scheduled. null if the order is not in dunning or all retries have been exhausted.

custom_field_data
Custom Field Data · object

Key-value object storing custom field values.