Orders · sales submission· အရောင်းတင်သွင်းခြင်း

Experimental. The orders capability is rolling out. The contract below is stable; the typed SDK surface ships ahead of general availability so you can build against it.
စမ်းသပ်ဆဲ။ orders စွမ်းဆောင်ရည်ကို ဖြန့်ချိနေဆဲ ဖြစ်သည်။ အောက်ပါ contract သည် တည်ငြိမ်ပြီး၊ typed SDK မျက်နှာစာကို အများသုံးမဖြစ်မီ ကြိုတင်ထုတ်ပေးထားသဖြင့် သင် ယခုပင် တည်ဆောက်နိုင်သည်။

Submit a basket and DOEH returns a fully priced order. You send only { sku, qty } — never prices, taxes, or totals. The server resolves pricing, tax, discounts, loyalty and inventory, and is the source of truth for the order.

basket တစ်ခု တင်သွင်းလျှင် DOEH က စျေးနှုန်းပြည့်စုံသော order ကို ပြန်ပေးသည်။ သင်သည် သာ { sku, qty } ကို ပို့သည် — စျေးနှုန်း၊ အခွန် သို့မဟုတ် စုစုပေါင်းကို ဘယ်တော့မှ မပို့ပါ။ server က စျေးနှုန်း၊ အခွန်၊ လျှော့စျေး၊ loyalty နှင့် inventory ကို တွက်ချက်ပြီး order ၏ source of truth ဖြစ်သည်။

Request

Request

POST /v1/orders
Authorization: Bearer sk_live_<keyid>_<secret>
Idempotency-Key: <uuid>

{
  "lines": [
    {
      "sku": "BURGER001",
      "qty": 2
    },
    {
      "sku": "COLA001",
      "qty": 1
    }
  ]
}

Response · 201 Created

The server returns the fully resolved order — priced lines and totals in minor units:

server က ဖြေရှင်းပြီးသား order အပြည့်အစုံကို ပြန်ပေးသည် — minor unit ဖြင့် စျေးနှုန်းတပ်ထားသော line များနှင့် စုစုပေါင်းများ —

{
  "ok": true,
  "order": {
    "id": "ord_1c8494e9feeea2c7",
    "status": "pending",
    "payment_status": "unpaid",
    "shop_id": 1,
    "branch_id": 1,
    "lines": [
      {
        "sku": "BURGER001",
        "name": "Classic Burger",
        "qty": 2,
        "unit_price_minor": 3500,
        "line_total_minor": 7000,
        "tax_minor": 0
      },
      {
        "sku": "COLA001",
        "name": "Cola",
        "qty": 1,
        "unit_price_minor": 1200,
        "line_total_minor": 1200,
        "tax_minor": 0
      }
    ],
    "totals": {
      "currency": "MMK",
      "subtotal_minor": 8200,
      "discount_minor": 0,
      "tax_minor": 0,
      "grand_total_minor": 8200
    },
    "created_at_utc": "2026-06-21T08:30:00Z",
    "created_at_local": "2026-06-21T15:00:00+06:30"
  }
}

How it works

အလုပ်လုပ်ပုံ

/v1/orders crosses two boundaries. The edge authenticates your key and checks request structure — it holds no order state and makes no pricing or business decisions. The core owns the order: it validates the basket, resolves price/tax/inventory, and returns the result.

/v1/orders သည် နယ်နိမိတ် နှစ်ခု ဖြတ်ကျော်သည်။ edge က သင့် key ကို authenticate လုပ်ပြီး request ၏ ဖွဲ့စည်းပုံ ကို စစ်ဆေးသည် — order state မထား၊ စျေးနှုန်း သို့မဟုတ် business ဆုံးဖြတ်ချက် မလုပ်ပါ။ core က order ကို ပိုင်သည် — basket ကို စစ်ဆေး၊ price/tax/inventory ကို တွက်ချက်ပြီး ရလဒ်ကို ပြန်ပေးသည်။

Invariantမပြောင်းလဲသော စည်းမျဉ်း
Edge = structure  ·  Core = truth

Your app — POST /v1/orders (Bearer sk_…)

↓

Edge — structural validation (auth + shape)

Edge — ဖွဲ့စည်းပုံ စိစစ်ခြင်း (auth + shape)

↓

Core — semantic validation (business truth)

Core — အဓိပ္ပါယ် စိစစ်ခြင်း (business truth)

Error semantics

Error ၏ အဓိပ္ပါယ်

The only EDGE_-prefixed code is the edge-owned structural failure (EDGE_BAD_BODY). Business failures surface as typed errors you catch — EmptyOrderError, UnknownSkuError, InsufficientStockError — not string-matched codes. Wire codes say where a failure was detected; typed errors say what failed. See the error reference.

EDGE_ ရှေ့ဆက်ပါသော code တစ်ခုတည်းမှာ edge ပိုင် ဖွဲ့စည်းပုံ ချို့ယွင်းချက် (EDGE_BAD_BODY) ဖြစ်သည်။ business ချို့ယွင်းချက်များသည် သင် catch လုပ်နိုင်သော typed error အဖြစ် ပေါ်လာသည် — EmptyOrderError၊ UnknownSkuError၊ InsufficientStockError — string ကိုက်ညှိသော code မဟုတ်ပါ။ wire code က ချို့ယွင်းချက်ကို ဘယ်နေရာ တွေ့ကြောင်း ပြောပြီး typed error က ဘာ ချို့ယွင်းကြောင်း ပြောသည်။ error အကိုးအကား ကို ကြည့်ပါ။

Contract

The OpenAPI specification is the authoritative machine contract; this page is the human reasoning model. If the two ever differ, OpenAPI governs the wire and this page governs intent. Money is always an integer in minor units; a submission expresses purchase intent, not settlement.

OpenAPI specification သည် တရားဝင် machine contract ဖြစ်ပြီး ဤစာမျက်နှာသည် လူသား နားလည်ရန် ပုံစံ ဖြစ်သည်။ နှစ်ခု ကွဲလွဲပါက OpenAPI က wire ကို အုပ်ချုပ်ပြီး ဤစာမျက်နှာက ရည်ရွယ်ချက်ကို အုပ်ချုပ်သည်။ ငွေသည် အမြဲတမ်း minor unit ဖြင့် integer ဖြစ်သည်။ တင်သွင်းမှုသည် ဝယ်ယူရန် ရည်ရွယ်ချက်ကို ဖော်ပြခြင်းဖြစ်ပြီး ငွေရှင်းခြင်း မဟုတ်ပါ။