code. Branch on the code, never on the message or on the HTTP status alone, because several codes share a status.
Stableyard-Version header, so a report can be tied to the contract that produced it.
Request and authentication
Accounts and compliance
Idempotency and concurrency
Payments
Escrow and settlement
Refunds
Infrastructure
Retrying safely
Never create a replacement payment to work around a stuck one. Reuse the original payment and its key. A new payment for the same order is how duplicate payouts happen.
Next
Idempotency
How keys make retries safe.
Status codes
Payment, deposit and refund states.