Merchant integrations authenticate with a merchant API key as a bearer token (a shop's own consumer app uses the consumer plane instead):
Merchant integration များ သည် merchant API key ကို bearer token အဖြစ် အသုံးပြု၍ authenticate လုပ်သည် (ဆိုင်၏ ကိုယ်ပိုင် consumer app သည် consumer plane ကို အသုံးပြုသည်) —
Authorization: Bearer sk_live_<keyid>_<secret>
sk_<env>_<keyid>_<secret> — env is live or test.live and test keys are disjoint; a key works only in its own environment.sk_<env>_<keyid>_<secret> — env သည် live သို့မဟုတ် test။live နှင့် test key များ သီးခြားဖြစ်သည်။ key တစ်ခုသည် ၎င်း၏ environment ထဲတွင်သာ အလုပ်လုပ်သည်။You do not need the merchant's POS password to manage that shop's API keys. The portal accepts two separate identities:
ဆိုင်၏ API key များကို စီမံရန် merchant ၏ POS စကားဝှက် မလိုအပ်ပါ။ portal သည် သီးခြား identity နှစ်မျိုးကို လက်ခံသည် —
A developer account sees only its own shop's applications and keys — the shop is derived from the account server-side, exactly as it is from a key. To request one, ask the merchant to contact DOEH; the merchant authorises it, not you.
Developer account တစ်ခုသည် မိမိဆိုင်၏ application နှင့် key များကိုသာ မြင်ရသည် — key မှ တွက်ယူသကဲ့သို့ ဆိုင်ကို account မှ server ဘက်တွင် တွက်ယူသည်။ တောင်းခံလိုလျှင် merchant အား DOEH သို့ ဆက်သွယ်ခိုင်းပါ — ခွင့်ပြုသူမှာ merchant ဖြစ်ပြီး သင် မဟုတ်ပါ။
Clients send only the bearer token. The shop and branch a key may act on are derived
server-side from the key — you never send X-Shop-Id or X-Branch-Id. A request is
allowed only if the operation's required scope is within the key's effective scope and the target
branch is within the key's branch policy; otherwise it is refused (see the
error reference).
Client များသည် bearer token တစ်ခုတည်း ကိုသာ ပို့သည်။ key တစ်ခု ဆောင်ရွက်နိုင်သော ဆိုင်နှင့် branch ကို
key မှ server ဘက်တွင် တွက်ချက်သည် — X-Shop-Id သို့မဟုတ် X-Branch-Id ကို ဘယ်တော့မှ မပို့ရပါ။ operation ၏
လိုအပ်သော scope သည် key ၏ scope အတွင်း ရှိ၍ နှင့် ပစ်မှတ် branch သည် key ၏ branch policy အတွင်း ရှိမှသာ request ကို
ခွင့်ပြုသည်။ မဟုတ်လျှင် ငြင်းပယ်သည် (error အကိုးအကား ကို ကြည့်ပါ)။
Supply an Idempotency-Key header on POSTs; a retry with the same key returns the
original result instead of creating a duplicate.
POST များတွင် Idempotency-Key header ထည့်ပါ။ key တူဖြင့် ပြန်လည်ကြိုးစားလျှင် ထပ်နေသော
record အသစ် မဖန်တီးဘဲ မူရင်းရလဒ်ကိုသာ ပြန်ပေးသည်။
A shop's own customer-facing app authenticates differently: a
publishable key (pk_test_… / pk_live_…) sent as
X-Publishable-Key, plus the signed-in customer's bearer token on each request. The
publishable key is safe to embed in the app build — it grants nothing by itself, and the shop it may act
for is derived server-side from the key. The two kinds are strictly separated: a
pk_ is never accepted where a sk_ is required, and vice versa. See the
Consumer Mobile API reference and the
@beyondplusmm/doeh-consumer-sdk section of the SDK quickstart.
Sandbox only for now — the production consumer plane is not yet enabled.
ဆိုင်၏ ကိုယ်ပိုင် customer-facing app သည် ကွဲပြားစွာ authenticate လုပ်သည် —
publishable key (pk_test_… / pk_live_…) ကို X-Publishable-Key
အဖြစ် ပို့ပြီး request တိုင်းတွင် sign in ဝင်ထားသော customer ၏ bearer token ပါ ထည့်သည်။ publishable key ကို
app build ထဲ ထည့်ရန် စိတ်ချရသည် — key တစ်ခုတည်းဖြင့် ဘာမှ လုပ်၍မရပါ၊ ၎င်း ဆောင်ရွက်နိုင်သော ဆိုင်ကို key မှ
server ဘက်တွင် တွက်ယူသည်။ key အမျိုးအစား နှစ်ခုကို တင်းကြပ်စွာ ခွဲခြားထားသည် — sk_ လိုအပ်သော
နေရာတွင် pk_ ကို ဘယ်တော့မှ လက်မခံပါ၊ ပြောင်းပြန်လည်း ထိုနည်းတူ။ Consumer Mobile API
အကိုးအကား နှင့် SDK quickstart ၏ @beyondplusmm/doeh-consumer-sdk အပိုင်းကို ကြည့်ပါ။
ယခုအချိန်တွင် sandbox သာ — production consumer plane မဖွင့်ရသေးပါ။
The customer bearer token comes from the DOEH Identity Platform:
OAuth 2.1 authorization-code + PKCE (S256 only) with hosted login and
consent — the customer signs in on a DOEH page, your app never sees or collects their
credentials. Discovery: https://auth.doehpos.com/.well-known/openid-configuration.
Customer bearer token ကို DOEH Identity Platform မှ ထုတ်ပေးသည် —
OAuth 2.1 authorization-code + PKCE (S256 သာ) ဖြင့် hosted login နှင့်
consent — customer သည် DOEH ၏ page တွင် sign in ဝင်သည်။ သင့် app သည် သူတို့၏
စကားဝှက်ကို ဘယ်တော့မှ မမြင်ရ၊ မသိမ်းရပါ။ Discovery —
https://auth.doehpos.com/.well-known/openid-configuration။
your app auth.doehpos.com api.doehpos.com
| | |
|-- GET /authorize + PKCE -------->| |
| |-- hosted login (OTP) |
| |-- consent screen |
|<-- redirect: code ---------------| |
|-- POST /token (code+verifier) -->| |
|<-- dat_ access + drt_ refresh ---| |
| | |
|-- X-Publishable-Key: pk_... + Authorization: Bearer dat_... ----->|
|<-- the customer's data, scoped to your grant ------------------------|
dat_…) and short-lived: access 10 minutes;
the refresh token is one-time-use and rotates on every refresh — reusing an old one revokes
the whole family. Refresh lifetime: 30 days idle, 90 days absolute; after that the customer signs in again.CUSTOMER_TOKEN_INVALID, with no further detail.404 NOT_FOUND, and "not a member" and "not consented" are deliberately the same answer (a
revoked app must not be able to probe shop membership). If you get an unexpected 404, send the customer
through /authorize again — it renews consent when consent is what's missing.dat_…) ဖြစ်ပြီး သက်တမ်းတို — access ၁၀ မိနစ်။
refresh token သည် တစ်ကြိမ်သုံး ဖြစ်ပြီး refresh တိုင်းတွင် အသစ်လဲသည် — အဟောင်းကို ပြန်သုံးလျှင်
family တစ်ခုလုံး revoke ဖြစ်သည်။ refresh သက်တမ်း — အသုံးမပြုလျှင် ရက် ၃၀၊ အများဆုံး ရက် ၉၀။ ထို့နောက် customer
ပြန် sign in ဝင်ရသည်။CUSTOMER_TOKEN_INVALID ဖြင့် ငြင်းပယ်သည်။ အသေးစိတ် အကြောင်းပြချက် မပေးပါ။404 NOT_FOUND ပြန်ရသည်။ "member မဟုတ်" နှင့် "consent မပေးထား" ကို တမင် တူညီသော အဖြေ
ထားသည် (revoke ခံရသော app သည် ဆိုင် member ဖြစ်မဖြစ် စုံစမ်း၍ မရစေရ)။ မမျှော်လင့်သော 404 ရလျှင်
customer ကို /authorize သို့ ပြန်ပို့ပါ — consent လိုနေလျှင် ၎င်းက အသစ်ပြန်ရယူပေးသည်။