Creating a checkout
POST /checkouts takes one or more line items, each pointing at a price variant by id:
"object": "checkout", id like co_...) with a URL the buyer visits to pay. When they complete it, an order is created.
Checkout fields
Multiple line items
Pay-what-you-want items
For a price variant withamount_type: "custom", pass the buyer’s chosen unit price in amount (smallest currency unit, e.g. cents). The checkout total, each item’s amount in checkout_items, discount eligibility, and the resulting order all use it.
- Omit
amountand the item uses the variant’spreset_amount, then itsminimum_amount, then the smallest price Crevio charges in that currency. - An
amountbelowminimum_amount, abovemaximum_amount, between zero and the currency’s smallest chargeable price, or that is not an integer returns400with codeinvalid_parameter.0is accepted only whenminimum_amountis0. - An
amounton afixedorfreeprice variant returns400. - The buyer can still change the amount on the hosted checkout page (
purchase_url) within the same bounds before paying.
Paying an invoice
Instead of line items, pass aninvoice id to create a checkout that settles that invoice:
Worked example: sell to a customer end-to-end
order.paid webhook event to fulfill the purchase. To run that whole path without charging a card, complete the checkout with POST /v1/checkouts/{id}/test_purchase, or open the purchase_url while signed in as the store’s owner and complete a test purchase. See Testing a paid order end to end.
Reusable checkout links
When you want one durable URL to share — in a bio link, an email, a “buy now” button — create a checkout link withPOST /checkout_links:
Checkout link fields
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.
Account-wide checkout settings
The defaults every checkout inherits — tax, address collection, which inputs the buyer sees — live on a single account-wide resource at/v1/checkout_configuration. It is a singleton: no id, GET to read and PATCH to change.
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.
