Subscriptions
A subscription (sub_...) is created when a buyer pays for a subscription price variant. You don’t create subscriptions over the API — you list, retrieve, and change their state.
List and retrieve
Change subscription state
Each lifecycle action is its ownPOST sub-route:
| Action | Endpoint |
|---|---|
| Cancel | POST /subscriptions/{id}/cancel |
| Pause | POST /subscriptions/{id}/pause |
| Resume | POST /subscriptions/{id}/resume |
Invoices
An invoice (inv_...) is a request for payment you send to a customer. Create one, then the customer pays it by opening a checkout.
Create an invoice
| Field | Notes |
|---|---|
customer | The customer id (cus_...) being billed. |
customer_name / email_address | Recipient details for the invoice. |
price_variant | The price variant (price_...) this invoice charges for. |
description | Free-text line shown on the invoice. |
due_at | When payment is due (date-time). |
Pay an invoice
Paying an invoice goes through a checkout — pass the invoice id as theinvoice param:
Void an invoice
To cancel an unpaid invoice:Invoice lifecycle is observable via webhooks:
invoice.created, invoice.paid, invoice.past_due, and invoice.voided.Refunds
A refund returns money on an existing order. The only required field is theorder; omit amount for a full refund, or pass an amount in cents for a partial one.
Full refund
Partial refund
amount: 2000 refunds $20.00 of the order. The optional reason and notes are recorded with the refund. Refunds are also listable and retrievable, and emit refund.created / refund.updated webhooks.
Orders (the read model)
An order (ord_...) is the record of a completed purchase. You don’t create orders directly — they appear when a checkout is paid. Orders are made of order items (ordi_...), one per price variant purchased, and carry a charge (ch_...) for the payment.
expand query param to inline related resources (e.g. customer) that otherwise appear as bare id strings. Individual line items are also retrievable directly via the order items endpoints.
Next steps
Checkouts
Create the checkouts that produce orders and pay invoices.
Products & pricing
Configure subscription and payment-plan price variants.
Webhooks
Subscribe to
order.paid, invoice.paid, refund.created, and more.Commerce overview
See how subscriptions, invoices, and refunds fit the whole model.

