Customers API
Customers endpoint အားလုံး၊ ၎င်းတို့ရဲ့ field များနဲ့ ဥပမာ။
FOM ရဲ့ OpenAPI document ကနေ ထုတ်ထားပါတယ်။ Field ရှင်းလင်းချက်တွေက အင်္ဂလိပ်လို ဖြစ်ပါတယ်။ Request တိုင်းမှာ API key လိုပါတယ်၊ Authentication ကို ကြည့်ပါ။
customer object
| Field | Type | ရှင်းလင်းချက် |
|---|---|---|
id | string | |
name | string | e.g. Daw Aye Aye |
phone | string | e.g. 09 9871 2345 |
township | string | Can be null. |
address | string | Can be null. |
archived | boolean | |
revision | number | Send as expected_revision when changing it. |
created_at | string | |
updated_at | string |
List customers, newest first, or changes since a time
GET /public/v1/customersScope: customers:read
Query parameter များ
| Field | Type | မဖြစ်မနေ | ရှင်းလင်းချက် |
|---|---|---|---|
limit | number | Default 50. 1–100. | |
cursor | string | The next_cursor from the previous page. | |
updated_since | string | Only 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/customersScope: customers:write
The phone must not belong to another customer in the shop.
Body
| Field | Type | မဖြစ်မနေ | ရှင်းလင်းချက် |
|---|---|---|---|
name | string | ဟုတ် | e.g. Daw Aye Aye |
phone | string | ဟုတ် | Finds the existing customer with this phone, or adds one. e.g. 09 9871 2345 |
township | string | Can be null. e.g. Hlaing | |
address | string | Can 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 များ
| Field | Type | မဖြစ်မနေ | ရှင်းလင်းချက် |
|---|---|---|---|
customerId | string | ဟုတ် |
ပြန်ရမယ့်အရာ
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 များ
| Field | Type | မဖြစ်မနေ | ရှင်းလင်းချက် |
|---|---|---|---|
customerId | string | ဟုတ် |
Body
| Field | Type | မဖြစ်မနေ | ရှင်းလင်းချက် |
|---|---|---|---|
name | string | ||
phone | string | ||
township | string | Can be null. | |
address | string | Can be null. | |
expected_revision | number |
ပြန်ရမယ့်အရာ
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"
}'