Endpoints
GET/shops/{SHOP_ID}/vouchersList of voucherPOST/shops/{SHOP_ID}/vouchersCreate voucherGET/shops/{SHOP_ID}/vouchers/{VOUCHER_ID}Get voucher infoList of voucher
GET
/shops/{SHOP_ID}/vouchersGet list of vouchers
Path parameters
SHOP_IDintegerrequiredShop ID
Responses
object
dataarray<Voucher>List of vouchers
successbooleanSuccess status
Request
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/vouchers?api_key=API_KEY"Response 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"
}
]
}Create voucher
POST
/shops/{SHOP_ID}/vouchersPath parameters
SHOP_IDintegerrequiredShop ID
Request body
Request body containing voucher information to create
object
namestringrequiredVoucher name
promo_code_infoobjectrequiredVoucher promo code information
start_timestring · date-timerequiredVoucher start time
end_timestring · date-timerequiredVoucher end time
is_free_shippingbooleanIs free shipping
is_activatedbooleanIs activated
customer_tagsarray<string>Customer tags
Responses
object
successbooleanSuccess status
Request
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"
}'Response 200
{
"success": true
}Get voucher info
GET
/shops/{SHOP_ID}/vouchers/{VOUCHER_ID}Get voucher information
Path parameters
SHOP_IDintegerrequiredShop ID
VOUCHER_IDstringrequiredVoucher ID
Responses
object
dataVoucherVoucher information
successbooleanSuccess status
Request
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/vouchers/{VOUCHER_ID}?api_key=API_KEY"Response 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"
}
}