Requests & Responses
Making a Request
Every request requires two headers:
| Header | Value |
|---|---|
x-api-key | Your API key — see Authentication |
Content-Type | application/json |
Response Format
All API responses share a common envelope:
{
"code": 0,
"message": "Success",
"data": {}
}
| Field | Type | Description |
|---|---|---|
code | integer | 0 indicates success. Any non-zero value indicates an error. |
message | string | Human-readable description of the result. |
data | object | Response payload. Shape varies by endpoint — see individual API docs. |
Error Handling
When a request fails, the response body contains a message describing the issue. The HTTP status code indicates the category of failure.
| HTTP Status | Meaning |
|---|---|
400 | Bad request — invalid parameters |
401 | Unauthorized — missing or invalid API key |
404 | Not found — resource does not exist or has expired |
422 | Unprocessable — request was valid but could not be completed (e.g. invalid redirect URL) |
500 | Server error |
Example error response:
{
"code": -1,
"message": "Invalid PAN"
}
tip
Some verification endpoints return code: 0 with an INVALID status inside data rather than an HTTP error — this means the request succeeded but the document being verified is invalid. Check the data field alongside code and message.