Skip to main content

Digital Product Cart Checkout

Sell multiple digital products in a single checkout. No shipping, no address collection, instant fulfillment.
Supported Product Types: digital, gift_card, othersThese product types share a simplified checkout flow - no cart validation step, no shipping address required.

Quick Start

1. Build Your Payload

2. Call Payment Intent API

3. Use the Token

Pass token to <KhaimeCheckout /> - payment gateway is handled automatically.

How It Works

Key points:
  • Your backend calls Khaime API and gets a token
  • Token contains everything needed for payment (gateway, keys, amount)
  • Your code never touches Stripe/Paystack/etc directly
  • Gateway is selected automatically based on currency

Request Reference

Top-Level Fields

Cart Item Fields

Digital cart items use a SIMPLER schema than physical products.Do NOT include: product_title, product_thumbnail, main_variant, least_sub_variant_id, shipping_rate

Currency & Gateway Routing

Khaime automatically selects the payment gateway based on currency: Your code doesn’t need to know about gateways - just pass the currency and Khaime handles the rest.

Complete Examples

USD Checkout (Stripe)

NGN Checkout (Paystack)

Gift Cards with Recipient Info


Merchant Backend Example

Your backend receives cart data from your frontend, transforms it to Khaime format, and returns the token.

Next.js API Route

Frontend Component


Response Structure

Success Response

Token Security

The token is signed with HMAC-SHA256 and expires after 15 minutes. Format: base64(payload).signature
You don’t need to decode the token - just pass it to <KhaimeCheckout /> and it handles everything.Important: Tokens expire after 15 minutes. If a customer waits too long, create a new payment intent.

After Payment

Order Structure

After successful payment, the Order contains all cart items:

Customer Receives

  • Confirmation email with all purchased items
  • Download links for each digital product
  • Order accessible in their account

Pricing

All Amounts in Cents

Total Calculation


vs Physical Products


Error Codes


Physical Product Checkout

Checkout with shipping and cart validation

Payment Intent API

Full API reference

React SDK

<KhaimeCheckout /> component

Webhooks

Payment event notifications