/shops/{SHOP_ID}/warehousesWarehouse listPOST/shops/{SHOP_ID}/warehousesCreate warehousePUT/shops/{SHOP_ID}/warehouses/{WAREHOUSE_ID}Update warehouseGET/shops/{SHOP_ID}/inventory_historiesInventory historiesWarehouse list
/shops/{SHOP_ID}/warehousesGet list of warehouses
Path parameters
SHOP_IDintegerrequiredShop ID
Responses
dataarray<Warehouse>List of warehouses
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/warehouses?api_key=API_KEY"{
"data": [
{
"id": "b4cb5897-6e56-4581-96cc-2f12677c7bd8",
"name": "kho test ecod",
"address": "hâhhha",
"full_address": "hâhhha, Xã Bình Trung, Huyện Châu Đức, Bà Rịa-Vũng Tàu",
"phone_number": "0999999999",
"province_id": "717",
"district_id": "71705",
"commune_id": "7170510",
"country_code": "84",
"shop_id": 26290,
"allow_create_order": true,
"custom_id": null,
"affiliate_shop_id": 26290,
"affiliate_warehouse": "Kho gia dụng"
},
{
"id": "644b0063-e9a8-43cd-ba08-66a8066d462e",
"name": "kho 2",
"address": "19/349 Minh Khai , Hai bà Trưng, Hà Nội",
"full_address": "19/349 Minh Khai , Hai bà Trưng, Hà Nội, Phường Minh Khai, Quận Hai Bà Trưng, Hà Nội",
"phone_number": "01655809949",
"province_id": "101",
"district_id": "10107",
"commune_id": "1010735",
"country_code": "84",
"shop_id": 26290,
"allow_create_order": false,
"custom_id": null
},
{
"id": "3cfcf3ab-dd77-4237-862f-356b3506fe8a",
"name": "kho địa chỉ mới",
"address": "34234234",
"full_address": "34234234, Xã Cao Đức, Bắc Ninh",
"phone_number": "0989965976",
"province_id": "84_VN102",
"district_id": null,
"commune_id": "84_VN10236",
"country_code": "84",
"shop_id": 26290,
"allow_create_order": true,
"custom_id": null
}
]
}Create warehouse
/shops/{SHOP_ID}/warehousesCreate warehouses
Path parameters
SHOP_IDintegerrequiredShop ID
Request body
Request body containing warehouse information to create
namestringrequiredWarehouse name
shelf_configobjectrequiredShelf config
addressstringWarehouse address
phone_numberstringWarehouse phone number
province_idstringProvince ID. Get by API GET /geo/provinces
district_idstringDistrict ID. Get by API GET /geo/districts
commune_idstringCommune ID. Get by API GET /geo/communes
country_codestringCountry code
batch_configobjectBatch config
custom_shelf_configobjectCustom shelf config
custom_batch_configobjectCustom batch config
hide_config_batch_shelfbooleanOpen custom batch shelf config
Responses
idstringWarehouse ID
namestringWarehouse name
addressstringWarehouse address
full_addressstringWarehouse full address
phone_numberstringWarehouse phone number
province_idstringProvince ID. For a Viet Nam warehouse using the new (2-level, post-merger) address, this is the new province ID (e.g. 84_VN102)
district_idstringnullableDistrict ID. Always null for a Viet Nam warehouse using the new address (no district level)
commune_idstringnullableCommune ID. For a Viet Nam warehouse using the new address, this is the new commune ID (e.g. 84_VN10236)
country_codestringCountry code
shop_idintegerShop ID
allow_create_orderbooleanAllow create order
custom_idstringCustom ID
affiliate_shop_idintegerAffiliate shop ID
affiliate_warehousestringAffiliate warehouse name
curl -X POST "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/warehouses?api_key=API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "kho 2",
"address": "19/349 Minh Khai , Hai bà Trưng, Hà Nội",
"phone_number": "098765432",
"province_id": "101",
"district_id": "10107",
"commune_id": "1010735",
"country_code": "84",
"shelf_config": {
"col": "3"
},
"batch_config": {
"col": "0",
"line": "3",
"row": "3"
},
"custom_batch_config": {
"custom_config": {
"0": "lô 1"
}
},
"custom_shelf_config": {
"custom_config": {
"0": "1.1",
"1": "1.2",
"2": "1.3",
"3": "1.4"
}
},
"hide_config_batch_shelf": false
}'{
"id": "b4cb5897-6e56-4581-96cc-2f12677c7bd8",
"name": "kho test ecod",
"address": "hâhhha",
"full_address": "hâhhha, Xã Bình Trung, Huyện Châu Đức, Bà Rịa-Vũng Tàu",
"phone_number": "0999999999",
"province_id": "717",
"district_id": "71705",
"commune_id": "7170510",
"country_code": "84",
"shop_id": 26290,
"allow_create_order": true,
"custom_id": null
}Update warehouse
/shops/{SHOP_ID}/warehouses/{WAREHOUSE_ID}Path parameters
SHOP_IDintegerrequiredShop ID
WAREHOUSE_IDstringrequiredWarehouse ID
Request body
Request body containing warehouse information to update
namestringrequiredWarehouse name
shelf_configobjectrequiredShelf config
addressstringWarehouse address
phone_numberstringWarehouse phone number
province_idstringProvince ID. Get by API GET /geo/provinces
district_idstringDistrict ID. Get by API GET /geo/districts
commune_idstringCommune ID. Get by API GET /geo/communes
country_codestringCountry code
batch_configobjectBatch config
custom_shelf_configobjectCustom shelf config
custom_batch_configobjectCustom batch config
hide_config_batch_shelfbooleanOpen custom batch shelf config
Responses
idstringWarehouse ID
namestringWarehouse name
addressstringWarehouse address
full_addressstringWarehouse full address
phone_numberstringWarehouse phone number
province_idstringProvince ID. For a Viet Nam warehouse using the new (2-level, post-merger) address, this is the new province ID (e.g. 84_VN102)
district_idstringnullableDistrict ID. Always null for a Viet Nam warehouse using the new address (no district level)
commune_idstringnullableCommune ID. For a Viet Nam warehouse using the new address, this is the new commune ID (e.g. 84_VN10236)
country_codestringCountry code
shop_idintegerShop ID
allow_create_orderbooleanAllow create order
custom_idstringCustom ID
affiliate_shop_idintegerAffiliate shop ID
affiliate_warehousestringAffiliate warehouse name
curl -X PUT "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/warehouses/{WAREHOUSE_ID}?api_key=API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Kho mặc định",
"address": "190 La Thành",
"phone_number": "0366452565",
"province_id": "101",
"district_id": "10113",
"commune_id": "1011309",
"country_code": "84",
"shelf_config": {
"col": "3"
},
"batch_config": {
"col": "0",
"line": "3",
"row": "3"
},
"custom_batch_config": {
"custom_config": {
"0": "lô 1"
}
},
"custom_shelf_config": {
"custom_config": {
"0": "1.1",
"1": "1.2",
"2": "1.3",
"3": "1.4"
}
},
"hide_config_batch_shelf": false
}'{
"id": "b4cb5897-6e56-4581-96cc-2f12677c7bd8",
"name": "kho test ecod",
"address": "SCB",
"full_address": "SCB, Xã Bình Trung, Huyện Châu Đức, Bà Rịa-Vũng Tàu",
"phone_number": "0999999999",
"province_id": "717",
"district_id": "71705",
"commune_id": "7170510",
"country_code": "84",
"shop_id": 26290,
"allow_create_order": true,
"custom_id": null
}Inventory histories
/shops/{SHOP_ID}/inventory_historiesGet inventory history
Path parameters
SHOP_IDintegerrequiredShop ID
Query parameters
pageintegerrequiredPage number
page_sizeintegerrequiredPage size
warehouse_idstringWarehouse ID
variation_ids[]array<string>Variation IDs
startDateintegerStart date (unix timestamp)
endDateintegerEnd date (unix timestamp)
Responses
dataarray<object>List of inventory histories
page_numberintegerPage number
page_sizeintegerPage size
successbooleanSuccess status
total_entriesintegerTotal entries
total_pagesintegerTotal pages
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/inventory_histories?api_key=API_KEY&page=1&page_size=30"{
"success": true,
"data": [
{
"avg_price": 1,
"current_inventory": [
{
"actual_remain_quantity": 1,
"avg_price": 1,
"id": "b4cb5897-6e56-4581-96cc-2f12677c7bd8",
"name": "kho test ecod",
"remain_quantity": 1,
"total_quantity": 1
}
],
"editor_id": "cee3c05e-5f85-43c4-b27e-889b99c50097",
"id": 1,
"inserted_at": "2024-01-01T00:00:00Z",
"quantity": 1,
"ref_display_id": "12345",
"remain_quantity": 1,
"table_name": "Purchase",
"type": "import",
"variation_now": {
"barcode": "BARCODE123",
"display_id": "13109",
"fields": [
{
"id": "field-id-1",
"keyValue": "Màu",
"name": "Màu",
"value": "Trắng"
}
],
"id": "415040f4-ab63-465e-8699-e9ebfff4c6c7",
"images": [
"https://statics.pancake.vn/user-content.pancake.vn/2021/8/5/fccd6.jpg"
],
"is_hidden": true,
"is_locked": true,
"is_sell_negative_variation": true,
"last_imported_price": 1,
"product_id": "3487e126-b0d9-4dae-89a9-ee60bef2f4e9",
"retail_price": 1,
"weight": 1
},
"warehouse": {
"custom_id": null,
"ffm_id": null,
"full_address": "hâhhha, Xã Bình Trung, Huyện Châu Đức, Bà Rịa-Vũng Tàu",
"id": "b4cb5897-6e56-4581-96cc-2f12677c7bd8",
"name": "kho test ecod",
"phone_number": "0999999999"
}
}
]
}