Skip to content

ຂໍ້ມູນສິນຄ້າ (Products)

API ນີ້ໃຊ້ເພື່ອດຶງລາຍການສິນຄ້າ ແລະ package ທີ່ສາມາດຈຳໜ່າຍໄດ້.

ເສັ້ນທາງ (Endpoint)

GET https://open-api.q23.co/termgame/{identify}/products

ແທນທີ່ {identify} ດ້ວຍລະຫັດຂອງທ່ານ.

Example:

https://open-api.q23.co/termgame/therdy/products

https://open-api.q23.co/termgame/q23/products
ຊື່ Headerຈຳເປັນຄຳອະທິບາຍ
agent-tokenລະຫັດຜ່ານສຳລັບການຢືນຢັນ

ຕົວຢ່າງ:

agent-token: agent_password

ຄຳຕອບ (Response)

ຖ້າສຳເລັດ ຈະໄດ້ຮັບ JSON ດັ່ງນີ້:

json
[
    {
        "id": "6822fd3b39f09234a919e348",
        "name": "BIGO LIVE",
        "payloadField": [
            "user_id"
        ],
        "agentPackages": [
            {
                "id": "6822fd3b39f09234a919e34a",
                "name": "20 Diamonds",
                "price": 9772
            },
            // ...more packages...
        ]
    },
    {
        "id": "6822cea0624c06de72fd64d4",
        "name": "Mobile Legends (ເຕີມໄດ້ທຸກເສີບ)",
        "payloadField": [
            "user_id",
            "zone_id"
        ],
        "agentPackages": [
            {
                "id": "6822cea0624c06de72fd64d6",
                "name": "172 💎",
                "price": 49999
            }
            // ...more packages...
        ]
    }
]

ລາຍລະອຽດຄ່າທີ່ຕອບກັບ

ຊື່ຄ່າປະເພດຄຳອະທິບາຍ
idstringລະຫັດສິນຄ້າ
namestringຊື່ສິນຄ້າ
payloadFieldstring[]ຟິວລທີ່ຕ້ອງໃສ່ເມື່ອສັ່ງຊື້
agentPackagesarrayລາຍການ package ທີ່ສາມາດຈຳໜ່າຍໄດ້

agentPackages:

ຊື່ຄ່າປະເພດຄຳອະທິບາຍ
idstringລະຫັດ package
namestringຊື່ package
pricenumberລາຄາ (ຈຳນວນເງິນ)

ຕົວຢ່າງການໃຊ້ງານ

cURL

bash
curl -X GET \
  'https://open-api.q23.co/termgame/your_identifier_here/products' \
  -H 'agent-token: agent_password'

JavaScript

javascript
fetch("https://open-api.q23.co/termgame/your_identifier_here/products", {
  method: "GET",
  headers: {
    "agent-token": "agent_password",
  },
})
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));