Эксплуатация

The going-live checklist

The four things that behave differently once real money is involved: payout timelocks, secret rotation, invoice statuses, and the error contract.

4 шага2 мин чтенияproductionsecuritywebhooks
Шаг 11 из 4

Set the payout address before you need it

Invoice settlement sweeps to your merchant payout address. Changing it is staged, email-confirmed, and then timelocked before it goes live — an attacker with a live session still cannot redirect tomorrow's money today.

The consequence for you is scheduling: set the real address well before your first live payment, not on the morning of launch.

Шаг 22 из 4

Know how to rotate before you have to

POST /api/v1/webhooks/secret/rotate mints a new webhook secret and returns it once. The old one stays acceptable until the returned prev_expires_at (24 hours by default).

We only ever sign with the current secret — the grace window is an instruction to your receiver: verify against the new secret and fall back to the previous one until it expires. Rotating twice in quick succession replaces the previous secret rather than chaining, so your fallback list is never longer than two.

GET /api/v1/webhooks/secret reports rotated_at, prev_expires_at and prev_active — never the secret itself.

Шаг 33 из 4

Learn the six invoice statuses

  • pending — created, nothing received yet.
  • confirming — payment seen on-chain, below the confirmation threshold.
  • partial — less than the expected amount arrived.
  • paid — fully paid and confirmed; the ledger journal is posted.
  • swept — the net amount was forwarded to your wallet.
  • expired — the window closed with no payment.

Fulfil on paid, not on confirming. swept is your money moving and is not a signal about the customer.

Шаг 44 из 4

Read errors as a contract

Every error is { "error": "<code>", "detail": "<sentence>" }. The rule the API holds itself to: 4xx means you must change something; 5xx means a retry may help, and a caller error is never reported as a 5xx.

The ones you will meet first: bad_request (malformed body, unparseable amount, non-https callback in production), unauthorized (missing or revoked key), not_found (no such resource, or not yours), rate_limited (back off using X-RateLimit-Reset / Retry-After), and rate_unavailable (a amount_fiat request with no fresh FX rate — retryable).

Что-то здесь неверно или устарело? Сообщите нам — и сверьтесь со справочником API: он генерируется из спецификации и всегда имеет приоритет.