Errors
HTTP Status Codes
We use common HTTP status codes included in the response header to indicate success or failure.
Error Codes
Code | Description |
---|---|
200 | OK. Successful request. |
201 | OK. Resource created. |
400 | Bad request. Request message data did not pass validation. |
401 | Unauthorised. Not authorised to access requested data. |
403 | Forbidden. Access to requested data is forbidden. |
404 | Not Found. Requested resource does not exist. |
408 | Timeout. Operation timed out. |
422 | Unprocessable entity. Request message data did not pass validation. |
429 | Too Many Requests |
500 | Server error. |
Validation Errors
Data validation or violation of business rules related errors. Response could contain multiple errors.
Validation Error Example
{"errors": [{"code": "error.route.not.supported","message": "This route is not supported","arguments": ["CNY-EUR"]}]}
Authentication Errors
Security related errors.
Authentication Error Example
{"error": "unauthorized","error_description": "Full authentication is required to access this resource"}
Too Many Requests
An HTTP 429 response status code indicates that the client has sent too many requests in a given time frame. The default thresholds are:
- 100 requests per second
- 1000 requests per minute
Handling 429 responses:
- Implementing a retry mechanism with exponential backoff. For some of the responses we will include a header:
Retry-After
in seconds, which indicates the minimum time after which the request should be retried - Reducing the rate of requests (for example if executing batch requests - limit the number of concurrent http requests)
- Contact Wise with a request to increase request thresholds
Too Many Requests Example
HTTP/1.1 429 Too Many RequestsContent-Length: 0Content-Type: application/jsonRetry-After: 60
System Errors
Something went wrong in our side.
System Error Example
{"timestamp": "2017-02-02T13:07:39.644+0000","status": 500,"error": "Internal Server Error","exception": "java.lang.NullPointerException","message": "No message available","path": "/v1/quotes/0b63b0cb-2041-4bc4-b3fc-1e51a1454a1b/account-requirements"}