Edge cases
The four situations every integration trips over. Bake these checks into your handler before going live.
| Situation | Status field | What you do |
|---|---|---|
| Underpaid | status: 'underpaid' | Check received vs amount. Don’t grant access until you decide policy: prorated access, or wait for top-up. |
| Expired | status: 'expired' | Create a new invoice. The old one is terminal. |
| Duplicate webhook | Same event + invoice_id arrives twice | Idempotent handler: dedupe by (event, invoice_id) and ignore the second. |
| Late payment | Payment arrives after the invoice reached status: 'expired' | Not credited to the invoice. The funds are on the invoice’s deposit_address — normally your own wallet: check it, then refund or fulfil per your policy. If the invoice had redirected: true, that address is Cassia’s, so contact support. |
Note: a payment that lands on a terminal invoice (expired, confirmed, cancelled) is outside Cassia’s accounting — received and status do not change and no webhook fires. Exception: with the default reuse strategy an address returns to the pool 60 minutes after its invoice ended. A payment that arrives after the address was handed to a newer invoice is credited to that newer invoice, and its webhooks fire. Show the expiry time clearly and never show an old deposit address again in your own UI.
Updated . For integration help, email [email protected]