Skip to main content

Build Your Own Store with AI + TagadaPay

No Shopify. No WooCommerce. Use an AI coding tool to generate a beautiful storefront and wire TagadaPay as the headless backend for payments, emails, subscriptions, and pixel tracking.
┌──────────────────────────────────────────────────────┐
│  AI (Claude / Lovable / v0)                          │
│  → Generates your storefront UI                      │
│  → React, Next.js, Astro, plain HTML — anything      │
└───────────────────────┬──────────────────────────────┘


┌──────────────────────────────────────────────────────┐
│  TagadaPay (Headless SDK)                            │
│  → Payment orchestration (Stripe, Adyen, etc.)       │
│  → Email flows (order confirmation, subscription)    │
│  → Pixel tracking (Meta, TikTok, GA4, GTM)           │
│  → Upsells, subscriptions, CRM                       │
└──────────────────────────────────────────────────────┘
Time to first sale: ~15 minutes. Seriously.This tutorial takes you from zero to a live store with real payments. The AI generates the UI, you paste a few SDK calls, and TagadaPay handles the rest.

What You’ll Build

A complete e-commerce flow:
  1. Product page — display products from your Tagada catalog
  2. Cart — add/remove items, see totals
  3. Checkout — customer info, shipping, promo codes, Google Address Autocomplete
  4. Payment — card payments with PCI-safe tokenization
  5. Post-purchase — upsells, order confirmation emails, pixel tracking
All without writing a backend. TagadaPay is the backend.

Prerequisites


Step 1 — Create Your Store in TagadaPay

Use the Node SDK to set up your store, products, and payment flow in one script.
mkdir my-store && cd my-store
npm init -y
npm install @tagadapay/node-sdk @tagadapay/headless-sdk
Create setup.ts:
import Tagada from '@tagadapay/node-sdk';

const tagada = new Tagada('tgd_your_api_key');

// 1. Processor — connect your Stripe account (or use sandbox for testing)
// Option A: Direct API keys
const { processor } = await tagada.processors.create({
  processor: {
    name: 'Stripe',
    type: 'stripe',       // use 'sandbox' for testing
    enabled: true,
    supportedCurrencies: ['USD', 'EUR'],
    baseCurrency: 'USD',
    options: {
      secretKey: 'sk_test_...',
      publishableKey: 'pk_test_...',
    },
  },
});
// Option B: Stripe Connect OAuth — see the Stripe Connect section in
// the Multi-PSP Routing guide for the full flow

// 2. Payment flow — route transactions through your processor
const flow = await tagada.paymentFlows.create({
  data: {
    name: 'Main Flow',
    strategy: 'simple',           // 'simple' = single processor, 'cascade' = fallback chain
    fallbackMode: false,
    maxFallbackRetries: 0,
    threeDsEnabled: false,
    stickyProcessorEnabled: false,
    pickProcessorStrategy: 'weighted',  // 'weighted' | 'lowestCapacity' | 'automatic'
    fallbackProcessorConfigs: [],
    processorConfigs: [
      { processorId: processor.id, weight: 100, disabled: false, nonStickable: false },
    ],
  },
});

// 3. Store
const store = await tagada.stores.create({
  name: 'My AI-Built Store',
  baseCurrency: 'USD',
  presentmentCurrencies: ['USD', 'EUR'],
  chargeCurrencies: ['USD'],
  selectedPaymentFlowId: flow.id,
});

// 4. Products
const tshirt = await tagada.products.create({
  storeId: store.id,
  name: 'Premium T-Shirt',
  description: 'Organic cotton, available in 3 colors',
  active: true,
  variants: [{
    name: 'Black / M',
    sku: 'tshirt-black-m',
    grams: 200,
    active: true,
    default: true,
    imageUrl: 'https://images.unsplash.com/photo-1521572163474-6864f9cf17ab?w=600&h=600&fit=crop',
    price: 3900,
    compareAtPrice: 4900,
    prices: [{
      currencyOptions: { USD: { amount: 3900 }, EUR: { amount: 3500 } },
      recurring: false,
      billingTiming: 'in_advance',
      default: true,
    }],
  }],
});

