Products API
Products endpoint အားလုံး၊ ၎င်းတို့ရဲ့ field များနဲ့ ဥပမာ။
FOM ရဲ့ OpenAPI document ကနေ ထုတ်ထားပါတယ်။ Field ရှင်းလင်းချက်တွေက အင်္ဂလိပ်လို ဖြစ်ပါတယ်။ Request တိုင်းမှာ API key လိုပါတယ်၊ Authentication ကို ကြည့်ပါ။
product object
| Field | Type | ရှင်းလင်းချက် |
|---|---|---|
id | string | |
name | string | e.g. Cotton T-shirt |
description | string | Can be null. |
option_names | array of string | |
on_shop_page | boolean | Listed on the public shop page. |
archived | boolean | |
variants | array of objects | |
variants[].id | string | |
variants[].option_values | array of string | |
variants[].label | string | e.g. Red / M |
variants[].sku | string | Can be null. |
variants[].price | number | e.g. 12000 |
variants[].track_stock | boolean | |
variants[].stock_qty | number | null when stock is not tracked. Can be null. |
variants[].low_stock_at | number | Can be null. |
variants[].low_stock | boolean | At or below its low-stock level. |
variants[].updated_at | string | |
revision | number | |
created_at | string | |
updated_at | string | The latest change to the product or any variant, stock included. |
List products with variants and stock
GET /public/v1/productsScope: products:read
With updated_since, a product counts as changed when it or any of its variants (including stock) changed.
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 |
ပြန်ရမယ့်အရာ
product object များ တစ်မျက်နှာ (product object).
ဥပမာ
curl "https://api.getfom.com/public/v1/products?limit=50&updated_since=2026-11-25T08%3A00%3A00.000Z" \
-H "Authorization: Bearer $FOM_API_KEY"Add a product with its variants
POST /public/v1/productsScope: products:write
Body
| Field | Type | မဖြစ်မနေ | ရှင်းလင်းချက် |
|---|---|---|---|
name | string | ဟုတ် | e.g. Cotton T-shirt |
description | string | Can be null. | |
option_names | array of string | ||
on_shop_page | boolean | Default true. | |
variants | array of objects | ဟုတ် | |
variants[].id | string | An existing variant when updating; leave out to add one. | |
variants[].option_values | array of string | ||
variants[].sku | string | Can be null. | |
variants[].price | number | ဟုတ် | At least 0. e.g. 12000 |
variants[].track_stock | boolean | Default true. | |
variants[].stock_qty | number | Starting stock for a new variant; change it later with the stock endpoint. | |
variants[].low_stock_at | number | Can be null. |
ပြန်ရမယ့်အရာ
product (product object).
ဥပမာ
curl -X POST "https://api.getfom.com/public/v1/products" \
-H "Authorization: Bearer $FOM_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"name": "Cotton T-shirt",
"option_names": [
"Colour",
"Size"
],
"variants": [
{
"option_values": [
"Red",
"M"
],
"price": 12000
}
]
}'One product with its variants and stock
GET /public/v1/products/{productId}Scope: products:read
Path parameter များ
| Field | Type | မဖြစ်မနေ | ရှင်းလင်းချက် |
|---|---|---|---|
productId | string | ဟုတ် |
ပြန်ရမယ့်အရာ
product (product object).
ဥပမာ
curl "https://api.getfom.com/public/v1/products/PRODUCT_ID" \
-H "Authorization: Bearer $FOM_API_KEY"Change a product
PATCH /public/v1/products/{productId}Scope: products:write
Send variants to replace the list: give id for ones to keep; ones left out are archived. Change stock with the stock endpoint.
Path parameter များ
| Field | Type | မဖြစ်မနေ | ရှင်းလင်းချက် |
|---|---|---|---|
productId | string | ဟုတ် |
Body
| Field | Type | မဖြစ်မနေ | ရှင်းလင်းချက် |
|---|---|---|---|
name | string | ||
description | string | Can be null. | |
option_names | array of string | ||
on_shop_page | boolean | ||
variants | array of objects | The full list of variants; ones left out are archived. | |
variants[].id | string | An existing variant when updating; leave out to add one. | |
variants[].option_values | array of string | ||
variants[].sku | string | Can be null. | |
variants[].price | number | ဟုတ် | At least 0. e.g. 12000 |
variants[].track_stock | boolean | Default true. | |
variants[].stock_qty | number | Starting stock for a new variant; change it later with the stock endpoint. | |
variants[].low_stock_at | number | Can be null. | |
expected_revision | number |
ပြန်ရမယ့်အရာ
product (product object).
ဥပမာ
curl -X PATCH "https://api.getfom.com/public/v1/products/PRODUCT_ID" \
-H "Authorization: Bearer $FOM_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"name": "Cotton T-shirt",
"on_shop_page": true
}'Change a variant's stock
POST /public/v1/variants/{variantId}/stockScope: stock:write
Send delta to add or remove, or set after a stock count. Recorded in the stock history.
Path parameter များ
| Field | Type | မဖြစ်မနေ | ရှင်းလင်းချက် |
|---|---|---|---|
variantId | string | ဟုတ် |
Body
| Field | Type | မဖြစ်မနေ | ရှင်းလင်းချက် |
|---|---|---|---|
delta | number | Add (or remove, if negative) this many. e.g. 5 | |
set | number | Set stock to this count. e.g. 12 | |
reason | manual_adjust, restock, stock_count | Default "manual_adjust". | |
note | string | Can be null. |
ပြန်ရမယ့်အရာ
product (product object).
ဥပမာ
curl -X POST "https://api.getfom.com/public/v1/variants/VARIANT_ID/stock" \
-H "Authorization: Bearer $FOM_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"delta": -2,
"reason": "manual_adjust",
"note": "Sold at the market"
}'