Products & inventory

Warehouse

4 endpoints · https://pos.pages.fm/api/v1

View Markdown

Warehouse list

GET/shops/{SHOP_ID}/warehouses

Get list of warehouses

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4

Responses

object
dataarray<Warehouse>

List of warehouses

Request
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/warehouses?api_key=API_KEY"
Response 200
{
  "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

POST/shops/{SHOP_ID}/warehouses

Create warehouses

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4

Request body

Request body containing warehouse information to create

object
namestringrequired

Warehouse name

shelf_configobjectrequired

Shelf config

addressstring

Warehouse address

phone_numberstring

Warehouse phone number

province_idstring

Province ID. Get by API GET /geo/provinces

district_idstring

District ID. Get by API GET /geo/districts

commune_idstring

Commune ID. Get by API GET /geo/communes

country_codestring

Country code

batch_configobject

Batch config

custom_shelf_configobject

Custom shelf config

custom_batch_configobject

Custom batch config

hide_config_batch_shelfboolean

Open custom batch shelf config

Responses

WarehouseWarehouse information
idstring

Warehouse ID

namestring

Warehouse name

addressstring

Warehouse address

full_addressstring

Warehouse full address

phone_numberstring

Warehouse phone number

province_idstring

Province 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_idstringnullable

District ID. Always null for a Viet Nam warehouse using the new address (no district level)

commune_idstringnullable

Commune ID. For a Viet Nam warehouse using the new address, this is the new commune ID (e.g. 84_VN10236)

country_codestring

Country code

shop_idinteger

Shop ID

allow_create_orderboolean

Allow create order

custom_idstring

Custom ID

affiliate_shop_idinteger

Affiliate shop ID

affiliate_warehousestring

Affiliate warehouse name

Request
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
}'
Response 200
{
  "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

PUT/shops/{SHOP_ID}/warehouses/{WAREHOUSE_ID}

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4
WAREHOUSE_IDstringrequired

Warehouse ID

Example: "b4cb5897-6e56-4581-96cc-2f12677c7bd8"

Request body

Request body containing warehouse information to update

object
namestringrequired

Warehouse name

shelf_configobjectrequired

Shelf config

addressstring

Warehouse address

phone_numberstring

Warehouse phone number

province_idstring

Province ID. Get by API GET /geo/provinces

district_idstring

District ID. Get by API GET /geo/districts

commune_idstring

Commune ID. Get by API GET /geo/communes

country_codestring

Country code

batch_configobject

Batch config

custom_shelf_configobject

Custom shelf config

custom_batch_configobject

Custom batch config

hide_config_batch_shelfboolean

Open custom batch shelf config

Responses

WarehouseWarehouse information
idstring

Warehouse ID

namestring

Warehouse name

addressstring

Warehouse address

full_addressstring

Warehouse full address

phone_numberstring

Warehouse phone number

province_idstring

Province 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_idstringnullable

District ID. Always null for a Viet Nam warehouse using the new address (no district level)

commune_idstringnullable

Commune ID. For a Viet Nam warehouse using the new address, this is the new commune ID (e.g. 84_VN10236)

country_codestring

Country code

shop_idinteger

Shop ID

allow_create_orderboolean

Allow create order

custom_idstring

Custom ID

affiliate_shop_idinteger

Affiliate shop ID

affiliate_warehousestring

Affiliate warehouse name

Request
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
}'
Response 200
{
  "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

GET/shops/{SHOP_ID}/inventory_histories

Get inventory history

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4

Query parameters

pageintegerrequired

Page number

Default: 1 · Example: 1
page_sizeintegerrequired

Page size

Default: 30 · Example: 30
warehouse_idstring

Warehouse ID

Example: "b4cb5897-6e56-4581-96cc-2f12677c7bd8"
variation_ids[]array<string>

Variation IDs

startDateinteger

Start date (unix timestamp)

Example: 0
endDateinteger

End date (unix timestamp)

Example: 0

Responses

object
dataarray<object>

List of inventory histories

page_numberinteger

Page number

page_sizeinteger

Page size

successboolean

Success status

total_entriesinteger

Total entries

total_pagesinteger

Total pages

Request
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/inventory_histories?api_key=API_KEY&page=1&page_size=30"
Response 200
{
  "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"
      }
    }
  ]
}