// 5. Checkout funnel
await tagada.funnels.create({
  storeId: store.id,
  config: {
    id: 'main-checkout',
    name: 'Main Checkout',
    version: '1.0.0',
    nodes: [
      { id: 'checkout', name: 'Checkout', type: 'checkout', kind: 'step', isEntry: true, position: { x: 0, y: 0 }, config: { path: '/checkout', stepConfig: { payment: { paymentFlowId: flow.id } } } },
      { id: 'thankyou', name: 'Thank You', type: 'thankyou', kind: 'step', position: { x: 300, y: 0 }, config: { path: '/thankyou' } },
    ],
    edges: [{ id: 'e1', source: 'checkout', target: 'thankyou' }],
  },
  isDefault: true,
});

console.log(`Store ready: ${store.id}`);
Run it:
npx tsx setup.ts
Return shapes:
  • processors.create() returns { processor: { id, name, type, ... } } — destructure with const { processor } = await ...
  • paymentFlows.create() returns a flat flow object: { id, name, strategy, ... }
  • stores.create() returns a flat store object: { id, name, baseCurrency, ... }
  • products.create() returns { id, variants: [{ id, name, prices: [{ id }] }] } — a summary, not the full product
TagadaPay is gateway-agnostic. Use the type field when creating a processor:
TypeProviderKey Options
stripeStripesecretKey, publicKey — or use Stripe Connect OAuth
adyenAdyenapiKey, merchantAccount, hmacKey, liveEndpointPrefix
checkoutCheckout.comsecretKey, publicKey
nmiNMIapiKey or username + password
authorizenetAuthorize.NetapiLoginId, transactionKey, clientKey
airwallexAirwallexclientId, clientSecret, clientApiKey
ngeniusN-Genius (Network International)apiKey, outlet, apiUrl
ccavenueCCAvenueaccessCode, workingKey
finixFinixapiKey, username, password
tapTap PaymentssecretKey
mastercardMastercard GatewaymerchantId, apiKey, gatewayUrl
efipaymentsEFI PaymentsapiKey
ovriOvriwebsiteKey, secretKeyPos, apiKey
sandboxTagadaPay Sandbox(none — use for testing)
All processors share optional fields: enable3DS, testMode, descriptor, merchantName, merchantUrl, merchantCountryCode.
FieldTypeDescription
namestringHuman-readable flow name
strategy'simple' | 'cascade'simple = single processor, cascade = try next on failure
fallbackModebooleanEnable fallback when primary fails
maxFallbackRetriesnumberMax retry attempts (0 = no retries)
threeDsEnabledbooleanEnable 3D Secure authentication
stickyProcessorEnabledbooleanRoute returning customers to same processor
pickProcessorStrategy'weighted' | 'lowestCapacity' | 'automatic'How to pick among multiple processors
processorConfigsarrayProcessors: { processorId, weight, disabled, nonStickable }
fallbackProcessorConfigsarrayFallback order: { processorId, orderIndex }
Nodes in a checkout funnel support these type values:
TypeDescriptionTypical Config
checkoutCheckout / payment pageconfig.stepConfig.payment.paymentFlowId
thankyouOrder confirmation pageisConversion: true
offerUpsell or downsell page (use for both)config.stepConfig.upsellOffers
landingLanding / product pageEntry point (isEntry: true)
errorError / fallback pageShown on failures
customCustom page (any content)Flexible config
externalRedirect to external URLExternal link
Node kind: 'step' (page), 'action' (server-side logic), 'condition' (branching).Example with upsell:
nodes: [
  { id: 'checkout', name: 'Checkout', type: 'checkout', kind: 'step', isEntry: true,
    position: { x: 0, y: 0 },
    config: { path: '/checkout', stepConfig: { payment: { paymentFlowId: flow.id } } } },
  { id: 'upsell', name: 'Special Offer', type: 'offer', kind: 'step',
    position: { x: 300, y: 0 },
    config: { path: '/offer' } },
  { id: 'thankyou', name: 'Thank You', type: 'thankyou', kind: 'step',
    position: { x: 600, y: 0 }, isConversion: true,
    config: { path: '/thankyou' } },
],
edges: [
  { id: 'e1', source: 'checkout', target: 'upsell' },
  { id: 'e2', source: 'upsell', target: 'thankyou' },
],
Even faster: clone our ready-made example and run pnpm seed <API_KEY> to create a full demo store in seconds.
git clone https://github.com/TagadaPay/examples.git
cd examples/headless-react
pnpm install
pnpm seed tgd_your_api_key
pnpm dev
Live demo · Source code

