The Magic API uses the conventional HTTP status codes to indicate success or failure of an API request.
HTTP Status Code | Description |
---|---|
200-299 | The request was processed successfully |
400-499 | The request was not valid (e.g. a required parameter was missing). |
500-599 | The request could not be processed for an unexpected reason. |
Response
Returns a JSON object and an appropriate HTTP status code.
Please note that the human-readable textual messages included within the error object are improved over time. For validation and mapping purposes, please use the error code or HTTP status code values.
Attribute | Type | Description |
---|---|---|
code | string | The type of error returned. E.g.:, order_refund_amount_invalid |
httpStatusCode | integer | The HTTP status code |
message | string | A human-readable message which provides more details about the error. In most cases, these messages can be displayed to the end user. |
title | string | A shorter resume of the error |
{
"errors": [
{
"code": "order_refund_amount_invalid",
"httpStatusCode": 400,
"message": "The requested refund amount exceeds the order amount",
"title": "Refund amount exceeds the order amount"
}
]
}