Introduction
CART402 is a developer-first payment protocol that enables crypto payments with 0% transaction fees and instant settlement. Built on HTTP 402 + Solana.
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:
npm install @cart402/sdk
Or using yarn:
yarn add @cart402/sdk
Quick Start
Get started with CART402 in minutes:
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.
Customer Checkout
Customer adds products and initiates checkout
Payment Request
Server returns HTTP 402 with payment details
Blockchain Transaction
Payment processed on Solana (~400ms)
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/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:
const cart = new Cart402({
shopify?: {
store: string,
apiKey: string
},
wallet: string,
network?: 'mainnet-beta' | 'devnet'
})
Parameters
shopify(optional) — Shopify integration configwallet(required) — Your Solana wallet addressnetwork(optional) — Solana network (default: mainnet-beta)
Add Product
Add products to the shopping cart:
await cart.addProduct(
productId: string,
quantity: number
)
Example
await cart.addProduct('prod-premium-widget', 2)
await cart.addProduct('prod-basic-widget', 1)
Checkout
Create a checkout session and get payment details:
const checkout = await cart.checkout()
// Returns:
{
total: number,
currency: 'USDC',
merchantWallet: string,
items: Product[]
}
Process Payment
Process the payment transaction:
const result = await checkout.pay(userWallet)
// Returns:
{
success: boolean,
signature: string,
time: number,
fee: number
}
Shopify Integration
Integrate CART402 with your Shopify store:
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:
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:
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:
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: