Errors

Cermati.com uses conventional HTTP response codes to indicate the success or failure of an API request.

In general, codes in the 2xx range indicate success. Codes in the 4xx range indicate errors (eg: a required parameter was omitted, etc). Codes in the 5xx range indicate an error with Cermati’s servers.

Some 4xx errors that could be handled programmatically (eg:, an order is declined) include error codes that briefly explain the error reasons. For example, the response that accompanied HTTP response code 422 (validation error) may look like this:

{ 
  "success": false,
  "error": { 
    "name": {
      "required": "Name is required."
    }
  }
}

The summary of the HTTP response codes is given below.

HTTP Response Code

Remarks

200

Everything works as expected

400

Bad request

401

Unauthorized

403

Forbidden
This could mean insufficient permission or there is a firewall ruleset that strictly prohibits this specific request, e.g. the request contains a prohibited string.

404

Not found

409

Conflict

422

Validation error

429

Too many requests

500, 502, 503, 504

Server error