Comment on page
Responses
Hakuna uses conventional HTTP status codes to indicate the success or failure of an API request. Codes in the
2XX
range indicate a successful request, and codes in the 4XX
range indicate a failed request, typically due to invalid inputs or operations.Here's a summary of the HTTP status codes you could receive from the Hakuna API:
STATUS CODE | DESCRIPTION |
---|---|
200 | Success |
400 | Bad Request |
401 | Unauthorized |
404 | Entity Not Found |
When an unsuccessful request occurs, you will receive a payload in the following format:
{
"error": {
"error_code": "supported_error_code",
"validation_errors": []
}
}
All error payloads will contain a unique
error_code
which you can use to identify the error. In case of a badly formed request, Hakuna will also return additional validation_errors
.The following
error_codes
are supported:ERROR CODE | DESCRIPTION |
---|---|
invalid_request_parameters | One or more of the required parameters in the request were missing or invalid. Human-readable error messages are returned in the validation_errors field. |
product_unsupported | The product you tried to create an Offer for is not supported. |
country_unsupported | The country you tried to create an Offer for is not supported (either because we do not support that country, or because your store does not have permission to create Offers for it). |
saleschannel_unsupported | The sales channel you tried to create an Offer for is not supported because your store does not have permission to create Offers for it. |
location_unsupported | The customer address location (country code) is not supported by any of the sold plans. |
incorrect_saleschannel | The sales channel is not supported by any of the sold plans. |
cancel_decline | The Order can no longer be cancelled (e.g., the Order has already been fulfilled or cancelled). |
Last modified 4mo ago