Errors - Grasshopper Labs API
Reference

Errors

Every error response follows the same shape. Here's how to interpret them.

Error response format

{
  "error": {
    "code": "invalid_service_level",
    "message": "The service_level \"foo\" is not valid. See /api/reference/service-levels/.",
    "field": "service_level",
    "request_id": "req_5fa178c2083189b168663201"
  }
}

HTTP status codes

CodeMeaningWhen you see it
200OKSuccessful GET / PATCH
201CreatedSuccessful POST that created a resource
204No ContentSuccessful DELETE or no-content update
400Bad RequestInvalid JSON, missing required fields, schema violation
401UnauthorizedMissing, invalid, or expired token
403ForbiddenValid token but insufficient scope or attempting cross-shipper access
404Not FoundResource ID does not exist or is not in your scope
409ConflictResource state prevents the operation (e.g. cancelling a delivered order)
422Unprocessable EntityValid JSON but business-rule violation (e.g. invalid service_level)
429Too Many RequestsRate limit exceeded. See Rate Limits.
500Internal Server ErrorUnexpected server-side failure. Safe to retry with backoff.
502Bad GatewayTransient upstream issue. Retry with backoff.
503Service UnavailableMaintenance or overload. Retry with backoff.

Common error codes

error.codeHTTPMeaning
invalid_credentials401Email/password incorrect on token request
token_expired401Use refresh_token to get a new access token
token_revoked401Token has been revoked. Re-authenticate.
missing_required_field400A required field was omitted. See error.field.
invalid_service_level422Service level code not recognized
invalid_zip422ZIP code not in coverage area
order_not_found404The order ID does not exist in your scope
order_already_cancelled409Cannot modify a cancelled order
rate_limit_exceeded429Too many requests. Back off and retry.

Retry strategy

  • Retry: 429, 500, 502, 503, 504 — use exponential backoff with jitter, max 5 attempts
  • Don't retry: 400, 401, 403, 404, 409, 422 — the request itself is the problem
  • Use the request_id when contacting support. It's the fastest way to look up what happened.