Headless Checkout System

Token-based checkout with multiple payment providers & post-purchase upsells

🚀 Post-Purchase 1-Click Upsells

Show targeted offers after payment but before the success page. Customers can accept with one click using their stored payment method.

Flow

1Customer completes checkout
2Payment processed successfully
3Upsell offers shown (if configured)
4Accept (1-click) or Decline
5Redirect to success page

Targeting Rules

  • minCartValue - Only show if cart total ≥ X cents
  • productIds - Only show if customer bought specific products
  • excludeProductIds - Hide if customer bought specific products
  • timerSeconds - Add countdown timer for urgency

Token Configuration

// Include upsellConfig in your checkout token
{
  "orderId": "order_123",
  "customer": { ... },
  "lineItems": [ ... ],
  "upsellConfig": {
    "enabled": true,
    "offers": [
      {
        "id": "upsell-1",
        "productId": "up_shipping",
        "name": "Priority Shipping",
        "description": "Get it in 2-3 days",
        "price": 999,                    // Price in cents
        "compareAtPrice": 1499,          // Optional strikethrough price
        "headline": "Want it faster?",
        "ctaText": "Yes, Upgrade!",
        "declineText": "No thanks",
        "imageUrl": "https://...",       // Optional product image
        "timerSeconds": 300,             // Optional 5-min countdown
        "targeting": {
          "minCartValue": 5000,          // Cart must be $50+
          "productIds": ["prod_1"],      // Must have bought prod_1
          "excludeProductIds": ["sub_1"] // Must NOT have subscription
        }
      }
    ]
  }
}

API Reference

POST/api/token/generate

Generate a checkout token with optional upsell configuration

POST/api/upsell/create-session

Create an upsell session after successful payment

GET/api/upsell/session/[id]

Get current upsell session state and offers

POST/api/upsell/accept

Accept an upsell offer (1-click charge)

POST/api/upsell/decline

Decline current offer and proceed to next or success page

Supported Providers

💳

Stripe

Cards & Wallets

🔄

Sticky.io

Subscriptions

🛒

Shopify

E-commerce

📊

Konnektive

CRM & Orders

🛍️

UltraCart

E-commerce

Built with Next.js 16 • SQLite • JWT Authentication