O2M Logo
One to Many
Errors
Was this page helpful?

Errors

How a failure looks, what each status means and when to retry.

Overview

O2M uses standard HTTP status codes. Every failure explains itself in a JSON body, and many carry a fixed code your software can act on.

Error format

A failed request answers with a status of 400 or above and a JSON body. message is written for people. code, when present, is stable and safe to use in your code.

Response 422
{
  "message": "No item has SKU GHOST",
  "code": "UNKNOWN_SKU",
  "skus": [
    "GHOST"
  ]
}
FieldTypeDescription
messagestringWhat went wrong. Always present. Do not match on this text: it can change.
codestringA fixed code. Present on the errors listed in these pages.
skusarrayWith UNKNOWN_SKU and NOT_YOUR_SKU: every SKU at fault.
requiredPermissionstringWith a missing permission: what the key lacks.
retryAfterSecondsnumberWith RATE_LIMITED: the seconds to wait.
requestIdstringWith an invalid or oversized body: the request's reference.

A problem in the lines of a request names the line, counting from 1, for example Line 2: sku is required.

Status codes

StatusMeaningRetry?
200It worked.No need
201It worked and something was created.No need
400The body is not valid JSON.Fix it first
401The key is missing or not accepted.Fix it first
403The key may not do this, or the feature is not enabled.Fix it first
404It does not exist, or this key may not see it.Fix it first
409It conflicts with how things stand now, such as cancelling a shipped order.Only after the situation changes
413The request is too large.Make it smaller
422Something in the request is wrong. message says what.Fix it first
429Too many requests.Yes, after Retry-After
500O2M could not finish the request.Yes, with an Idempotency-Key
503O2M could not check the key for a moment.Yes, after a short wait

Common errors

Any endpoint can return these.

StatusCodeMessageWhat to do
400—A description of the JSON problemSend valid JSON.
401NO_API_KEYSend your access key in the X-Access-Key header and your secret key in the X-Secret-Key headerAdd the secret key.
401NO_ACCESS_KEYSend your access key in the X-Access-Key header, beside the secret key. It is shown in Settings → API keys.Add the access key.
401INVALID_API_KEYThis access key and secret key are not valid together, or the key was revoked or has expiredSee why a key stops working.
403COMPANY_INACTIVECompany account is suspended or terminatedContact your O2M account manager.
403MODULE_NOT_ENABLEDThe public API is not enabled for your company by the platform administratorAsk your O2M account manager to enable it.
403—Access denied, with requiredPermissionGive the key that permission by making a new key.
404—Not foundCheck the path. It may be wrong, or the ID malformed.
413—request entity too largeKeep the body under 100 KB. Split large requests.
429RATE_LIMITEDToo many requests: this key may make 120 a minute. Try again in 30 seconds.Wait Retry-After seconds. See Rate limits.
500—Unable to …, naming what failedRetry. If it keeps failing, contact support with the X-Request-Id.
503UNAVAILABLEUnable to verify the API key. Please retry.Retry after a short wait.

A missing permission

requiredPermission names what the key lacks. A key's permissions cannot be changed, so make a new key that includes it. The permissions table shows which box to tick.

Response 403
{
  "error": "Forbidden",
  "message": "Access denied.",
  "requiredPermission": "orders:read"
}

Handle errors in your code

  • Log the status, code, message and the X-Request-Id header of every failure.
  • Retry only 429, 500 and 503, waiting longer each time.
  • Send an Idempotency-Key on creating requests, so a retry can never do the work twice.
  • Look up a failed request in the API logs.