Error codes
For all responses, Foodin Connect returns a standard HTTP status code.
The following table describes the codes used by Foodin Connect:
HTTP Code | Reason | Description |
---|---|---|
200 | Success | The request was successful. The response contains the requested resource or the result of a requested action. |
400 | Bad request | The request is unacceptable. Ensure that all the required parameters are present and the syntax is correct, and then send the updated request. |
401 | Unauthorized | The server refused the request. Ensure that the access token is valid, and then send the updated request. |
403 | Forbidden | The server refused the request. Do not retry the request. |
404 | Not found | The resource cannot be found at the time the request was made. Ensure that the resource ID is correct or the identified issue is fixed, and then send the updated request. |
429 | Too many requests | The number of requests has exceeded the rate limit set for requests per second. Try again later. If you receive this error repeatedly, contact your Instacart representative. |
500 | Internal server error | An issue occurred on the Instacart servers. Retry the request later. |
503 | Service unavailable | The request timed out. Retry the request later. |
200 responses
When you get, create, or update a resource such as an order, the response contains the data associated with the resource. For details about the responses, see the Response section in each endpoint topic.
4xx client-side errors
In general, 4xx errors require a corrective action. Identify and fix the reported issue before you send an updated request.
Foodin Connect has two standard response formats for errors: single error response format and multiple errors response format. For specific details about the possible errors associated with each endpoint, see the Response section in each endpoint topic.
Single error response format
{
"error": {
"message": "User not found",
"code": 1001
},
"meta": {
"key": "user_id"
}
}
Multiple errors response format
{
"error": {
"message": "There were issues with your request",
"code": 9999,
"errors": [
{
"error": {
"message": "can't be blank",
"code": 1001
},
"meta": {
"key": "order.service_option_id"
}
},
{
"error": {
"message": "can't be blank",
"code": 1001
},
"meta": {
"key": "order.address_id"
}
},
{
"error": {
"message": "can't be blank",
"code": 1001
},
"meta": {
"key": "items[0].count"
}
}
]
},
"meta": {}
}
where
- error: message indicates there are multiple errors.
- error: code is an internal error code for the set of errors.
- error: errors is an array of errors in the same format as the single error responses.
- meta might contain other parameters related to the set of errors.
The multiple errors format always has an error: code of 9999.
5xx server-side errors
The Operations team actively monitors and resolves internal server issues. You can retry requests that resulted in 5xx errors. If the problem persists, contact your Instacart representative. An exponential backoff strategy is recommended for retries. Before you implement a retry strategy, discuss your plan with your Instacart Connect representative.
{
"error": {
"message": "Sorry, an unexpected error occurred. Our team has been notified. Please try again later.",
"code": 5000
},
"meta": {}
}
where
- error: message describes the cause of the error.
- error: code is an internal error code identifier.
- meta is empty for server-side issue