Concepts
Response Format
The unified envelope used by every Buvei endpoint.
Every response — success or error — is wrapped in the same envelope. This makes client-side error handling uniform.
Headers
| Header | Description | Example |
|---|---|---|
X-Request-ID | Unique identifier for the request. Quote it when you contact support. | tc_66ac4c4f20a24d879ffbc |
Success
{
"code": 0,
"message": "SUCCESS",
"data": {
// resource-specific payload
}
}code: 0 is the universal "OK" marker — not the HTTP status. The HTTP status will be 200.
Error
{
"code": 400,
"message": "Invalid request parameter",
"errors": {
"amount": "Amount must be positive",
"cardBinId": "Card BIN ID is required"
}
}code mirrors the HTTP status. The optional errors map provides per-field validation messages.
Why code: 0?
Some legacy clients only inspect the response body. Forcing every success to carry code: 0 lets those clients distinguish "the server processed this and returned data" from "the server rejected this and returned a structured error" without parsing the HTTP status. Modern clients can safely rely on the HTTP status alone.