PosApp Open APIs
  1. Đồng giá
PosApp Open APIs
  • Tổng quan
  • Thẻ PosApp
    • Mã lỗi (error code)
    • API Idempotency
    • Nạp tiền vào thẻ
      POST
    • Kiểm tra trạng thái giao dịch
      POST
  • Thông tin khác
    • Digital Signature
  • Webhook
    • Tổng quan
    • Order Schema
    • Warehouse Import Schema
  • Sản phẩm
    • Tạo mới sản phẩm
      POST
    • Sửa một sản phẩm
      PATCH
    • Tồn kho sản phẩm
      POST
    • Cập nhật tên nhóm sản phẩm
      PATCH
  • Khuyến mãi
    • Đồng giá
      • Tạo khuyến mãi
        POST
      • Sửa khuyến mãi
        POST
    • Xóa khuyến mãi
      POST
  • Đăng ký tài khoản PosApp
    • Danh sách mô hình kinh doanh
      GET
    • Đăng ký tài khoản
      POST
    • Kiểm tra tài khoản PosApp
      GET
  • Báo cáo
  1. Đồng giá

Tạo khuyến mãi

Testing
Test Env
https://retail-api.posapp.vn/
Test Env
https://retail-api.posapp.vn/
POST
api/public/promotions/create
Api này dùng để tạo khuyến mãi đồng giá với phương thức POST

Request

Header Params

Body Params application/json

