Create a hosted or embedded checkout session
Create a hosted or embedded checkout session. Use the response status and request ID to decide whether to retry, reconcile, or ask the customer for action.
Request
- Base URLhttps://merchant.zahlo.eu
- AuthAPI key in header x-api-key
Headers
Retry-safe key for create operations.
Request body
Simple mode: one total, no line items.
Required with amountMinor or ad-hoc line items; defaults to the prices' currency.
An existing customer. Required with setupFutureUsage and type setup.
Save the card to customerId for later off-session charges (type payment, card only). You must have shown the customer your terms for later charges.
Default: the merchant's default methods, else everything enabled for the currency.
Deprecated single-method form of paymentMethodTypes.
May contain {CHECKOUT_SESSION_ID}; must be on a registered checkout domain.
subscription: a recurring price (the first one), further recurring prices as add-ons billed with it every period, and optional one-time prices charged once with the first period (setup fees, never discounted), paymentMethodTypes ["card"] and customerEmail. A price with a trial charges nothing now (paymentStatus no_payment_required). setup: saves a card to customerId without charging it; no lineItems or amountMinor.
Applies to lineItems; on a subscription it discounts the periods its duration covers.
A coupon's code as the customer typed it (case-insensitive), instead of couponId. Applies to lineItems; an unknown code is 404 resource_missing.
One-time sessions with lineItems, hosted or embedded: the details page shows a promotion code field with an Apply button and a live total; the total and the payment link are re-made. Not with promotionCode or couponId.
The details page's button label: auto Continue to payment, pay, book or donate.
Up to 50 key-value pairs; keys up to 40 characters, values strings up to 500 characters.
Example request
{
"currency": "EUR"
}Response
Checkout session created
Hosted only, while open: redirect the customer here.
Embedded only, while open: pass it to the browser SDK.
Embedded only: true until the payer completed Zahlo's details step (the browser SDK mounts it first); embedUrl is null meanwhile.
The chosen shipping option, inside amountTotal; 0 without one.
Set when the session saves the card for off-session charges.
Up to 50 key-value pairs; keys up to 40 characters, values strings up to 500 characters.
Changes
No recorded changes to this operation across all 1 revision of this API.