AuthenticationAuthentication (အထောက်အထားစိစစ်ခြင်း)

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>

Keys

Key များ

Portal access — two ways to sign in

Portal access — sign in ဝင်နိုင်သော နည်းလမ်း နှစ်မျိုး

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 နှစ်မျိုးကို လက်ခံသည် —

First sign-in on a developer account

Developer account ဖြင့် ပထမဆုံး sign in ဝင်ခြင်း

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 ဖြစ်ပြီး သင် မဟုတ်ပါ။

Scope is server-derived

Scope ကို server ဘက်တွင် တွက်ချက်သည်

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 အကိုးအကား ကို ကြည့်ပါ)။

Idempotency

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 အသစ် မဖန်တီးဘဲ မူရင်းရလဒ်ကိုသာ ပြန်ပေးသည်။

Consumer plane — publishable keys

Consumer plane — publishable key များ

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 မဖွင့်ရသေးပါ။

Customer identity — OAuth 2.1 hosted sign-in

Customer identity — OAuth 2.1 hosted sign-in

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 ------------------------|