Quickstart
60 seconds, assuming you’ve read the three core concepts.
Create an API key
Managing API keys requires two-factor authentication: first enable 2FA in Settings. Then open your project’s Overview → Quick integration → Generate API key and enter your 2FA code. The key is shown once — save it immediately. Cassia stores only a hash; we can’t recover lost keys.
Connect wallets — one per chain
You need one wallet registered per chain you want to accept payments on. Dashboard → Wallets → Connect wallet.
Fastest path (recommended): choose Generate — Cassia generates a BIP39 seed phrase in your browser and registers wallets for all five mainnet chains (Ethereum, BSC, Arbitrum, Solana, Tron) plus both testnets in one step. Nothing leaves your browser during generation.
Solana can only be connected this way. It has no xpub to paste and no manual-tooling route — the generator is the only path. It derives 200 Solana addresses on your device at
m/44'/501'/{index}'/0', and Cassia has no sweep tool for them: recovery means importing your seed into Phantom or Solflare yourself. Read Solana wallets before you generate.Already connected wallets before Arbitrum was added? No need to regenerate anything — go to Wallets → Connect wallet → Paste xpub, select Arbitrum, and paste the same xpub you used for Ethereum or BSC (they share the same derivation path). It registers as a standalone wallet rather than joining your original generated group, which is cosmetic only.
Have your own xpub? Choose Paste xpub and register each chain separately. You need the BIP44 account-level xpub (depth 3) — the key labelled “Account Extended Public Key” in tools like iancoleman.io/bip39. This path covers Ethereum, BSC, Arbitrum and Tron; Solana is not available here.
If the xpub is refused, check that you exported the account-level extended public key (not a child or address-level key). If it is still refused, contact support with the error code from the response.
Pick an address strategy when connecting:
reuse(recommended) — pool of addresses, Cassia recycles free ones. Cheaper to sweep.single_use— fresh address per invoice. Higher address-count, simpler audit.- On Solana both strategies draw from the same fixed 200-address pool — it never grows.
single_useprefers a never-used address and falls back to recycling once none is left;reuseprefers a cooled-down address and takes a never-used one only when nothing has cooled down yet.
Create your first invoice
curl -X POST https://cassiapay.com/api/invoices \ -H "Authorization: Bearer $CASSIA_KEY" \ -H "Content-Type: application/json" \ -d '{ "chain": "eip155:1", "token": "USDT", "amount": 10.00, "metadata": { "order_id": "demo-1" } }' # chain: "eip155:1" (Ethereum) | "eip155:56" (BSC) | "eip155:42161" (Arbitrum) # | "solana:mainnet" (Solana) | "tron:mainnet" (Tron) # token: "USDT" | "USDC"Response (fields you’ll use):
{ "id": "5b3e…", "chain": "eip155:56", "token": "USDT", "amount": 10, "deposit_address": "0xC0FFEE…", "expires_at": "2026-05-04T18:30:00Z", "status": "pending", "redirected": false, "metadata": { "order_id": "demo-1" } }deposit_addressis where your customer pays.idis what you’ll match webhook events against. No follow-upGETneeded — the address is in the POST response.Show the address to your customer
Display
deposit_addressas a QR and copyable string. Warn: same chain, same token — paying USDT-ERC20 to a USDT-BEP20 address is a lost payment.Wait for the webhook
Register an endpoint under Webhooks. When the customer pays, Cassia POSTs the invoice to your URL. See Receiving webhooks for payload, signature, and which event to key your business logic off.
Full minimal example (Node)
End-to-end flow: create an invoice on demand, return the address to your client, verify the signed webhook, grant access on finality.
import express from 'express';
import crypto from 'node:crypto';
const app = express();
const CASSIA_KEY = process.env.CASSIA_KEY;
const WEBHOOK_SECRET = process.env.CASSIA_WEBHOOK_SECRET;
const seen = new Set(); // swap for Redis/DB in production
// 1) Mint an invoice when a customer clicks "Pay".
// chain: "eip155:1" | "eip155:56" | "eip155:42161" | "solana:mainnet" | "tron:mainnet"
// token: "USDT" | "USDC"
app.post('/checkout', express.json(), async (req, res) => {
const r = await fetch('https://cassiapay.com/api/invoices', {
method: 'POST',
headers: {
'Authorization': `Bearer ${CASSIA_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
chain: req.body.chain,
token: req.body.token,
amount: req.body.amount,
metadata: { user_id: req.body.user_id },
}),
});
const invoice = await r.json();
res.json({
address: invoice.deposit_address,
amount: invoice.amount,
chain: invoice.chain,
token: invoice.token,
expires_at: invoice.expires_at,
});
});
// 2) Receive and verify the webhook. Use raw body for HMAC.
app.post('/webhooks/cassia',
express.raw({ type: 'application/json' }),
(req, res) => {
const ts = req.header('X-Cassia-Timestamp');
const sig = (req.header('X-Cassia-Signature') || '').replace(/^sha256=/, '');
const expected = crypto
.createHmac('sha256', WEBHOOK_SECRET)
.update(`${ts}.${req.body.toString('utf8')}`)
.digest('hex');
if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(sig))) {
return res.status(401).end();
}
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) {
return res.status(401).end(); // replay protection
}
const evt = JSON.parse(req.body.toString('utf8'));
const dedupeKey = `${evt.event}:${evt.invoice_id}`;
if (seen.has(dedupeKey)) return res.status(200).end();
seen.add(dedupeKey);
// 3) Grant on confirmed (final). Skip "paid" for high-value flows.
if (evt.event === 'invoice.confirmed') {
grantAccess(evt.invoice_id);
}
res.status(200).end();
},
);
app.listen(8080);Updated . For integration help, email [email protected]