url, or a publishable key and the session client_secret.
When a payment succeeds, funds land on your business balance, the same place as invoices and payment links. Checkout is not Receive: it never credits a customer acct_. To fund a customer vault, use Receive.
Checkout does not take USDC. A stablecoin payment link shows your static wallet address only. There is no USDC session or quote on the API.
Scope:
checkoutBefore your first call in Test: add your website as an allowed website (Console, Checkout, your site, Settings), and mint a key with the checkout scope in Settings, API keys. The fastest route is Console, Checkout, Integrate. It writes the code below for your language. See Quickstart. Test needs no verification or payment setup. Live needs your business verified and online payments turned on and set up (Settings → Payments).Three ways to open checkout
The hosted page needs no script and no publishable key. The overlay and inline forms load
https://js.easner.com/v1/checkout.js and a publishable key (easner_pk_test_…).
Create a session
POST /v1/checkout/sessions. Always send Idempotency-Key, one stable key per order, so a retry never creates a second session.
201 (200 when an Idempotency-Key replays an existing session):
url (hosted) or client_secret (overlay and inline). Keep the rest on your server.
Fields
Every field on the session, including each line item, is on Create a checkout session. That page is the contract.expires_in is whole seconds, 1800 (30 minutes) to 86400 (24 hours), default 86400. Outside that range, or not a whole number, is 400 invalid_expires_in. It is never clamped. metadata keys starting easner_ are reserved and dropped. A customer id that is not yours in this mode is 400 customer_not_found.
payment_method_collection: "if_required" starts a trial with no card. It needs mode: subscription and a trial, or the call is 400 invalid_payment_method_collection. See Start a trial without a card.
A line with no name and no price is titled “Online payment”. A catalog price supplies the name, amount and currency, and a recurring price makes the session a subscription. Copy the id from Console, Checkout, Products. A live payment link can also copy it from Banking, Collections, Links. A tiered price comes back with tier_breakdown. See Tiered prices.
success_url and cancel_url must be full https:// addresses on a website you added in Console, Checkout, your site, Settings. In test mode, http://localhost, http://127.0.0.1 and https://localhost (any port) work without being on that list. If you list no websites yet the check is skipped. If omitted, the site’s saved URLs or your Checkout defaults apply, then an Easner thank-you page. A browser Origin header that is not on your list also gets 400 origin_not_allowed, except localhost in test mode.
Open checkout
Hosted page
Redirect the browser tosession.url.
https://checkout.easner.com/cs_… and returns to success_url.
Overlay
Inline
EasnerCheckout has three methods: mount(target, options), openOverlay(options) and destroy(target?). Options: publishableKey, clientSecret, optional customerEmail, customerName, onSuccess (alias onComplete), onError, and for the overlay title and onClose. The overlay is titled with your business name and uses your accent colour.
What the overlay and inline form collect
The embedded form follows the session you created, so nothing extra is passed toEasnerCheckout:
The result shows Payment complete, the Amount paid and the Receipt number (the same number as the PDF and the email). The number appears a moment after the payment settles; until then the row reads “Receipt is on its way”. A bank payment that is still processing shows the amount only. Custom fields, terms and the receipt number are read from, and saved to, Easner’s public session endpoints on the host that served
checkout.js; no secret is sent from the browser.
Saved cards for returning payers are not drawn in the embedded form: the session is created on your server, so Easner cannot attach the payer’s saved details to it from the browser. Use the hosted page or a payment link for that.
Swapping easner_pk_test_… for easner_pk_live_… is part of going live. Use the key whose mode matches the session.
Website button
For a static page with no code of your own, load the button script and mark any element:data-easner-session takes a cs_… id. The button opens the overlay on your page. No publishable key is needed. If the overlay cannot take the payment, it sends the customer to the hosted page instead. The element fires easner:complete when paid and easner:close when the overlay closes. Cmd or Ctrl click opens the link normally.
Optional attributes on the script tag: data-easner-api points the script at another Easner API origin (https, or localhost over http).
Retrieve and list sessions
GET /v1/checkout/sessions/cs_… reads one session by its id in the path. GET /v1/checkout/sessions?id=cs_… reads the same session with the id as a query parameter.
payment_status is paid, unpaid, processing, no_payment_required, failed or null. A session from another mode or business is 404 not_found.
Use this read on your return page to show an honest status. Fulfil from the webhook.
List sessions
GET /v1/checkout/sessions lists the sessions of this mode, newest first. It covers website and payment-link sessions. Invoice sessions are not listed. For line items, discounts and tax, read the session. The query fields are on List checkout sessions. That page is the contract.
open session past its expires_at is listed as expired. A customer or payment_link that is not yours in this mode is 404 not_found. created[gte] and created[lte] take Unix seconds or ISO 8601, both ends included. Page with limit (1 to 100, default 20) and starting_after. See v1 reference.
The list reads Easner’s record, so a status can lag its webhook by a moment. Retrieve one session for the live status. Sessions with the same creation time can fall on either side of a page boundary, so use created filters when you need an exact window.
Customers and payments
Checkout customers and the payments they made have their own reads. Both are scoped to your business and mode, and both are separate from banking customers (cus_, GET /v1/customers).
A session that is still processing, or that failed, is not a payment and is not listed. Read it from
GET /v1/checkout/sessions/:id.
Subscriptions
amount_due_today is 0 and the button reads “Start free trial”. Unlock access on checkout.completed, then keep it in sync with subscription.updated, subscription.canceled and subscription.payment_failed. Renewals happen without the customer on your site, so the webhooks are the only signal. Customers manage their own subscription, payment method and receipts in the customer portal.
Per-seat pricing. Charge per user with the seat count as the quantity. Make a recurring catalog price with per_seat: true and a min_quantity, then send it as line_items[].price with quantity set to the seats. A quantity below the minimum is 400 invalid_quantity, and a per-seat line can go up to 10,000. Add adjustable_quantity if the customer should change the seats on the page. Later they can change the seats in the portal, or you can change them with POST /v1/subscriptions/:id. See Subscriptions.
Trials take a card. A free trial asks for a card up front, so the subscription can continue when the trial ends. Nothing is charged during the trial, and the button reads “Start free trial”.
Discounts. If a customer discount exists for the session’s customer_email, it applies automatically, and the session does not show the promotion code field.
Refunds and the portal
Refund all or part of a payment withPOST /v1/refunds: Refunds. Send a customer to their account page with POST /v1/customer_portal/sessions: Customer portal.
Idempotency
Idempotency-Key (up to 255 characters, longer is 400 invalid_idempotency_key; scoped to your business) on POST /v1/checkout/sessions:
- Same key and same body: you get the same session back (
200, amounts as stored the first time). - Same key and a different body:
409 idempotency_mismatch. - Same key while the first call is still creating its session:
409 idempotency_in_progress. Retry after a second.
checkout-ord_1042. A new random key on every retry defeats the protection.
Test and live
Test keys create test sessions. Pay with4242 4242 4242 4242, any future expiry, any CVC. 4000 0000 0000 0002 is declined. Nothing is charged and test payments never touch your live balance. A test session only exists in test mode. A live key is needed for live sessions. See Test and live for the go-live checklist.
Events
Tick these on a webhook endpoint in Console, Settings, Webhooks. Full payloads: Webhooks.Expected
- The amount and your secret key never reach the browser.
- You fulfil in the webhook, using the
metadatayou sent. - Console, Banking Home and
GET /v1/transactions(typecheckout) show the payment. - A checkout payment never credits a customer
acct_.
Webhooks
Signature check, retries, and every payload.
