Introduction

CART402 is a developer-first payment protocol that enables crypto payments with 0% transaction fees and instant settlement. Built on HTTP 402 + Solana.

Why CART402?

Traditional payment processors charge 2-3% fees and take 2-7 days to settle. CART402 charges 0% fees and settles in ~400ms.

Installation

Install the CART402 SDK via npm:

Terminal
npm install @cart402/sdk

Or using yarn:

Terminal
yarn add @cart402/sdk

Quick Start

Get started with CART402 in minutes:

implementation.ts
import { Cart402 } from '@cart402/sdk'

const cart = new Cart402({
  shopify: {
    store: 'store.myshopify.com',
    apiKey: process.env.SHOPIFY_API_KEY
  },
  wallet: process.env.MERCHANT_WALLET
})

await cart.addProduct('prod-123', 2)
const result = await cart.checkout().pay()

How It Works

CART402 uses the HTTP 402 status code (Payment Required) combined with Solana blockchain for instant, fee-free payments.

1

Customer Checkout

Customer adds products and initiates checkout

2

Payment Request

Server returns HTTP 402 with payment details

3

Blockchain Transaction

Payment processed on Solana (~400ms)

4

Confirmation

Merchant receives funds instantly

HTTP 402 Protocol

The HTTP 402 status code was originally reserved for future payment systems. CART402 implements this standard for crypto payments.

HTTP Response
HTTP/1.1 402 Payment Required
Content-Type: application/json

{
  "amount": 299.99,
  "currency": "USDC",
  "wallet": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
  "network": "solana-mainnet"
}

Solana Integration

CART402 uses Solana for fast, low-cost transactions. Settlements typically complete in ~400ms with fees under $0.001.

Metric Stripe CART402
Transaction Fee 2.9% + $0.30 $0.0001
Settlement Time 2-7 days ~400ms
Chargeback Risk Yes No
Global Access Limited Unrestricted

Initialize

Create a new Cart402 instance with your configuration:

TypeScript
const cart = new Cart402({
  shopify?: {
    store: string,
    apiKey: string
  },
  wallet: string,
  network?: 'mainnet-beta' | 'devnet'
})

Parameters

  • shopify (optional) — Shopify integration config
  • wallet (required) — Your Solana wallet address
  • network (optional) — Solana network (default: mainnet-beta)

Add Product

Add products to the shopping cart:

TypeScript
await cart.addProduct(
  productId: string,
  quantity: number
)

Example

TypeScript
await cart.addProduct('prod-premium-widget', 2)
await cart.addProduct('prod-basic-widget', 1)

Checkout

Create a checkout session and get payment details:

TypeScript
const checkout = await cart.checkout()

// Returns:
{
  total: number,
  currency: 'USDC',
  merchantWallet: string,
  items: Product[]
}

Process Payment

Process the payment transaction:

TypeScript
const result = await checkout.pay(userWallet)

// Returns:
{
  success: boolean,
  signature: string,
  time: number,
  fee: number
}

Shopify Integration

Integrate CART402 with your Shopify store:

TypeScript
const cart = new Cart402({
  shopify: {
    store: 'your-store.myshopify.com',
    apiKey: process.env.SHOPIFY_API_KEY,
    accessToken: process.env.SHOPIFY_ACCESS_TOKEN
  },
  wallet: process.env.MERCHANT_WALLET
})

// Automatically syncs with Shopify catalog
const products = await cart.getProducts()

WooCommerce Integration

Integrate CART402 with WooCommerce:

TypeScript
const cart = new Cart402({
  woocommerce: {
    url: 'https://yourstore.com',
    consumerKey: process.env.WC_KEY,
    consumerSecret: process.env.WC_SECRET
  },
  wallet: process.env.MERCHANT_WALLET
})

Custom Integration

Build a custom integration without e-commerce platform:

TypeScript
const cart = new Cart402({
  wallet: '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU'
})

// Add custom products
cart.addCustomProduct({
  id: 'custom-1',
  name: 'Premium Service',
  price: 99.99
})

Examples

Complete examples for common use cases:

Basic Store

Simple e-commerce integration

View Example →

Subscription

Recurring payments

View Example →

Digital Goods

Instant delivery after payment

View Example →

FAQ

What cryptocurrencies are supported?

Currently CART402 supports USDC on Solana. Support for SOL and other SPL tokens coming soon.

How do I handle refunds?

CART402 provides a refund() method that transfers funds back to the customer's wallet.

Is it production-ready?

Yes! CART402 is battle-tested with 127+ active merchants and 99.9% uptime.

What about network fees?

Solana network fees are typically $0.0001-0.001 per transaction, paid by the customer.

Support

Need help? We're here 24/7:

GitHub

Report issues and contribute

View Repository →

X / Twitter

Latest updates and news

Follow @CommerceX402 →