FOMDocs

Customers API

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

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

customer object

FieldTypeရှင်းလင်းချက်
idstring
namestringe.g. Daw Aye Aye
phonestringe.g. 09 9871 2345
townshipstringCan be null.
addressstringCan be null.
archivedboolean
revisionnumberSend as expected_revision when changing it.
created_atstring
updated_atstring

List customers, newest first, or changes since a time

GET /public/v1/customers

Scope: customers: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

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

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

ဥပမာ

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

Add a customer

POST /public/v1/customers

Scope: customers:write

The phone must not belong to another customer in the shop.

Body

FieldTypeမဖြစ်မနေရှင်းလင်းချက်
namestringဟုတ်e.g. Daw Aye Aye
phonestringဟုတ်Finds the existing customer with this phone, or adds one. e.g. 09 9871 2345
townshipstringCan be null. e.g. Hlaing
addressstringCan be null.

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

customer (customer object).

ဥပမာ

curl -X POST "https://api.getfom.com/public/v1/customers" \
  -H "Authorization: Bearer $FOM_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "name": "Daw Aye Aye",
    "phone": "09 9871 2345",
    "township": "Hlaing"
  }'

One customer

GET /public/v1/customers/{customerId}

Scope: customers:read

Path parameter များ

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

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

customer (customer object).

ဥပမာ

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

Change a customer's name, phone or address

PATCH /public/v1/customers/{customerId}

Scope: customers:write

Path parameter များ

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

Body

FieldTypeမဖြစ်မနေရှင်းလင်းချက်
namestring
phonestring
townshipstringCan be null.
addressstringCan be null.
expected_revisionnumber

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

customer (customer object).

ဥပမာ

curl -X PATCH "https://api.getfom.com/public/v1/customers/CUSTOMER_ID" \
  -H "Authorization: Bearer $FOM_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "address": "No. 12, Baho Road"
  }'

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