Endpoint
GET/shops/{SHOP_ID}/vouchersDanh sách phiếu giảm giáPOST/shops/{SHOP_ID}/vouchersTạo phiếu giảm giáGET/shops/{SHOP_ID}/vouchers/{VOUCHER_ID}Lấy thông tin phiếu giảm giáDanh sách phiếu giảm giá
GET
/shops/{SHOP_ID}/vouchersLấy danh sách phiếu giảm giá
Tham số đường dẫn
SHOP_IDintegerbắt buộcMã shop
Phản hồi
object
dataarray<Voucher>Danh sách phiếu giảm giá
successbooleanTrạng thái thành công
Yêu cầu
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/vouchers?api_key=API_KEY"Phản hồi 200
{
"success": true,
"data": [
{
"id": "9589b791-013f-4a5b-b8d1-164fad73d84e",
"display_id": 7,
"name": "d5IvGYtj",
"type": "discount_by_coupon_id",
"start_time": "2021-12-09T04:27:23Z",
"end_time": "2021-12-10T04:27:26Z",
"promo_code_info": {
"discount": 4534,
"is_percent": false,
"max_discount_by_percent": 0
},
"is_free_shipping": false,
"is_activated": true,
"is_used": null,
"customer_tags": [
"Tiềm năng"
],
"shop_id": 3,
"creator_id": "d6e6a545-f102-439e-9943-8ac8369f9735",
"inserted_at": "2021-12-06T04:27:40Z",
"updated_at": "2021-12-10T02:26:59Z"
}
]
}Tạo phiếu giảm giá
POST
/shops/{SHOP_ID}/vouchersTham số đường dẫn
SHOP_IDintegerbắt buộcMã shop
Nội dung yêu cầu
Thông tin yêu cầu chứa thông tin voucher cần tạo
object
namestringbắt buộcMã giảm giá
promo_code_infoobjectbắt buộcThông tin giảm giá
start_timestring · date-timebắt buộcNgày bắt đầu áp dụng
end_timestring · date-timebắt buộcNgày kết thúc áp dụng
is_free_shippingbooleanMiễn phí vận chuyển
is_activatedbooleanĐã kích hoạt
customer_tagsarray<string>Thẻ khách hàng
Phản hồi
object
successbooleanTrạng thái thành công
Yêu cầu
curl -X POST "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/vouchers?api_key=API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "test_voucher_5",
"promo_code_info": {
"discount": 53635,
"is_percent": false
},
"is_free_shipping": false,
"is_activated": true,
"customer_tags": [
"New tag"
],
"start_time": "2021-12-09T04:27:23",
"end_time": "2021-12-10T04:27:26"
}'Phản hồi 200
{
"success": true
}Lấy thông tin phiếu giảm giá
GET
/shops/{SHOP_ID}/vouchers/{VOUCHER_ID}Tham số đường dẫn
SHOP_IDintegerbắt buộcMã shop
VOUCHER_IDstringbắt buộcId phiếu giảm giá
Phản hồi
object
dataVoucherThông tin mã giảm giá
successbooleanTrạng thái thành công
Yêu cầu
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/vouchers/{VOUCHER_ID}?api_key=API_KEY"Phản hồi 200
{
"success": true,
"data": {
"id": "9589b791-013f-4a5b-b8d1-164fad73d84e",
"display_id": 7,
"name": "d5IvGYtj",
"type": "discount_by_coupon_id",
"start_time": "2021-12-09T04:27:23Z",
"end_time": "2021-12-10T04:27:26Z",
"promo_code_info": {
"discount": 4534,
"is_percent": false,
"max_discount_by_percent": 0
},
"is_free_shipping": false,
"is_activated": true,
"is_used": null,
"customer_tags": [
"Tiềm năng",
"Hay hoàn"
],
"shop_id": 3,
"creator_id": "d6e6a545-f102-439e-9943-8ac8369f9735",
"inserted_at": "2021-12-06T04:27:40Z",
"updated_at": "2021-12-06T04:27:40Z"
}
}