General information

HTTPS status codes

Status codes and errors guide

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 typeDesciption
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

errors
array of object required
Array with error details
traceId
string
An incident ID for the error; include this reference when contacting customer support

Data structure for errors object:

code
integer required
Error code
message
string required
Error message
data
string
Additional error details

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"
}

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 CodeMessageDescription
10Missing API keyAPI key not exists in HTTP request header
20Missing nonceNonce not exists in HTTP request header
30Missing signatureSignature not exists in HTTP request header
40Invalid API keyAPI key not found or have invalid format
50Nonce is not monotonousReceived nonce is smaller than in previous requests
60Nonce is not validToo big number or not a number
70Wrong signatureSpecified signature is not correct
80No permissionsAPI key has no permissions to call this method
90API key is not enabledClient have not enabled API key
100API key lockedAPI key is locked due to client action or Nexpay decision
110Invalid client stateClient account is closed or is not approved
120Invalid API key stateAPI key is deleted
121Deprecated API keyAPI 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 CodeMessageDescription
30000Request errorThe request is invalid due to some logical error
30010Invalid request parameterThe request parameter is incorrectly formatted or invalid

3. HTTP 500 - server errors

Returns when an unexpected server problem occurs during processing

JSON CodeMessageDescription
-32603Internal errorThe request failed due to an internal error