Errors
Curacel Grow uses the standard HTTP response codes to indicate if an API request was successful or not.
The standards are as follows:
- Codes in the 2xx range, on the whole, suggest success.
- Codes in the 4xx range indicate that an error occurred based on the data provided (For example, a charge failed, a needed parameter was left out, and so on.)
- Codes in the 5xx range suggest that something went wrong on Curacel's end. (These are rare, we promise!).
In some cases, errors are handled automatically(e.g, when a card is declined, an error will be shown to highlight the issue and possibly offer information on how to fix it).
HTTP Response Status Codes
Status Codes | Description |
---|---|
1xx | Informational |
2xx | Successful - Everything worked as expected. |
3xx | Redirection messages |
4xx | Client Error responses |
5xx | Server error responses |
HTTP Response Status Codes Summary
Status Codes | Description |
---|---|
200 - OK | Everything worked perfectly. |
201 - Created | As a result of the request's success, a new resource was created. |
400 - Bad Request | The request was denied, usually because a required parameter was missing. |
401 - Unauthorized | Unauthenticated because no valid API key was provided. |
402 - Request Failed | The parameters were correct, however, the request did not succeed. |
403 | The client does not have access rights to the content. |
404 - Not Found | The server can not find the requested resource. The link may be correct, but the resource does not exist. |
409 - Conflict | This response is sent when a request conflicts with the current state of the server. |
422 - Unprocessable Entity | The request was well-formed, however, it couldn't be carried out because of semantic flaws. |
429 - Too Many Requests | The user has issued an excessive number of requests in a short period of time ("rate limiting"). |
500, 502, 503, 504 - Server Errors | Something went wrong on Curacels' end. (These are rare.) Note that together with this response, a user-friendly page explaining the problem should be sent. |
Likely Errors You May Encounter
400 Bad Request
{
"message": "400 Bad Request (Client Error)"
}
We recommend you debug this by checking the following likely causes:
- Your request syntax
- Code logic
- URL string syntax
- Query/Path Parameter required
401 Unauthorized
{
"message": "Unauthenticated."
}
Causes
This error message is usually caused when the security credential required to authenticate your request is not supplied.
Fixes
The possible fixes include:
- including your API key in the header part of your request.
- checking if your API key is correct
- checking if your API key is not invalid or expired.
404 Not Found
{
"message": "Sorry, the Customer you requested was not found"
}
Causes
Factors may include:
- the requested resource is not available on the server
- your request URL is broken or incorrect
- your supplied parameter value is incorrect
- network issue (making another request may fix it)
Fixes
- refresh or make your request again
- check the endpoint URL syntax to ensure it is correct
- check if what you are requesting is available on the server
422 Unprocessable Content
{
"message": "The given data was invalid"
}
{
"message": "The given data was invalid",
"errors": {
"customer_ref": [
"The selected customer ref is invalid",
"The selected customer ref is invalid"
],
"product_code": [
"The product code field is required",
"The product code field is required"
]
}
}
Causes
This is caused when you supply invalid data on your request despite your request being correct. The server will return a 422
error if it cannot process the data you supplied on your request because it is most likely invalid or incorrect.
Fixes
- Supply the correct data and data type on your request