Quickstart
Zero to a verified API call in under ten minutes.
1. Get an API key
Section titled “1. Get an API key”Sign in to the merchant dashboard, create a project, and copy the test key. Test keys are prefixed sk_test_* and target the sandbox only.
2. Make your first request
Section titled “2. Make your first request”Create a payment session in the sandbox:
curl -X POST https://api.stablecoinx.com/v1/sessions \ -H "Authorization: Bearer $STABLECOINX_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": "10.00", "currency": "USD", "chain": "base-sepolia", "successUrl": "https://example.com/thanks" }'Response:
{ "id": "sess_01HX2K3...", "depositAddress": "0xabc...", "amount": "10.00", "currency": "USD", "chain": "base-sepolia", "status": "awaiting_payment", "expiresAt": "2026-05-26T17:00:00Z"}3. Verify the payment
Section titled “3. Verify the payment”Send test funds to depositAddress. Poll the session or wait for the webhook:
curl https://api.stablecoinx.com/v1/sessions/sess_01HX2K3... \ -H "Authorization: Bearer $STABLECOINX_KEY"When status is completed, funds have settled to your merchant wallet.
4. Verify webhook signatures
Section titled “4. Verify webhook signatures”Every webhook is signed with HMAC-SHA256 using your project’s webhook secret. Verify on receipt — never trust an unsigned payload:
import crypto from "node:crypto";
const signature = req.headers["x-stablecoinx-signature"];const expected = crypto .createHmac("sha256", process.env.STABLECOINX_WEBHOOK_SECRET!) .update(req.rawBody) .digest("hex");
if (signature !== expected) return res.status(401).end();5. Go live
Section titled “5. Go live”Swap the test key for a live key (sk_live_*) and change chain from base-sepolia to a supported mainnet — base, arbitrum, optimism, or ethereum. Sandbox and production share the same API shape, so no code changes are required.
Where to next
Section titled “Where to next”- Session Payment — the payment flow in depth.
- Paymaster API — sponsor gas or let users pay in stablecoins.
- Treasury Dashboard — operate the funds you’ve settled.