Error referenceError အကိုးအကား

Errors return a JSON body with a stable, append-only code:

Error များသည် တည်ငြိမ်ပြီး append-only ဖြစ်သော code ပါသည့် JSON body ကို ပြန်ပေးသည် —

{ "ok": false, "code": "API_KEY_SCOPE_DENIED", "step": "..." }

code is the contract (never renamed or reused); step is a diagnostic hint only.

code သည် contract ဖြစ်သည် (ဘယ်တော့မှ အမည်ပြောင်း သို့မဟုတ် ပြန်သုံးခြင်း မရှိ)။ step သည် ရောဂါရှာဖွေရန် အရိပ်အမြွက်သာ ဖြစ်သည်။

Authentication & authorization

Authentication နှင့် authorization

HTTPcodemeaning
401API_KEY_INVALIDKey not recognised or malformed
401API_KEY_EXPIREDKey past its validity
401API_KEY_REVOKEDKey (or its app) was revoked
401API_KEY_ENV_MISMATCHlive/test key used in the wrong environment
403API_KEY_SCOPE_DENIEDKey lacks the scope for this operation
401CUSTOMER_TOKEN_INVALIDCustomer bearer failed — expired, revoked, unknown, or minted for a different audience (no further detail, deliberately)
401CUSTOMER_NOT_LINKEDFirst-party session tokens only: the customer is not a member of the key's shop
404NOT_FOUNDOAuth tokens only: resource invisible — not a member OR not consented; the two are deliberately indistinguishable

Business errors by module

Operation-specific codes (e.g. validation, state, not-found). Each operation lists its codes in the module reference.

delivery

EDGE_BAD_BODY EDGE_INVALID_AMOUNT EDGE_ORDER_NOT_FOUND EDGE_REPLAYED EDGE_TRANSPORT_DISABLED EDGE_UNSUPPORTED_CURRENCY

loyalty

EDGE_INSUFFICIENT_POINTS EDGE_INVALID_POINTS EDGE_MEMBER_NOT_FOUND

marketplace

EDGE_INSUFFICIENT_STOCK EDGE_INVALID_LISTING EDGE_INVALID_QTY EDGE_LISTING_NOT_FOUND EDGE_LISTING_UNAVAILABLE EDGE_UNSUPPORTED_CURRENCY

orders

EDGE_BAD_BODY EDGE_EMPTY_ORDER EDGE_FULFILLMENT_NOT_AVAILABLE EDGE_INSUFFICIENT_STOCK EDGE_ORDER_NOT_FOUND EDGE_RESULT_TOO_LARGE EDGE_UNKNOWN_SKU EDGE_UNPRICED_SKU EDGE_WINDOW_TOO_WIDE

rider

EDGE_BAD_STATUS EDGE_ILLEGAL_TRANSITION EDGE_INVALID_JOB EDGE_INVALID_RIDER EDGE_JOB_ALREADY_ASSIGNED EDGE_JOB_NOT_FOUND EDGE_NOT_JOB_OWNER EDGE_PATH_BODY_MISMATCH

Consumer plane — 401 vs 404, and why they differ by token kind

Consumer plane — 401 နှင့် 404 ကွာခြားချက်

On /v1/mobile/*, 401 means the request never named a customer: bad publishable key, or a bearer that is expired, revoked, unknown, or minted for a different audience — all collapse to CUSTOMER_TOKEN_INVALID with no further detail. 404 (OAuth tokens only) means the customer is real but the resource is invisible to your app: they are not a member of the key's shop, or they have not consented (or revoked consent). These are deliberately the same answer — whether a person is a member of a shop is theirs to disclose, so a revoked app cannot use status codes as a membership probe. The fix for an unexpected 404 is to re-run /authorize, which renews consent when consent is what's missing. First-party session tokens (the shop's own app) instead receive 401 CUSTOMER_NOT_LINKED, because a shop's own app may know its own members.

/v1/mobile/* တွင် 401 ဆိုသည်မှာ request က customer ကို မညွှန်းနိုင်ခြင်း — publishable key မှား၊ သို့မဟုတ် bearer သက်တမ်းကုန်/revoke/မသိ/audience မှား — အားလုံး CUSTOMER_TOKEN_INVALID တစ်ခုတည်း ဖြစ်သည်။ 404 (OAuth token သာ) ဆိုသည်မှာ customer အစစ် ဖြစ်သော်လည်း resource ကို သင့် app မမြင်ရ — ဆိုင် member မဟုတ်ခြင်း သို့မဟုတ် consent မပေးထား/ရုပ်သိမ်းထားခြင်း။ ဤနှစ်ခုကို တမင် တူညီစေသည် — ဆိုင် member ဖြစ်မဖြစ်ကို customer ကိုယ်တိုင်သာ ထုတ်ဖော်ခွင့်ရှိသည်။ မမျှော်လင့်သော 404 အတွက် /authorize ကို ပြန်ခေါ်ပါ။ ဆိုင်၏ ကိုယ်ပိုင် app (first-party session token) များသည် 401 CUSTOMER_NOT_LINKED ကိုသာ ရသည် — ကိုယ်ပိုင် app သည် မိမိ member များကို သိခွင့်ရှိသောကြောင့် ဖြစ်သည်။