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:
Subscription lifecycle is observable via webhooks:
subscription.created, subscription.renewed, subscription.canceled, subscription.paused, subscription.resumed, subscription.past_due, and subscription.ended. See Webhooks.Cancellation feedback
When a customer cancels from the hosted billing page, the subscription carries what they told you incancellation_details — on GET /subscriptions/{id} and in the subscription.* webhook payloads, including subscription.canceled:
reason is one of too_expensive, missing_features, switched_service, unused, customer_service, too_complex, low_quality, other, or null when the reason question was turned off. cancellation_details is null for a subscription that was never cancelled from the billing page, and it keeps the most recent cancellation if the customer cancelled, resumed, and cancelled again.
What the billing page shows before a cancellation goes through is set on the checkout configuration (PATCH /checkout_configuration):
"paused": true and restarts billing on its own when the pause ends.
Discount an existing subscription
A subscription carries at most one discount, exposed asdiscount on the subscription object (an ID by default, the full object with ?expand=discount). Set it with PUT, clear it with DELETE:
duration (once, repeating, or forever). The subscription itself is untouched — same customer, price, billing date, and access — so use this instead of cancelling and re-creating a subscription to change what a customer pays.
PUT is idempotent: applying the discount a subscription already has returns it unchanged. The request is rejected with 400 when the subscription has ended, is a payment plan (its total is fixed), or when the discount is inactive, expired, or restricted to price variants the subscription isn’t for.
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
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.
An order whose status is disputed can’t be refunded: the request returns 422 with Order is not refundable, because Stripe rejects refunds on a disputed charge. Once the dispute is won the order is refundable again.
GET /v1/refunds lists refunds of test purchases next to real ones, newest first. A test refund has livemode: false, provider: "test" and an id starting with re_test_. It moved no money and never counts toward revenue.
Orders (the read model)
An order (ord_...) is the record of a completed purchase or a paid subscription renewal. You don’t create orders directly — they appear when a checkout is paid, and again for each paid renewal of a subscription or payment plan. 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.

