FOMDocs

Orders API

Orders endpoint အားလုံး၊ ၎င်းတို့ရဲ့ field များနဲ့ ဥပမာ။

FOM ရဲ့ OpenAPI document ကနေ ထုတ်ထားပါတယ်။ Field ရှင်းလင်းချက်တွေက အင်္ဂလိပ်လို ဖြစ်ပါတယ်။ Request တိုင်းမှာ API key လိုပါတယ်၊ Authentication ကို ကြည့်ပါ။

order object

FieldTypeရှင်းလင်းချက်
idstring
order_nostringe.g. ORD-0319
statusnew, confirmed, out_for_delivery, delivered, cancelled
payment_methodunknown, cod, prepaid, kbzpay, wavepay, other
payment_statusunpaid, paid, refunded
paid_atstringCan be null.
currencystringe.g. MMK
subtotalnumbere.g. 20000
delivery_feenumbere.g. 2000
totalnumbere.g. 22000
notestringCan be null.
sourcestringe.g. manual
tracking_urlstringThe customer's tracking page. Can be null.
customerobject
customer.idstring
customer.namestringe.g. Daw Aye Aye
customer.phonestringe.g. 09 9871 2345
customer.townshipstringCan be null.
customer.addressstringCan be null.
itemsarray of objects
items[].idstring
items[].product_idstringCan be null.
items[].variant_idstringCan be null.
items[].namestringe.g. Cotton T-shirt (Red / M)
items[].qtynumbere.g. 2
items[].unit_pricenumbere.g. 12000
items[].line_totalnumbere.g. 24000
deliveryobjectCan be null.
delivery.idstring
delivery.statusscheduled, out_for_delivery, delivered
delivery.scheduled_atstringCan be null.
delivery.delivered_atstringCan be null.
revisionnumberSend as expected_revision when changing it.
created_atstring
updated_atstring

List orders, newest first, or changes since a time

GET /public/v1/orders

Scope: orders:read

Query parameter များ

FieldTypeမဖြစ်မနေရှင်းလင်းချက်
limitnumberDefault 50. 1–100.
cursorstringThe next_cursor from the previous page.
updated_sincestringOnly records changed at or after this time, oldest change first. Keep the last updated_at you saw and ask from there to sync. e.g. 2026-11-25T08:00:00.000Z
statusnew, confirmed, out_for_delivery, delivered, cancelled
customer_idstring

ပြန်ရမယ့်အရာ

order object များ တစ်မျက်နှာ (order object).

ဥပမာ

curl "https://api.getfom.com/public/v1/orders?limit=50&updated_since=2026-11-25T08%3A00%3A00.000Z" \
  -H "Authorization: Bearer $FOM_API_KEY"

Create an order

POST /public/v1/orders

Scope: orders:write

Give a customer_id, or a customer with a phone: an existing customer with that phone is used. Items with a variant_id take its name and price unless you send them. Stock is taken when the order is confirmed.

Body

FieldTypeမဖြစ်မနေရှင်းလင်းချက်
customer_idstringAn existing customer.
customerobject
customer.namestringဟုတ်e.g. Daw Aye Aye
customer.phonestringဟုတ်Finds the existing customer with this phone, or adds one. e.g. 09 9871 2345
customer.townshipstringCan be null. e.g. Hlaing
customer.addressstringCan be null.
itemsarray of objectsဟုတ်
items[].variant_idstringA product variant. Its name and price are used when you leave them out.
items[].namestringNeeded when there is no variant_id. e.g. T-shirt (Red, M)
items[].qtynumberဟုတ်At least 1. e.g. 2
items[].unit_pricenumberPrice for one; the variant's price when left out. At least 0. e.g. 12000
payment_methodunknown, cod, prepaid, kbzpay, wavepay, otherDefault "cod".
delivery_feenumberAt least 0. e.g. 3000
notestringCan be null.
statusnew, confirmedDefault "new".

ပြန်ရမယ့်အရာ

order (order object).

ဥပမာ

curl -X POST "https://api.getfom.com/public/v1/orders" \
  -H "Authorization: Bearer $FOM_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "customer": {
      "name": "Daw Aye Aye",
      "phone": "09 9871 2345",
      "township": "Hlaing"
    },
    "items": [
      {
        "name": "T-shirt (Red, M)",
        "qty": 2,
        "unit_price": 12000
      }
    ],
    "delivery_fee": 3000
  }'

One order with its items, customer and delivery

GET /public/v1/orders/{orderId}

Scope: orders:read

Path parameter များ

FieldTypeမဖြစ်မနေရှင်းလင်းချက်
orderIdstringဟုတ်

ပြန်ရမယ့်အရာ

order (order object).

ဥပမာ

curl "https://api.getfom.com/public/v1/orders/ORDER_ID" \
  -H "Authorization: Bearer $FOM_API_KEY"

Change an order's status

POST /public/v1/orders/{orderId}/status

Scope: orders:write

Moves stock, deliveries and customer messages the same way as in FOM. Send expected_revision to be sure nobody changed the order since you read it.

Path parameter များ

FieldTypeမဖြစ်မနေရှင်းလင်းချက်
orderIdstringဟုတ်

Body

FieldTypeမဖြစ်မနေရှင်းလင်းချက်
statusnew, confirmed, out_for_delivery, delivered, cancelledဟုတ်
notestringCan be null.
expected_revisionnumberThe order revision you last saw; the change is refused if someone changed it since.

ပြန်ရမယ့်အရာ

order (order object).

ဥပမာ

curl -X POST "https://api.getfom.com/public/v1/orders/ORDER_ID/status" \
  -H "Authorization: Bearer $FOM_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "status": "confirmed",
    "expected_revision": 3
  }'

ဤစာမျက်နှာတွင်