title: "Errors"
description: "Every BchainPay error has a stable code, a human-readable message, and a documented HTTP status."
section: "API reference"
order: 1
updated: "2026-04-18"
sourcePath: "content/docs/api/errors.mdx"
The BchainPay API returns conventional HTTP status codes and a JSON body with a stable error code. Always switch on code, not message (messages may change).
Error envelope
{ "error": { "type": "invalid_request", "code": "invalid_network", "message": "Network 'avalanche' is not supported.", "param": "network", "request_id": "req_8H2x...91" }}