Everything you need to accept stablecoin payments. Base URL: https://wetakestables.shop
All authenticated endpoints require a Bearer token in the Authorization header. Get your token from the dashboard or login response.
Authorization: Bearer your-merchant-token
Create a new merchant account. Returns a merchant ID and sends a verification email.
Body:
{
"email": "merchant@example.com",
"companyName": "My Store",
"contactName": "John",
"password": "min8chars",
"plan": "FREE"
}
Response:
{
"success": true,
"message": "Check your email for the verification code.",
"merchantId": "cmXXXXXXXX"
}
Verify email with the 6-digit code. Auto-activates FREE tier accounts.
{ "email": "merchant@example.com", "code": "123456" }
Response:
{ "success": true, "token": "your-bearer-token", "merchantId": "cmXXXX", "isActive": true }
Login with email + password. Returns a Bearer token for API calls.
{ "email": "merchant@example.com", "password": "your-password" }
Response:
{ "success": true, "token": "your-bearer-token", "merchantId": "cmXXXX", "isActive": true }
Request a password reset code. Sends a 6-digit code to the email.
{ "email": "merchant@example.com" }
Reset password using the 6-digit code from email.
{ "email": "merchant@example.com", "code": "123456", "newPassword": "min8chars" }
This is the main endpoint your checkout flow calls. Creates an order and returns a payment address.
Create a payment order. No auth required — uses merchantId to identify the account.
Body:
{
"merchantId": "your-merchant-id", // Required
"amount": 99.99, // Required — in USD
"chain": "BASE_MAINNET", // Optional — customer picks if omitted
"token": "USDC", // Optional — defaults to USDC
"customerEmail": "buyer@email.com", // Optional
"customerWallet": "0xabc...", // Optional — customer's wallet for precise matching
"productName": "Order #1234" // Optional
}
Response:
{
"success": true,
"order": {
"id": "cmXXXXXX",
"amount": 99.99,
"token": "USDC",
"chain": "BASE_MAINNET",
"paymentAddress": "0x...", // Send stablecoins HERE
"expiresAt": "2026-03-28T..."
}
}
List your orders. Requires Bearer token. Returns only orders belonging to the authenticated merchant.
Authorization: Bearer your-token
// Response:
{ "orders": [...], "total": 42, "page": 1, "limit": 50 }
Get a single order by ID. Returns full order details including transaction info.
Manually confirm an order (admin). Normally handled automatically by on-chain detection.
Configure your webhook URL in the dashboard or via the agent. We POST to your endpoint when payment events occur.
When a customer pays, we send a POST request to your server so you know it happened. You don't need to check — we tell you.
Your webhook URL: https://YOUR-DOMAIN/api/webhooks/stablepay
Set this in your dashboard or tell the AI agent your domain and it'll configure everything + write the handler code for you.
// pages/api/webhooks/stablepay.js
export default async function handler(req, res) {
if (req.method !== 'POST') return res.status(405).end();
const { event, orderId, amount, txHash, chain } = req.body;
if (event === 'order.confirmed') {
// Payment confirmed! Do your thing:
// - Update your database
// - Send confirmation email
// - Fulfill the order
console.log(`Payment: $${amount} on ${chain}, tx: ${txHash}`);
}
res.status(200).json({ received: true });
}
We POST this JSON to your webhook URL:
{
"event": "order.confirmed", // Event type
"orderId": "cmXXXXXX",
"merchantId": "cmXXXXXX",
"amount": "99.99",
"token": "USDC",
"chain": "BASE_MAINNET",
"txHash": "0xabc...",
"customerEmail": "buyer@email.com",
"status": "CONFIRMED",
"timestamp": "2026-03-28T12:00:00Z"
}
Events:
order.created — New payment order createdorder.confirmed — Payment confirmed on-chainorder.refunded — Refund processedinvoice.paid — Invoice payment receivedreceipt.sent — Receipt email delivered
Customer clicks "Pay with Crypto" on your site
|
StablePay checkout opens (modal or hosted page)
|
Customer picks chain (Base, Ethereum, Polygon, Arbitrum, Solana)
|
Customer picks stablecoin (USDC, USDT, EURC — varies by chain)
|
Customer picks HOW to pay:
+-- Connect Wallet — MetaMask/Rainbow/Coinbase/Phantom, one-click approve
+-- QR Code — scan with mobile wallet app
+-- Copy Address — paste into any wallet or exchange
|
Payment lands in YOUR wallet (direct, non-custodial)
|
Our scanner detects the on-chain transfer (15-30 seconds)
|
Webhook fires to your server: { event: "order.confirmed", amount, txHash }
|
Customer redirected to your success page
The checkout widget gives every customer 3 ways to pay — no config needed:
Connect Wallet
MetaMask, Rainbow, Coinbase Wallet, Phantom. One-click approve. Best for desktop.
QR Code
Scan with any mobile wallet app. Pre-filled transaction. Best for phones.
Copy Address
Copy wallet address + exact amount. Send from any wallet or exchange (Coinbase, Binance).
Customers choose their chain and stablecoin. The widget shows only what you have configured. If you accept USDC on Base and Ethereum, that's what they see — nothing more.
Drop-in checkout for any website. One script tag + one function call.
<script src="https://wetakestables.shop/checkout-widget.js"></script>
<button onclick="StablePay.checkout({
merchantId: 'your-merchant-id',
amount: 49.99,
onSuccess: (data) => {
console.log('Paid!', data.orderId, data.txHash);
window.location.href = '/thank-you';
},
onCancel: () => console.log('Cancelled')
})">Pay with Crypto</button>
All Options:
merchantIdstringRequired. Your merchant ID.amountnumberPayment amount in USD. Omit for dynamic.productNamestringOptional. Shown in checkout UI.customerEmailstringOptional. Pre-fill customer email.allowedChainsstring[]Restrict chains: ["BASE_MAINNET", "ETHEREUM_MAINNET"]allowedTokensstring[]Restrict tokens: ["USDC", "USDT"]onSuccessfunctionCallback with { orderId, txHash, amount }onCancelfunctionCalled when customer closes checkoutEvery checkout automatically shows 3 ways to pay. No config needed.
Multiple wallets? Customer sees a picker. Single wallet connects automatically.
Create and send an invoice. Requires Bearer token.
{
"merchantId": "cmXXXX",
"customerEmail": "client@email.com",
"customerName": "Client Name",
"subtotal": 500.00,
"lineItems": [
{ "description": "Web Design", "quantity": 1, "unitPrice": 500.00 }
],
"dueDate": "2026-04-15",
"notes": "Thank you for your business"
}
List all receipts. Auto-generated when payments confirm.
Volume-based fees. No subscriptions. No setup costs.
100% of payments go directly to your wallet. Fees are invoiced separately per billing cycle.