Step 2 — Generate the Storefront with AI

Now for the fun part. Paste this prompt into Claude, Lovable, or your AI tool:
Build me a modern e-commerce store using React + Tailwind CSS.

The store uses @tagadapay/headless-sdk for all backend operations (no custom API needed).

Architecture:
- Wrap the app in <TagadaHeadlessProvider storeId="STORE_ID" environment="production">
- Use these hooks from '@tagadapay/headless-sdk/react':
  • useCatalog() — load products
  • useCheckout(checkoutToken, sessionToken) — manage checkout session
  • usePayment() — tokenize cards and process payments
  • useOffers() — load and accept upsell offers
  • useGoogleAutocomplete({ apiKey }) — address autocomplete

Pages to build:
1. Product listing page — grid of products from useCatalog()
2. Cart page — line items, quantities, totals
3. Checkout page — email, name, address (with Google autocomplete), shipping rates, promo code
4. Payment page — card form (number, expiry, cvc), tokenize with tokenizeCard(), pay with pay()
5. Thank you page — order confirmation, upsell offers from useOffers()

Use dark theme, clean minimal design, mobile-first.
Store ID: YOUR_STORE_ID_HERE
The AI will generate a complete storefront. The key SDK calls it needs:

Loading Products

import { useCatalog } from '@tagadapay/headless-sdk/react';

function ProductPage() {
  const { products, isLoading, loadProducts } = useCatalog();

  useEffect(() => { loadProducts(); }, [loadProducts]);

  return products.map(product => (
    <ProductCard key={product.id} product={product} />
  ));
}

Creating a Checkout Session

import { useHeadlessClient } from '@tagadapay/headless-sdk/react';

const client = useHeadlessClient();

const { checkoutToken, sessionToken } = await client.checkout.createSession({
  items: cart.map(item => ({
    variantId: item.variantId,
    quantity: item.quantity,
  })),
  currency: 'USD',
});

Checkout Flow

import { useCheckout } from '@tagadapay/headless-sdk/react';

const { session, updateCustomer, updateAddress, getShippingRates, applyPromo } =
  useCheckout(checkoutToken, sessionToken);

await updateCustomer({ email, firstName, lastName });
await updateAddress({ shippingAddress: { line1, city, state, postalCode, country } });
const rates = await getShippingRates();
await applyPromo('WELCOME10');

Payment

import { usePayment } from '@tagadapay/headless-sdk/react';

const { tokenizeCard, pay, loadPaymentSetup } = usePayment();

// Load payment config
useEffect(() => {
  if (session?.id) loadPaymentSetup(session.id);
}, [session?.id]);

// Tokenize + pay
const { tagadaToken } = await tokenizeCard({
  cardNumber: '4242424242424242',
  expiryDate: '12/28',
  cvc: '123',
  cardholderName: 'Jane Doe',
});

const result = await pay({
  checkoutSessionId: session.id,
  tagadaToken,
});

if (result.payment.status === 'succeeded') {
  // redirect to thank you page
}

Post-Purchase Upsells

import { useOffers } from '@tagadapay/headless-sdk/react';

const { listOffers, previewOffer, payPreviewedOffer } = useOffers();

const offers = await listOffers({ type: 'upsell' });

