Errors
A v2 error answers an HTTP status and a google.rpc.Status body. The body’s code is a
gRPC status code, not the HTTP status, and message says what went wrong. Branch on the
HTTP status, and log message for anything you don’t handle automatically. v1 errors use
different bodies and a few different status meanings; see the aside at the end.
The v2 body
Section titled “The v2 body”{ "code": 7, "message": "missing required scope \"inventory:self\"", "details": []}codeis an integer gRPC code. The table below maps each one to its HTTP status.messageis a human-readable string. Don’t match on its exact wording.detailsis an array of typed objects, each carrying an@type. It is often empty.
Status codes
Section titled “Status codes”| HTTP | code |
When |
|---|---|---|
400 |
3 |
An argument failed validation, such as a malformed timestamp or a cursor the route can’t read. |
401 |
16 |
The request carried no token. |
403 |
7 |
The token is valid but lacks the scope the service needs, is not bound to an integration, or its integration is inactive. |
404 |
5 |
The thing addressed, or the route itself, does not exist. |
429 |
8 |
Resource exhausted, such as a rate limit. See Throttle limits. |
500 |
13 |
An unhandled error on our side. Code 2 (unknown) also answers 500. |
503 |
14 |
A service the call depends on is unavailable. Transient. |
Scope failures are the common 403. The scoped services name the missing scope in
message, as in the example above. See Scopes. Nothing else in the
error body tells the three causes apart, so the two rarer ones are the place to read
message:
- No integration. The token resolves but isn’t bound to any integration, and
messagesays so. - Inactive integration. The integration was switched off in Zentail.
messagesays the integration is inactive. For a signal you can match on, call the status route of the API that refused you:GET /v2/inventory/statusorGET /v2/shipping/status. Both still answer, and theirintegration_activecheck fails.
Only the inventory and shipping routes answer an inactive integration with this 403. They
refuse it here:
- Inventory:
GET /v2/inventory,POST /v2/inventoryandGET /v2/inventory/warehouses. - Shipping: only
POST /v2/shipping/fulfillment_orders/acknowledge. Every other shipping route keeps working: you can still ship orders, reject them, confirm the cancellations Zentail asks for, and raise alerts. Because you can’t acknowledge, a cancellation of an order you haven’t acknowledged never reaches you. Before you ship such an order, check that it is still inneed_to_ship.
Your code can’t clear this 403, and retrying won’t help. Stop making the refused calls
with that token, and ask the seller to contact Zentail support at [email protected].
Support can reactivate the integration. The same token then works again, with no new
authorization needed. Keep polling the status route, and resume the refused calls once its
integration_active check passes.
What to retry
Section titled “What to retry”- Retry with backoff:
429and503. Both are transient. - Do not retry unchanged:
400,401,403and404. The request or the credential has to change first. The one exception is the inactive-integration403: the same token works again once support reactivates the integration, so resume when the status route’sintegration_activecheck passes. - Retry once, then escalate:
500. If it repeats, send us the time, the route and themessage.
API changelog · Built f1d143e6