That’s it. The customer is redirected to TagadaPay, a checkout session is created with the product in the cart, and the customer lands on your checkout page.
Where do I find my storeId and variantId? Go to the CRM dashboard → your store settings for the store ID, and Products → select a variant for the variant ID.
The browser navigates to https://app.tagadapay.com/api/public/v1/checkout/init?storeId=...&items=...&checkoutUrl=...
TagadaPay creates a checkout session with the items in the cart
TagadaPay redirects the customer to your checkoutUrl with a checkoutToken query parameter
Your checkout page loads and the Plugin SDK picks up the token automatically
The entire flow is a single HTTP redirect — no AJAX, no CORS, no server-side code.
Helper Function Source Code
If you want to customize the helper or understand how it works, here’s the full annotated version:
function createCheckoutUrl({ baseApiUrl, checkoutUrl, storeId, currency = 'USD', items = [], defaultItem = null, log = false,} = {}) { if (!baseApiUrl) throw new Error('baseApiUrl is required'); if (!storeId) throw new Error('storeId is required'); if (!checkoutUrl) throw new Error('checkoutUrl is required'); const lineItems = items.length > 0 ? items : defaultItem ? [defaultItem] : []; if (lineItems.length === 0) { throw new Error('At least one line item is required'); } const params = new URLSearchParams({ storeId, currency, checkoutUrl, items: JSON.stringify(lineItems), }); const url = `${baseApiUrl}?${params.toString()}`; if (log) { console.info('Checkout URL:', url); } return url;}
This is a pure client-side function. It builds a URL string — no network requests, no dependencies. You can inline it, bundle it, or rewrite it in any language.
You can also generate direct links from the CRM dashboard without writing any code. Go to Storefront → Direct Links, select your products, and copy the URL.