Skip to content

Docs

Invoices

Create an invoice on your server, send the payer to the hosted page.

Create

POST /v1/invoices · Authorization: Bearer sk_live_…

curl
curl https://api.stabletally.com/v1/invoices \
  -H "Authorization: Bearer $STABLETALLY_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order_1042" \
  -d '{
    "amount": "49.00",
    "token": "USDC",
    "chains": ["base", "polygon", "arbitrum"],
    "description": "Pro plan, 1 month",
    "metadata": { "orderId": "1042" },
    "customerEmail": "ana@example.com",
    "expiresIn": 3600
  }'
node
const res = await fetch('https://api.stabletally.com/v1/invoices', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.STABLETALLY_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': 'order_1042',
  },
  body: JSON.stringify({ amount: '49.00', description: 'Pro plan, 1 month', metadata: { orderId: '1042' } }),
});
const invoice = await res.json();
// Send the payer to invoice.hostedUrl

Send the payer to hostedUrl (/pay/i/inv_…).

Parameters

amountRequired
Up to 2 decimals, 0.01 to 1,000,000.
tokenOptional
USDC (default) or USDT (Ethereum only).
chainsOptional
Allowed networks, e.g. ["base","polygon"].
descriptionOptional
Shown on the hosted page. Max 500.
metadataOptional
Up to 20 string pairs. Never shown to the payer.
customerEmailOptional
For your records. We send no email.
expiresInOptional
Seconds, 300 to 604,800. Default 3,600.
Idempotency-KeyHeader
Retrying with the same key returns the same invoice.

Retrieve and list

GET /v1/invoices/:id · GET /v1/invoices?limit&status&startingAfter → data, hasMore

curl
curl "https://api.stabletally.com/v1/invoices?limit=20&status=paid" \
  -H "Authorization: Bearer $STABLETALLY_SECRET_KEY"

curl https://api.stabletally.com/v1/invoices/inv_7kq3m9x2abcd4efg \
  -H "Authorization: Bearer $STABLETALLY_SECRET_KEY"

Object

json
{
  "id": "inv_7kq3m9x2abcd4efg",
  "object": "invoice",
  "status": "paid",
  "amount": "49.00",
  "amountDisplay": "49.00 USDC",
  "token": "USDC",
  "chains": ["base", "polygon", "arbitrum"],
  "description": "Pro plan, 1 month",
  "metadata": { "orderId": "1042" },
  "customerEmail": "ana@example.com",
  "hostedUrl": "https://www.stabletally.com/pay/i/inv_7kq3m9x2abcd4efg",
  "createdAt": "2026-11-22T15:04:05.000Z",
  "expiresAt": "2026-11-22T16:04:05.000Z",
  "paidAt": "2026-11-22T15:06:41.000Z",
  "payment": {
    "chainId": 137,
    "chain": "polygon",
    "token": "USDC",
    "txHash": "0x…",
    "logIndex": 12,
    "from": "0x…",
    "amountRaw": "49004817",
    "amount": "49.004817",
    "amountDisplay": "49.004817 USDC",
    "blockTime": "2026-11-22T15:06:41.000Z",
    "explorer": "https://polygonscan.com/tx/0x…"
  }
}

Statuses

pending
Waiting for payment.
paid
The exact amount arrived. payment has tx hash, log index, payer and amount.
underpaid
Transfer attributed but short (see rules). The funds are already in your wallet.
expired
No payment before expiresAt + 30 min grace. Final.