// One-click accept — charges the same card
await previewOffer({ offerId: offers[0].id });
await payPreviewedOffer({
  offerId: offers[0].id,
  mainOrderId: paymentId,
});

Step 3 — Deploy

Your store is a static site. Deploy it anywhere:
npm install -g vercel
vercel --prod
No server to maintain. No database to manage. TagadaPay handles everything.

Step 4 — Set Up Email Flows

TagadaPay sends transactional emails automatically when events happen. Configure them in the CRM dashboard or via the Node SDK:
EventEmail SentConfigurable?
Order paidOrder confirmation with receiptYes — template, sender domain
Subscription rebillRecurring payment receiptYes
Subscription canceledCancellation confirmationYes
Payment refundedRefund notificationYes
Subscription past dueFailed payment alertYes
Set up a custom sender domain for branded emails:
Settings → Emails → Custom Domain → Add your-store.com
Then add DNS records (SPF, DKIM, DMARC) as shown in the dashboard. See the Emails guide for full details on creating templates programmatically with the Node SDK.

Step 5 — Set Up Pixel Tracking

TagadaPay handles client-side pixel tracking for ad attribution and retargeting. Configure your pixels in the dashboard — TagadaPay injects the scripts and fires events automatically during checkout. Configure pixels in the TagadaPay dashboard:
Settings → Integrations → Add pixel → Meta / TikTok / Google Analytics / GTM / Snapchat / Pinterest
That’s it. TagadaPay fires the right events (PageView, AddToCart, InitiateCheckout, Purchase) to all active pixels at the right moments. No code changes needed in your storefront. Supported platforms: Meta (Facebook), TikTok, Google Tag Manager, Google Analytics 4, Snapchat, Pinterest. See the Pixels guide for the full event mapping reference.

Step 6 — Webhooks (Optional)

Listen for payment events on your backend to trigger custom logic (e.g., fulfillment, Slack notifications):
import Tagada from '@tagadapay/node-sdk';

const tagada = new Tagada('tgd_your_api_key');

// Register a webhook endpoint
await tagada.webhooks.create({
  storeId: 'store_xxx',
  url: 'https://my-store.com/api/webhooks/tagada',
  events: ['order/paid', 'subscription/created', 'order/refunded'],
});
Handle incoming events:
// api/webhooks/tagada.ts (Next.js example)
export async function POST(req: Request) {
  const event = await req.json();

  switch (event.topic) {
    case 'order/paid':
      // Trigger fulfillment, send Slack message, etc.
      console.log('New order:', event.data.orderId);
      break;
    case 'subscription/created':
      console.log('New subscriber:', event.data.customerId);
      break;
  }

  return new Response('OK');
}

Architecture Summary

┌─────────────────────────────────────────────────────────────┐
│                    YOUR STOREFRONT                           │
│  Generated by AI (Claude, Lovable, v0)                      │
│  Hosted on Vercel / Netlify / Cloudflare                    │
│                                                             │
│  ┌─────────────────┐  ┌──────────────────────────────────┐  │
│  │  React / Next.js │  │  @tagadapay/headless-sdk        │  │
│  │  Tailwind CSS    │  │  ├── useCatalog()               │  │
│  │  Your design     │  │  ├── useCheckout()              │  │
│  │                  │  │  ├── usePayment()               │  │
│  │                  │  │  ├── useOffers()                │  │
│  │                  │  │  └── useGoogleAutocomplete()    │  │
│  └─────────────────┘  └──────────────────────────────────┘  │
└────────────────────────────┬────────────────────────────────┘
                             │ HTTPS

