Invoices

Checkout flow (recommended)

  1. Customer clicks "Pay" in your UI.
  2. Server: POST /api/invoices with { chain, token, amount, metadata }.
  3. Show the returned address to the customer (QR + copyable).
  4. Customer sends payment from their wallet.
  5. Cassia observes the tx and calls your webhook with invoice.paid.
  6. Grant access (digital goods) or start fulfillment (physical goods). For high-value orders, wait for invoice.confirmed — see When to grant access.

Polling fallback

If you can't expose a public webhook yet, poll GET /api/invoices/:id every 5–10 seconds while the invoice is pending. Move to webhooks before shipping anything real — polling loses state on server restart and costs more at scale.

Handling underpaid

When the customer sends less than amount, the invoice enters underpaid and fires invoice.underpaid. Payload includes received. Three options:

  • Partial fulfillment — grant proportional access.
  • Refund — send funds back from your wallet (Cassia can't do this for you — see non-custodial).
  • Ask for the remainder — out of band; create a new invoice for the difference.

Endpoints

  • POST/api/invoices
    create.
  • GET/api/invoices
    list, paginated, filterable by status, chain, token.
  • GET/api/invoices/:id
    fetch one with transaction log and webhook delivery history.
  • POST/api/invoices/:id/cancel
    cancel unpaid invoice. Idempotent on already-cancelled invoices. Throws 400 if the invoice is paid, confirmed, or expired. Only pending and underpaid are cancellable. Also 400 while a payment for the invoice is being verified: "Cannot cancel this invoice yet — a payment for it is being verified. It will be settled or expire on its own."
  • GET/api/invoices/export.csv
    RFC 4180 CSV of all invoices matching filters. Query: status, chain, token, include_testnet=true. Streams the full filtered result; no pagination cursor needed at current volumes.
  • POST/api/invoices/acknowledge
    dismiss underpaid alerts on the dashboard.

POST /api/invoices errors

StatuserrorMeaningWhat to do
503issuance_pausedCreation is temporarily unavailable on this network. Nothing was created.Retry later.
503address_issuance_unavailableA deposit address could not be prepared. Nothing was created.Retry later; contact support if it persists.

Updated . For integration help, email [email protected]

From signup to payment setup in 7 minutes

Start accepting
payments today
on 5 blockchains.

Create accountRead documentation