Empowering Restaurants through Integration

Follow

Common HTML Status Codes

In the API Specification, we haven’t documented every single HTML status code possible, as many of them are common to RESTful APIs. Here are the ones that come up in our APIs and how you can address them.

200 OK

Request completed successfully. This probably returns a JSON response payload in the body.

201 Created

The requested resource was created. This may return a JSON object in the response body.

204 No Content

The request completed successfully, and no JSON object will be returned in the response body intentionally.

400 Bad request

A field, either at the top level or nested within an array, has the wrong data type. For example, passing “abcde” in an integer field. The response body will detail what field is malformed.

403 Forbidden

You do not have access to the requested resource. This may happen if you attempt to access resources for other merchants. Contact Grubhub for more information. Retries will produce the same error code.

404 Not Found

The resource was not found on the server, either because of a typo in the URL or that variable information in the URL (such as a `merchant_id`) does not exist. Do not retry without modifying the request.

409 Conflict

There's some sort of error with the data, either because it's in a transitional state or the current data transition does not exist. You may or may not be able to retry this request.

415 Unsupported media type

Usually indicates that the request indicated the wrong media type in the header. For example, if you send them as XML when the Grubhub API expects JSON. Do not retry without modifying the request.

422 Unprocessable Entity (WebDAV)

This indicates that one or more of the fields passed could not be used. It could mean that a required field is missing, a value is outside the bounds of what’s acceptable, or an array is the wrong size. The response body will detail what needs to be fixed in the request. Do not retry without modifying the request.

429 Too Many Requests

Your API calls have caused too many errors within the past 10 minutes. We will either block the partner_id or merchant from making further calls until you re-open the restaurant. From there, you can retry calls, though you may want to attempt to resolve the source of the errors so you do not get blocked again.

500 Internal Server Error

The server has returned an unexpected error. This could be because the server was unavailable or because your request caused a problem on our end. Depending on the ultimate cause of the error, you may be able to retry the request.