┌─────────────────────────────────────────────────────────────┐
│                     TAGADAPAY CLOUD                          │
│                                                             │
│  ┌──────────────┐  ┌───────────┐  ┌──────────────────────┐ │
│  │  Payment      │  │  Emails   │  │  Pixel Tracking      │ │
│  │  Orchestration│  │  ─────    │  │  ──────────────      │ │
│  │  ─────────    │  │  Order    │  │  Meta Pixel          │ │
│  │  Stripe       │  │  confirm  │  │  TikTok Pixel        │ │
│  │  Adyen        │  │  Rebill   │  │  GA4 / GTM           │ │
│  │  Checkout.com │  │  Canceled │  │  Snap / Pinterest    │ │
│  │  Fallback     │  │  Refund   │  │  Funnel tracking     │ │
│  │  routing      │  │  Past due │  │                      │ │
│  └──────────────┘  └───────────┘  └──────────────────────┘ │
│                                                             │
│  ┌──────────────┐  ┌───────────┐  ┌──────────────────────┐ │
│  │  Subscriptions│  │  CRM      │  │  Offers              │ │
│  │  & Rebilling  │  │  Dashboard│  │  Upsells / Bumps     │ │
│  └──────────────┘  └───────────┘  └──────────────────────┘ │
└─────────────────────────────────────────────────────────────┘

Why This Beats Shopify / WooCommerce

ShopifyWooCommerceAI + TagadaPay
Monthly fee$39–399/moHosting + pluginsFree (pay per transaction)
StorefrontLiquid templatesPHP themesAny framework, any AI tool
CustomizationLimited by themePlugin conflictsUnlimited — you own the code
Payment routingShopify Payments onlyWooCommerce PaymentsMulti-PSP, fallback, load balancing
Upsells$50/mo appPluginBuilt-in
EmailsBasicPluginBuilt-in, customizable templates
Pixel trackingBasicPluginAuto-inject Meta, TikTok, GA4, GTM, Snap
Lock-inHighMediumZero — it’s your code

Hosting Your Store

Once your storefront is built, you need somewhere to host it. If your store is a client-side SPA (React, Vue, Svelte, vanilla HTML), you can deploy it directly on TagadaPay’s global edge CDN with a single script. No infrastructure to set up, no billing — it’s included with your account. What you get:
  • Global edge CDN (~10ms TTFB)
  • Custom domain with automatic TLS
  • Built-in A/B testing (weighted or geo-based) on the same URL
  • Zero bandwidth bills

Deploy with the Node SDK

The @tagadapay/node-sdk has built-in support for the full deploy flow via tagada.plugins. Add this to your project as scripts/deploy.ts:
import Tagada from '@tagadapay/node-sdk';
import { readFileSync, readdirSync, statSync } from 'fs';
import { join, relative } from 'path';

const tagada = new Tagada(process.env.TAGADA_API_KEY!);

const CONTENT_TYPES: Record<string, string> = {
  '.html': 'text/html',
  '.js': 'application/javascript',
  '.css': 'text/css',
  '.svg': 'image/svg+xml',
  '.png': 'image/png',
  '.jpg': 'image/jpeg',
  '.json': 'application/json',
  '.woff2': 'font/woff2',
};

function collectFiles(dir: string, base = dir) {
  const files: { path: string; content: string; contentType: string }[] = [];
  for (const entry of readdirSync(dir)) {
    const full = join(dir, entry);
    if (statSync(full).isDirectory()) {
      files.push(...collectFiles(full, base));
    } else {
      const ext = full.substring(full.lastIndexOf('.'));
      files.push({
        path: '/' + relative(base, full),
        content: readFileSync(full).toString('base64'),
        contentType: CONTENT_TYPES[ext] || 'application/octet-stream',
      });
    }
  }
  return files;
}

async function main() {
  // 1. Get your store
  const stores = await tagada.stores.list();
  const storeId = stores.data[0]?.id;

  // 2. Collect build files from dist/
  const inlineAssets = collectFiles(join(import.meta.dirname, '..', 'dist'));
  console.log(`Deploying ${inlineAssets.length} files...`);

  // 3. Deploy (upload files)
  const deploy = await tagada.plugins.deploy({
    storeId,
    manifest: {
      name: 'my-store',
      version: '1.0.0',
      pages: [{ id: 'main', path: '/', name: 'Store' }],
    },
    inlineAssets,
    overwrite: true,
  });

  // 4. Instantiate (create a live instance for your store)
  const instance = await tagada.plugins.instantiate({
    deploymentId: deploy.deploymentId,
    storeId,
    config: {},
  });

  // 5. Mount (bind to a URL)
  const hostname = `my-store--${storeId}.cdn.tagadapay.com`;
  await tagada.plugins.mount({
    deploymentId: deploy.deploymentId,
    deploymentInstanceId: instance.instanceId,
    storeId,
    hostname,
    basePath: '/',
    matcher: '/',
  });

  console.log(`✅ Live at: https://${hostname}/`);
}

