Skip to main content

Checkout Sessions

Use tagada.checkout.createSession to build pre-loaded checkout links: cart line items, currency, and optional customer data are applied before the customer lands on your checkout page.
createSession follows the /checkout/init redirect and returns the final URL plus a checkoutToken (when available) without forcing the browser through the 307.

Create a basic session


Pre-fill customer data

Optional string fields are passed through to checkout init:

Customer tags for funnel routing

Attach tags so funnel edge conditions (e.g. customer.hasTag) can route the session:
Combine explicit tags with URL/query enrichment where configured — see Customer Management for auto-enriched tags and tag-driven conditions.

Discount codes + affiliate attributes

Use this when you build the checkout link from your server and the customer opens Tagada hosted checkout after adding items on your site. Apply a promo code and attach affiliate tracking in the same createSession call:
You can also pass ref, utm_source, and other query params as top-level fields — they are forwarded into customerMetadata.queryParams automatically when customerMetadata is omitted. Custom attributes and query params appear on the resulting order (CRM → Order → Attributes) and in the order/paid webhook payload.

Pay a session from the server

checkout.pay() needs the buyer’s session token in the x-cms-token header. The merchant API key alone is not sufficient: without the token, the call returns 401. The token is the token query parameter of the redirectUrl that createSession returns. checkoutToken is a different value and does not work here. Pass the shopper’s IP and user agent, as your server received them, in customer. The call comes from your server, so Tagada never takes your server’s address for the shopper’s: without customer, the payment keeps the IP the shopper’s browser gave the checkout, if any, and your server’s IP never reaches block rules or the processor.

Async payment status (3DS redirects)

After a redirect-based flow (e.g. 3DS), poll session status with the token from createSession:
checkoutToken may be null if it is not present on the redirect URL. Ensure createSession is used (not the deprecated init helper) so the client can parse the token reliably.

SDK methods reference

Common createSession params include storeId, items, currency, checkoutUrl, returnUrl, locale, customerId, customerEmail, customerFirstName, customerLastName, customerPhone, customerTags, discountCodes, metadata, customerMetadata, cartToken, and draft.

Next steps

Upsell & downsell funnel

Conditional routing after checkout using funnel edges

Customer management

Tags, listing, and funnel conditions tied to customers

Merchant quick start

End-to-end setup through a live checkout link

Step config guide

Per-step checkout UI, scripts, and order bumps