Example
{
    "promotion_name": "Đồng giá 20k",
    "promotion_code": "",
    "promotion_type": 10,
    "promotion_subtype": 1,
    "promotion_subtype2": 0,
    "promotion_value": 20000,
    "start_date": "2025-03-18",
    "end_date": "2025-03-26",
    "started_at": 1742256000,
    "ended_at": 1742947200,
    "is_weekdays": 0,
    "weekdays": "2,3,4",
    "weeks": 2,
    "is_time": 0,
    "promotion_time_slots": null,
    "target_type": 0,
    "target_detailtype": "",
    "promotion_detail": [
        {
            "foods": "[{\"food_id\":1120500,\"food_name\":\"Nước ép thơm\",\"amount\":1,\"amount2\":1,\"is_category\":false,\"is_all\":false,\"unit_master_ids\":[{\"id\":115671,\"name\":\"ly\"}]},{\"food_id\":1120501,\"food_name\":\"Nước ép dâu\",\"amount\":1,\"amount2\":1,\"is_category\":false,\"is_all\":false,\"unit_master_ids\":[{\"id\":115671,\"name\":\"ly\"}]}]",
            "foods2": "[]",
            "is_category": false,
            "is_all": false,
            "unit_master_ids": "[{\"id\":115671,\"name\":\"ly\"},{\"id\":115671,\"name\":\"ly\"}]"
        }
    ],
    "is_new": 1,
    "promotion_desc": "Khuyến mãi đồng giá 20k",
    "allow_apply_concurrent_flg": 0,
    "apply_all_branchs": 0,
    "branches_are_applicable": [
        {
            "include_children_branches": 0,
            "include_progeny_branches": 0
        }
    ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://retail-api.posapp.vn/api/public/promotions/create' \
--header 'X-API-Key;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "promotion_name": "Đồng giá 20k",
    "promotion_code": "",
    "promotion_type": 10,
    "promotion_subtype": 1,
    "promotion_subtype2": 0,
    "promotion_value": 20000,
    "start_date": "2025-03-18",
    "end_date": "2025-03-26",
    "started_at": 1742256000,
    "ended_at": 1742947200,
    "is_weekdays": 0,
    "weekdays": "2,3,4",
    "weeks": 2,
    "is_time": 0,
    "promotion_time_slots": null,
    "target_type": 0,
    "target_detailtype": "",
    "promotion_detail": [
        {
            "foods": "[{\"food_id\":1120500,\"food_name\":\"Nước ép thơm\",\"amount\":1,\"amount2\":1,\"is_category\":false,\"is_all\":false,\"unit_master_ids\":[{\"id\":115671,\"name\":\"ly\"}]},{\"food_id\":1120501,\"food_name\":\"Nước ép dâu\",\"amount\":1,\"amount2\":1,\"is_category\":false,\"is_all\":false,\"unit_master_ids\":[{\"id\":115671,\"name\":\"ly\"}]}]",
            "foods2": "[]",
            "is_category": false,
            "is_all": false,
            "unit_master_ids": "[{\"id\":115671,\"name\":\"ly\"},{\"id\":115671,\"name\":\"ly\"}]"
        }
    ],
    "is_new": 1,
    "promotion_desc": "Khuyến mãi đồng giá 20k",
    "allow_apply_concurrent_flg": 0,
    "apply_all_branchs": 0,
    "branches_are_applicable": [
        {
            "include_children_branches": 0,
            "include_progeny_branches": 0
        }
    ]
}'

Responses

🟢200Success
application/json
Body

Example
{
    "status": 1,
    "error_code": 0,
    "data": {
        "promotion_name": "ĐỒNG GIÁ",
        "promotion_code": null,
        "promotion_type": "10",
        "promotion_subtype": "1",
        "promotion_subtype2": "0",
        "promotion_value": "20000",
        "promotion_max_price": "0",
        "start_date": "2025-03-18",
        "end_date": "2025-03-26",
        "started_at": "1742256000",
        "ended_at": "1742947200",
        "is_weekdays": "1",
        "weekdays": "2,3",
        "weeks": 1,
        "is_time": "0",
        "promotion_time_slots": null,
        "condition_flag": "0",
        "condition_detail": "0",
        "target_channel": "null",
        "topping_flg": "0",
        "reach_amount_flg": "0",
        "minimum_quantity": "0",
        "target_type": "0",
        "target_detailtype": null,
        "branch_ids": null,
        "max_use": "0",
        "max_use_daily": "0",
        "is_new": "1",
        "start_time": null,
        "to_time": null,
        "promotion_desc": null,
        "auto_apply_flg": "0",
        "promotion_extra_condition": null,
        "gift_many_flg": "0",
        "max_number_gift": "1",
        "apply_all_branchs": "1",
        "allow_apply_concurrent_flg": "0",
        "apply_on_original_price_flg": "1",
        "main_promotion_id": "0",
        "shop_id": "1570685368",
        "status": 1,
        "lastupdate": "2025-03-18 11:52:33",
        "id": 3101,
        "branches_are_applicable": [
            {
                "shop_id": 1570685368,
                "shop_name": "DE Shop",
                "start_date": null,
                "end_date": null,
                "is_weekdays": 0,
                "weekdays": null,
                "is_time": 0,
                "start_time": null,
                "to_time": null,
                "include_children_branches": 1,
                "include_progeny_branches": 1,
                "use_default_time_option": null,
                "updated_at": "2025-03-18 11:52:33",
                "shop": {
                    "id": 1570685368,
                    "name": "DE Shop"
                }
            }
        ],
        "promotion_detail": [
            {
                "id": 19181,
                "promotion_id": 3101,
                "foods": "[{\"food_id\":1120500,\"food_name\":\"Nước ép thơm\",\"amount\":1,\"amount2\":1,\"is_category\":false,\"is_all\":false,\"unit_master_ids\":[{\"id\":115671,\"name\":\"ly\",\"plus_price\":0}],\"unit_master2_ids\":[]},{\"food_id\":1120501,\"food_name\":\"Nước ép dâu\",\"amount\":1,\"amount2\":1,\"is_category\":false,\"is_all\":false,\"unit_master_ids\":[{\"id\":115671,\"name\":\"ly\",\"plus_price\":0}],\"unit_master2_ids\":[]}]",
                "unit_master_ids": "[{\"id\":115671,\"name\":\"ly\",\"plus_price\":0},{\"id\":115671,\"name\":\"ly\",\"plus_price\":0}]",
                "food_id": null,
                "food_name": null,
                "amount": 0,
                "foods2": "[]",
                "unit_master2_ids": null,
                "food2_id": null,
                "food2_name": null,
                "amount2": 0,
                "amount_used": 0,
                "discount_type": 0,
                "discount_value": 0,
                "change_price": 0,
                "is_category": 0,
                "is_category2": 0,
                "is_all": 0,
                "is_all2": 0,
                "combo_local_id": "0",
                "combo_title": null,
                "combo_price": null,
                "parent_combo_local_id": "0",
                "plus_price": 0,
                "detail_max_price": null,
                "detail_type": 0,
                "combo_select_type": null,
                "combo_max_choose": null,
                "additional_condition": 0,
                "topping_flg": 0,
                "reach_amount_flg": 0,
                "minimum_quantity": 0,
                "combo_product_master_id": 0,
                "combo_price_online": null
            }
        ],
        "promotion_codes": [],
        "child_promotions": []
    },
    "msg": "Thành công"
}
Modified at 2025-06-03 09:12:56
Previous
Cập nhật tên nhóm sản phẩm
Next
Sửa khuyến mãi
Built with