We’ve build a REST API that uses conventional HTTP response codes to indicate success or failure of an API request. The basic HTTP status codes we use are:
- 2xx: indicates a successful request
- 4xx: you did something wrong
- 5xx: we did something wrong
| HTTP Status Code Summary | ||
|---|---|---|
| Code | Meaning | Description |
| 200 | OK | The request was completed successfully. |
| 201 | Created | The payment was correctly initialized. |
| 204 | No Content | The request was received, but there is no need to send any data back. |
| 400 | Bad Request | Often missing a required parameter. |
| 401 | Unauthorized | No valid authorization header provided. |
| 402 | Request Failed | The parameters were valid but the request failed. |
| 404 | Not Found | The requested item doesn’t exist. |
| 500, 502, 503, 504 | Server errors | We did something wrong. |