Customers & promotions

Voucher

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

View Markdown

List of voucher

GET/shops/{SHOP_ID}/vouchers

Get list of vouchers

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4

Responses

object
dataarray<Voucher>

List of vouchers

successboolean

Success 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}/vouchers

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4

Request body

Request body containing voucher information to create

object
namestringrequired

Voucher name

promo_code_infoobjectrequired

Voucher promo code information

start_timestring · date-timerequired

Voucher start time

end_timestring · date-timerequired

Voucher end time

is_free_shippingboolean

Is free shipping

is_activatedboolean

Is activated

customer_tagsarray<string>

Customer tags

Responses

object
successboolean

Success 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_IDintegerrequired

Shop ID

Example: 4
VOUCHER_IDstringrequired

Voucher ID

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

Responses

object
dataVoucher

Voucher information

successboolean

Success 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"
  }
}