Checkout sessions
Orders paid on the hosted page.
A checkout session is an order the buyer pays on Duevance's hosted payment page: you create the
session server-side, send the buyer to its url, and the page takes the card. Card numbers never
touch your servers.
Create a session
POST /v1/checkout-sessions (scope write)
| Field | Rules |
|---|---|
mode | payment (the default and, for now, the only one; setup answers 422) |
amount | Minor units, 1 to 99 999 999. Required |
currency | ISO 4217. Required |
reference | At most 64 characters, yours to match the session to your order |
description | At most 120 characters, shown to the buyer |
customer_email | At most 255 characters. When absent, the page asks the buyer for it |
return_url | Where the buyer goes once paid. https only (http://localhost in test mode), at most 2048 characters |
locale | The page's language: en, de, fr, it or es. Without it, the buyer's browser language, else English |
save_card | true stores the card for later charges, with the buyer's consent shown on the page and a 3-D Secure challenge |
usage | With save_card: recurring, unscheduled (the default) or installment. It decides the consent text |
expires_in | Seconds the session stays open, 60 to 86 400. Default 3600 |
metadata | Up to 50 string keys (≤ 40) with string values (≤ 500). Copied onto each payment |
The answer is 201:
{
"id": "cs_0D4q…",
"object": "checkout_session",
"environment": "test",
"status": "open",
"mode": "payment",
"amount": 4200,
"currency": "EUR",
"reference": "order-9",
"description": null,
"customer_email": null,
"return_url": "https://shop.example/done",
"locale": "de",
"save_card": false,
"usage": null,
"url": "https://pay.duevance.com/s/cs_0D4q…",
"payment": null,
"payment_instrument": null,
"metadata": { "cart": "17" },
"expires_at": "2026-12-03T11:00:00Z",
"completed_at": null,
"created_at": "2026-12-03T10:00:00Z"
}
Creating a session doesn't take an Idempotency-Key: it moves no money. Creating two sessions
for one order is harmless, since only the one the buyer pays completes.
The hosted page
Send the buyer to url. The page shows your project's display name and logo, the amount in the
page's language, a card form, and your terms, privacy and support links. Set these with
projects:brand until the dashboard has them.
- Paid. The buyer goes to your
return_urlwithsession_idadded to its query, before any fragment:https://shop.example/done?session_id=cs_0D4q…. Without areturn_url, the page says the payment succeeded. The query proves nothing on its own: fetch the session, or wait forcheckout_session.completed. - Declined. The form comes back with the reason in the buyer's language, and another card can be tried. A session takes at most 5 attempts; after that the page says it can no longer be completed.
- 3-D Secure. The buyer completes the challenge with their bank, then comes back to the
page or straight to your
return_urlwhen approved. See 3-D Secure. - Still being confirmed. When the acquirer's answer is late, the page says the payment is being confirmed and updates on its own. It never says "not charged" then, and no second card is taken for 15 minutes.
- Expired. After
expires_atthe page says the link has expired.
status moves from open to completed when a payment is approved (payment names it, and
payment_instrument names the stored card when save_card was set) or to expired; nothing
moves back, and a session is paid at most once. Each try is its own payment, with
checkout_session set to the session's id and no reference (references are unique per
payment); the session's metadata is copied onto it.
Webhooks
checkout_session.completed: the session was paid. Thepayment.succeeded(orpayment.authorized) of its payment comes with it.checkout_session.expired: the session ran out unpaid.
See Webhooks for the payload.
Retrieve and list
GET /v1/checkout-sessions/{id} and GET /v1/checkout-sessions (scope read), newest first,
with status (open, completed, expired), limit (1–100) and cursor, paginated like
payments.