Skip to main content
A checkout is a single pay-for-this session; a checkout link is a reusable, shareable URL that opens one. Both turn your published price variants into money. You can ask Crevio to “send Jane a checkout for the $99 course with the LAUNCH20 code” and the agent builds it through the same API below. For programmatic flows — custom websites, “buy now” buttons, invoicing — you’ll create checkouts directly.

Creating a checkout

POST /checkouts takes one or more line items, each pointing at a price variant by id:
The response is a checkout ("object": "checkout", id like co_...) with a URL the buyer visits to pay. When they complete it, an order is created.

Checkout fields

FieldTypeNotes
line_itemsarrayEach item is { price_variant (required), quantity }. Add multiple to sell a bundle in one checkout.
emailstringThe buyer’s email. Use this for a brand-new buyer.
customerstringAn existing customer id (cus_...). Use instead of email to attach the purchase to a known customer.
discount_codestringA discount code applied to this checkout. See Discounts.
invoicestringAn invoice id (inv_...) to pay — an alternative to line_items. See below.

Multiple line items

Paying an invoice

Instead of line items, pass an invoice id to create a checkout that settles that invoice:
See Subscriptions & billing for creating and managing invoices.

Worked example: sell to a customer end-to-end

When the buyer pays, listen for the order.paid webhook event to fulfill the purchase. When you want one durable URL to share — in a bio link, an email, a “buy now” button — create a checkout link with POST /checkout_links:
FieldTypeNotes
namestringInternal label for the link.
price_variantsarrayThe price variant ids (price_...) the link sells.
discountstringA discount id (disc_...) applied automatically. See Discounts.
allow_discount_codesboolWhether buyers can enter their own code at checkout.
success_urlstringWhere to send the buyer after a successful purchase.
metadataobjectArbitrary key/values that flow through to the resulting order — handy for attribution.
The response includes an id (cl_...) and the shareable URL. Checkout links support full CRUD — update, list, retrieve, and delete them like any other resource.
Use a checkout for a one-off, often personalized sale (you know the buyer), and a checkout link for an evergreen, shareable offer (anyone can open it).

Next steps

Discounts

Build the promo codes you apply via discount_code and discount.

Subscriptions & billing

Orders, invoices, refunds, and managing recurring revenue after checkout.

Products & pricing

Create the price variants your checkouts and links reference.

Webhooks

React to checkout.created, order.paid, and other events in real time.