Customers & promotions

Promotion

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

View Markdown

Get promotion product list

GET/shops/{SHOP_ID}/promotion_advance

Get list of promotions

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4

Query parameters

pageinteger

Page number

Default: 1 · Example: 1
page_sizeinteger

Page size

Default: 10 · Example: 10
textSearchstring

Text search

Example: "áo sơ mi"

Responses

object
dataarray<Promotion>

List of promotions

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}/promotion_advance?api_key=API_KEY"
Response 200
{
  "success": true,
  "data": [
    {
      "id": "260a0d45-ba88-457b-8b31-afa3fda0ce0e",
      "display_id": 50,
      "name": "km 345",
      "type": "discount_by_product",
      "start_time": "2022-03-10T05:04:11Z",
      "end_time": "2022-03-11T05:04:13Z",
      "warehouse_ids": [],
      "customer_tags": [],
      "order_sources": [],
      "group_name": "Nhóm 1",
      "is_activated": true,
      "is_variation": true,
      "is_used": null,
      "is_free_shipping": false,
      "is_discount_in_birthday_customer": false,
      "coupon_info": {
        "discount": 0,
        "is_percent": false
      },
      "promo_code_info": {
        "discount": 0,
        "is_percent": false,
        "max_discount_by_percent": 0
      },
      "discount_by_quantity": 1,
      "items": [
        {
          "id": "bd11e48a-6fec-4e3a-a1b7-8ef834a98dae",
          "promotion_advance_id": "260a0d45-ba88-457b-8b31-afa3fda0ce0e",
          "shop_id": 3,
          "product_id": null,
          "variation_id": "2f3aea54-5c0c-44db-9f9b-2c987c298795",
          "category_id": null,
          "product": null,
          "variation": {
            "id": "2f3aea54-5c0c-44db-9f9b-2c987c298795",
            "display_id": "SB21-M-DEN",
            "product_id": "d6d13d0b-320e-4651-a368-de2c9e30ae66",
            "retail_price": 250000,
            "retail_price_after_discount": 238000
          },
          "level_info": [
            {
              "discount": 30000,
              "is_percent": false,
              "from_quantity": 1,
              "to_quantity": 4
            }
          ],
          "fixed_prices": 0,
          "coupon_item_info": {
            "discount": 0,
            "is_percent": false
          },
          "limited_quantity": 0,
          "limited_quantity_used": 0,
          "attachment_product_info": [],
          "discount_info_by_attachment_product": null
        }
      ],
      "bonus_items": [],
      "total_quantity_bonus": 0,
      "arr_level_promotion": [],
      "level_order_prices": [],
      "priority_level": null,
      "type_employee": "all",
      "post_ids": [],
      "shop_id": 3,
      "creator_id": "4eab0efc-2994-4b96-acf0-e4c847668555",
      "inserted_at": "2022-03-10T05:04:33Z",
      "updated_at": "2022-04-08T08:14:58Z"
    }
  ]
}

Create promotion product

POST/shops/{SHOP_ID}/promotion_advance

Create promotion

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4

Request body

Request body containing promotion information to create

object
promotion_advanceobjectrequired

Responses

object
successboolean

Success status

Request
curl -X POST "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/promotion_advance?api_key=API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "promotion_advance": {
    "name": "string",
    "type": "discount_by_product"
  }
}'
Response 200
{
  "success": true
}

Update promotion product

PUT/shops/{SHOP_ID}/promotion_advance/{PROMOTION_ID}

Update promotion

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4
PROMOTION_IDstringrequired

Promotion ID

Example: "949f1396-f6fa-45d9-93b6-4c37503a9950"

Request body

Request body containing promotion information to update

object
promotion_advancePromotionrequired

Promotion information

Responses

object
successboolean

Success status

Request
curl -X PUT "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/promotion_advance/{PROMOTION_ID}?api_key=API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "promotion_advance": {
    "id": "string",
    "display_id": "string",
    "name": "string",
    "type": "string",
    "start_time": "2026-01-01T00:00:00Z",
    "end_time": "2026-01-01T00:00:00Z"
  }
}'
Response 200
{
  "success": true
}

Activate/Deactivate/Delete promotions

POST/shops/{SHOP_ID}/promotion_advance/delete_multi

Activate, deactivate or delete multiple promotions

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4

Request body

Request body containing promotion IDs to delete

object
idsarray<string>required

Promotion IDs

type_actionstringrequired

Action type

Values"DEACTIVE_PROMOTIONS"Deactivate promotions"ACTIVE_PROMOTIONS"Activate promotions"DELETE_PROMOTIONS"Delete promotions

Responses

object
successboolean

Success status

Request
curl -X POST "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/promotion_advance/delete_multi?api_key=API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ids": [
    "0fe988a1-26a5-4772-b4b6-a9c17c9f40cd"
  ],
  "type_action": "DEACTIVE_PROMOTIONS"
}'
Response 200
{
  "success": true
}