Error codes and retry guidance

API Error codes Retry HTTP status
Who this article is for
For developers implementing API error handling and retry logic.

Structure of an error response

{
  "error": {
    "code": "invalid_parameter",
    "message": "store_id is required",
    "param": "store_id",
    "request_id": "req_01HV6N..."
  }
}

request_id is required when contacting support. Always include it in your error logs.

HTTP status codes

Code Meaning Retry
200 OKSuccess
201 CreatedCreated successfully
204 No ContentSuccess (no body)
400 Bad RequestInvalid parameterNo (fix needed)
401 UnauthorizedAuthentication failedOnce, after refreshing the token
403 ForbiddenInsufficient permission / scopeNo
404 Not FoundResource does not existNo
409 ConflictState conflictDepends on the situation
410 GoneDiscontinuedNo
422 UnprocessableValidation errorNo
429 Too Many RequestsRate limitedAfter Retry-After
500 Internal ErrorServer errorWith exponential backoff
502 Bad GatewayUpstream errorWith exponential backoff
503 Service UnavailableTemporarily unavailableWith exponential backoff
504 Gateway TimeoutTimeoutWith exponential backoff

Main error codes

code What to do
invalid_parameterCheck the value of the param field
missing_parameterAdd the required parameter
invalid_tokenRefresh the token
expired_tokenRefresh with the refresh token
insufficient_scopeAdd the required scope and re-authorize
app_not_approvedReview application for the User-scope is needed
resource_not_foundCheck the ID exists
duplicate_resourceUpdate the existing resource or create with a different ID
rate_limitedWait Retry-After seconds
plan_limit_exceededUpgrade the plan

Retry guidance

Conditions safe to retry

  • HTTP status is 429 or 5xx
  • Network timeout / connection error
  • For POST, always set an Idempotency-Key (to prevent duplicate creation)

Retry interval (exponential backoff + jitter)

function retryDelay(attempt) {
  // 1, 2, 4, 8, 16 seconds (max 32)
  const base = Math.min(Math.pow(2, attempt), 32);
  // ±25% jitter to avoid a thundering herd
  const jitter = base * (Math.random() * 0.5 - 0.25);
  return (base + jitter) * 1000;
}

Maximum retry counts

  • Regular API: up to 5 times
  • Batch processing: up to 10 times
  • Triggered by user action: up to 2 times (don't keep them waiting)

For 429, prioritize the Retry-After header

HTTP/1.1 429 Too Many Requests
Retry-After: 30

→ Wait 30 seconds, then retry

Cases you must not retry

  • 4xx (except 429): there is a problem with the request itself, so retrying gives the same result
  • POST/PUT without an Idempotency-Key: risk of duplicate creation

Related guides

Published: 2026-04-27 Updated: 2026-07-05
このトピックについて
開発者API
機能の詳細を見る
Tags
API (22) OAuth (15) Android (10) iOS (9) Webhook (6) Troubleshooting (5) api (5) App registration (4) POS Integration (4) Reference (4)
Related articles