Sales

Order tag

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

View Markdown

List of order tags

GET/shops/{SHOP_ID}/orders/tags

Get list of order tags

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4

Responses

object
dataarray<object>

List of order tags

successboolean

Success status

Request
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/orders/tags?api_key=API_KEY"
Response 200
{
  "data": [
    {
      "id": 75,
      "name": "thẻ 4",
      "color": "#123123",
      "is_system_tag": false,
      "groups": [
        {
          "id": 13,
          "name": "nhom 1"
        },
        {
          "id": 16,
          "name": "nhom 2"
        }
      ]
    },
    {
      "id": 1,
      "name": "Giao không thành",
      "color": "#f04134",
      "is_system_tag": true,
      "groups": [
        {
          "id": -1,
          "name": "Delivery Group"
        },
        {
          "id": 13,
          "name": "nhom 1"
        }
      ]
    },
    {
      "id": 2,
      "name": "Chờ cọc",
      "color": "#096dd9",
      "is_system_tag": true,
      "groups": []
    }
  ],
  "success": true
}

Create order tag

POST/shops/{SHOP_ID}/orders/tags

Create a new order tag

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4

Request body

Request body containing order tag information to create

object
namestringrequired

Tag name

tag_colorstring

Tag color code

groupsarray<integer>

List of tag group IDs. Get by API GET /shops/{SHOP_ID}/orders/tag_groups

statusesarray<integer>

List of order statuses to apply the tag

Responses

object
dataobject

Created order tag information

successboolean

Success status

Request
curl -X POST "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/orders/tags?api_key=API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "test 5.1",
  "tag_color": "#000",
  "groups": [
    1
  ],
  "statuses": [
    1,
    2,
    3
  ]
}'
Response 200
{
  "data": {
    "id": 50,
    "name": "test 5.1",
    "tag_color": "#000",
    "groups": [
      1
    ],
    "statuses": [
      1,
      2,
      3
    ]
  },
  "success": true
}

Update order tag

PUT/shops/{SHOP_ID}/orders/tags/{TAG_ID}

Update an order tag. Only applies to tags that are not system tags (is_system_tag = false)

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4
TAG_IDintegerrequired

Tag ID

Example: 45

Request body

Request body containing order tag information to update

object
namestringrequired

Tag name

tag_colorstring

Tag color code

groupsarray<integer>

List of tag group IDs. Get by API GET /shops/{SHOP_ID}/orders/tag_groups

statusesarray<integer>

List of order statuses to apply the tag

Responses

object
dataobject

Updated order tag information

successboolean

Success status

Request
curl -X PUT "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/orders/tags/{TAG_ID}?api_key=API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "test 4.4",
  "tag_color": "#000",
  "groups": [
    1,
    2
  ],
  "statuses": [
    1,
    2,
    3
  ]
}'
Response 200
{
  "data": {
    "id": 45,
    "name": "test 4.4",
    "tag_color": "#000",
    "groups": [
      2,
      1
    ],
    "statuses": [
      1,
      2,
      3
    ]
  },
  "success": true
}

List of order tag groups

GET/shops/{SHOP_ID}/orders/tag_groups

Get list of order tag groups

Path parameters

SHOP_IDintegerrequired

Shop ID

Example: 4

Responses

object
dataarray<object>

List of order tag groups

successboolean

Success status

Request
curl "https://pos.pages.fm/api/v1/shops/{SHOP_ID}/orders/tag_groups?api_key=API_KEY"
Response 200
{
  "data": [
    {
      "id": 1,
      "name": "nhóm 1",
      "add_multiple_tags": true,
      "tags": [
        41,
        50,
        45
      ]
    }
  ],
  "success": true
}