Checkouts

Create checkout session

Changed on

Creates a new checkout session for purchasing products. Identify the buyer with contact (an existing contact id) or email; one of them is required.

post/checkouts

Request

  • Base URL
    https://api.crevio.co/v1
  • Auth
    API key in header Authorization

Headers

Idempotency-Key, string

Makes this write safe to retry: a repeat with the same key replays the first response instead of creating a second resource. Scoped to the account, remembered for 24 hours; reusing a key with a different payload is an error.

Request body

CheckoutCreateRequest required
email, string nullable
contact, string nullable

Contact ID

discount_code, string nullable
success_url, string nullable

Where to send the buyer after they pay. An http or https URL.

line_items, object[]
metadata, object

Set of key-value pairs you can attach to the object — store your own system's IDs or grouping labels. Keys max 40 chars (up to 50 keys), values stored as strings max 500 chars. On update, keys merge individually; set a key to null or "" to remove it. Echoed back on reads and in webhook payloads.

Response

Checkout session created

Checkout required
id, string required
object, string required
status, 'open' | 'complete' | 'abandoned' | 'expired' required
created_at, string date-time required
updated_at, string date-time required
success_url, string nullable required

Where the buyer lands after paying. Null shows Crevio's confirmation page.

metadata, object required
mode, string required
currency, string nullable required
subtotal, number required

Sum of the items at full price, before the discount.

total, number required

Sum of the items after the discount.

amount_due_today, number required

What the buyer pays at checkout: the total, minus any subscription that starts with a free trial.

purchase_url, string required
contact, union

ID by default, full object when expanded

checkout_items, CheckoutItem[] required

Changes

    • info

      added the required property success_url to the response with the status

    • warning

      the optional response header Deprecation removed for the status 422

    • warning

      the optional response header Link removed for the status 422

    10 more changes in this revision