main();

Run It

npm run build
TAGADA_API_KEY=your-api-key npx tsx scripts/deploy.ts
That’s it — 3 SDK calls and your store is live on https://my-store--{storeId}.cdn.tagadapay.com/.
SDK methodWhat it does
tagada.plugins.deploy()Uploads your build files (HTML, JS, CSS)
tagada.plugins.instantiate()Creates a live instance for your store
tagada.plugins.mount()Binds the instance to a hostname
This is the exact flow we used to deploy the headless-react example. It works for any SPA — React, Vue, Svelte, or plain HTML.
Updates? Just run the script again with overwrite: true. The new version goes live instantly — no downtime, no cache purge needed.
Other useful SDK methods for managing deployments:
// List all deployments
const plugins = await tagada.plugins.list(storeId);

// List instances
const instances = await tagada.plugins.listInstances(storeId);

// Get deployment details
const details = await tagada.plugins.retrieveDeployment(deploymentId);

// Unmount
await tagada.plugins.unmount({ deploymentId, storeId, customDomain: hostname });

// Delete
await tagada.plugins.del(pluginId, storeId);
For builds larger than 4 MB, use zipUrl instead of inlineAssets. You can also add custom domains and A/B testing on top.

Full Deploy & A/B Test Guide

Custom domains, geo-based A/B testing, large file uploads, and more

Option B: Vercel, Netlify, or Cloudflare Pages

If your app uses server-side rendering (Next.js, Astro, Remix, SvelteKit), deploy to a platform that supports your framework:
PlatformBest forDeploy command
VercelNext.js, SvelteKitvercel --prod
NetlifyAstro, static sitesnetlify deploy --prod
Cloudflare PagesAny frameworkwrangler pages deploy dist/

Option C: Fly.io, Railway, or Docker

For apps that need a Node.js backend (webhooks, database, background jobs):
fly launch && fly deploy
Which should I pick?
  • Static SPA (React, Vue, Svelte)? → TagadaPay hosting (simplest, free, built-in A/B testing)
  • Next.js / SSR? → Vercel or Netlify
  • Custom backend + webhooks? → Fly.io or Railway

Resources

Live Example

Try the interactive demo — browse products, checkout, pay with test cards

Example Source Code

Full React + TypeScript example with inline code tutorials at every step

Node SDK

Server-side automation — create stores, products, webhooks, and more

API Reference

Full REST API documentation with request/response examples

FAQ

Yes. The Headless SDK is framework-agnostic. The React hooks (useCheckout, usePayment, etc.) work in any React app. For non-React frameworks, use the vanilla createHeadlessClient() API.
Not for the checkout flow. The Headless SDK handles everything client-side (including PCI-safe card tokenization). You only need a server if you want webhooks or custom automation — use the Node SDK for that.
Yes. Card numbers are tokenized by @tagadapay/core-js before they reach your code. Your store never sees or stores raw card data. TagadaPay is PCI DSS Level 1 compliant.
Yes. Give Lovable the prompt from Step 2 and it will generate a working storefront. You’ll just need to paste your Store ID and deploy.
Create a product with a recurring price (interval: 'month'). The Headless SDK handles the initial charge. TagadaPay automatically rebills and sends email receipts on each cycle. Manage subscriptions from the CRM dashboard.
Yes. Use a sandbox processor or Stripe test mode. Test card: 4242 4242 4242 4242, any future expiry, any CVC.