Skip to content

Quickstart

Zero to a verified API call in under ten minutes.

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.

Create a payment session in the sandbox:

Terminal window
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"
}

Send test funds to depositAddress. Poll the session or wait for the webhook:

Terminal window
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.

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();

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.