HTTPS status codes
When an API request fails, Nexpay returns both an HTTP status code and a structured JSON error response that includes one or more internal error codes with human-readable messages. This combined approach helps you quickly identify what went wrong and take the appropriate action.
How errors are reported
HTTP status codes indicate the general class of error:
| Error code type | Desciption |
|---|---|
| 400 (Bad Request) | The request contains invalid data |
| 403 (Forbidden) | Authentication or permission issues |
| 404 (Not Found) | Invalid endpoint or resource not found |
| 500 (Internal Server Error) | Unexpected server issue or processing error |
Error structure in JSON format
Data structure for errors object:
Examples
In addition to the HTTP status, the API returns a JSON body with one or more error objects:
{
"errors": [
{
"code": -32600,
"message": "Invalid Request",
"data": "Unknown symbol BTCUSD"
}
],
"traceId": "b1d88d60011a9bda350b0eef7dc8dcbb"
}
{
"errors": [
{
"code": 30240,
"message": "Invalid cryptocurrency address"
}
],
"traceId": "092b0d1cf5dfadac6f148039d40851ea"
}
Common error categories
Nexpay defines a set of internal error codes, each associated with a clear message describing the issue:
1. HTTP 403 - authentication & authorization errors
These codes indicate problems with authentication headers or API key state.
| JSON Code | Message | Description |
|---|---|---|
10 | Missing API key | API key not exists in HTTP request header |
20 | Missing nonce | Nonce not exists in HTTP request header |
30 | Missing signature | Signature not exists in HTTP request header |
40 | Invalid API key | API key not found or have invalid format |
50 | Nonce is not monotonous | Received nonce is smaller than in previous requests |
60 | Nonce is not valid | Too big number or not a number |
70 | Wrong signature | Specified signature is not correct |
80 | No permissions | API key has no permissions to call this method |
90 | API key is not enabled | Client have not enabled API key |
100 | API key locked | API key is locked due to client action or Nexpay decision |
110 | Invalid client state | Client account is closed or is not approved |
120 | Invalid API key state | API key is deleted |
121 | Deprecated API key | API key is outdated and not suitable for this feature, needs to be regenerated |
2. HTTP 400 - request validation errors
These errors point out malformed or logically incorrect payload data that needs to be fixed before retrying.
| JSON Code | Message | Description |
|---|---|---|
30000 | Request error | The request is invalid due to some logical error |
30010 | Invalid request parameter | The request parameter is incorrectly formatted or invalid |
3. HTTP 500 - server errors
Returns when an unexpected server problem occurs during processing
| JSON Code | Message | Description |
|---|---|---|
-32603 | Internal error | The request failed due to an internal error |
Payment flow
The core functionality of the Nexpay API is centered around the creation of outgoing payments and fetching incoming payment information. With Nexpay, you can programmatically initiate and manage payments to external accounts, while also retrieving details about funds received into your Nexpay IBAN accounts. Although outgoing payments can be used for a variety of purposes, their primary use case is mass B2C payouts - enabling efficient and automated disbursements at scale.
Authentication
Secure communication between your system and the Nexpay API