Skip to main content

Checkout Flow

The checkout module manages the full session lifecycle — load a session, update the cart, apply promo codes, and handle shipping.

Load a Checkout Session

A checkout session is typically created by the Node SDK on your server, then the token is passed to the frontend via URL parameter.

Create a Checkout Session (Client-Side)

From a landing / cart page, create a session and send the shopper to your checkout. Pin the variant you sell — do not pick “whatever is in the catalog”:
On /checkout, read both query names (sessionToken from createSessionUrl, token from a Tagada-hosted redirect):
createSession() is the same call without building the URL. It also returns checkoutUrl — that one is the Tagada-hosted checkout, not your page.
Headless cannot set checkoutUrl. It is generated by Tagada (plugin domain, funnel, or store-unavailable). On a self-hosted checkout, stay on your page and call loadSession(). To hop from a cart page to your own checkout path, use createSessionUrl() as above.

Update Cart


Customer & Address

The SDK uses a two-step pattern: first set customer identity, then set the address. Under the hood, both are sent in a single atomic API call when updateAddress() is called.

Set Customer Info

updateCustomer() stores email, name, and phone in memory. No API call is made yet — the data is sent together with the address in the next step.

Set Address

updateAddress() sends customer info + address together in one atomic API call. The customer’s firstName, lastName, and phone are automatically included in the address fields.

Combined Method

If you prefer a single explicit call:
Address fields: firstName, lastName, phone can be passed directly in the address object too — they override the values from updateCustomer().

Promo Codes

What each total means

All amounts are in minor units (cents) in totals.currency. total is the same number the hosted checkout shows and the order is charged for — do not recompute it client-side.

Shipping

For digital products, skip shipping entirely — go straight from updateAddress() to payment.

React Hook

On a landing page there is no token yet — pass null and use createSessionUrl on the CTA:

Full Hook API