List all products in a catalog
This endpoint will return a list of products a given WhatsApp Business number has published on their account. You can list products that belong to your own WhatsApp account or any other WhatsApp Business account.
👉 You can see this API live in 2Chat's WhatsApp catalog exporter, and try it yourself.
To use this API, you must connect a number that uses the free version of WhatsApp Business. This API does not need a WhatsApp Business API account to work.
You may need the product IDs of these products to make modifications to your catalog.
Request query parameter
For each request, you must specify the phone number you connected to 2Chat that you want to use as the client. This must be set as a query parameter in the URL.
Example: from_number=+595981461442
, where +595981461442
is the number you have connected.
Getting a list of products
If you want to get a list of your products, make a GET request to https://api.p.2chat.io/open/whatsapp/catalog/products?from_number=+595981461442
without specifying any phone number.
If you instead want to list products that belong to another WhatsApp Business account, you can add that phone number to the URL to get them.
For example: https://api.p.2chat.io/open/whatsapp/catalog/products/+17137157533?from_number=+595981461442
.
Use +595981461442 as an example of a live working set of products you can query
Invocation
- cURL
- Python
- NodeJS
curl --location --request GET 'https://api.p.2chat.io/open/whatsapp/catalog/products?from_number=+595981461442' \
--header 'X-User-API-Key: your_api_key_here'
import requests
url = "https://api.p.2chat.io/open/whatsapp/catalog/products?from_number=+595981461442"
headers = {
'X-User-API-Key': 'your_api_key_here'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var config = {
method: 'get',
url: 'https://api.p.2chat.io/open/whatsapp/catalog/products?from_number=+595981461442',
headers: {
'X-User-API-Key': 'your_api_key_here'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Response
{
"success": true,
"products": [
{
"id": "6498277906923281",
"is_hidden": false,
"url": "",
"name": "PUMA | SUEDE CLASSIC REGAL",
"description": "First introduced in 1968, the Puma Suede Classic is Puma's most epic sneaker with its athletic inspired design and smooth suede. The Puma Suede Classic Regal Red/White is constructed with a suede upper and contrasting low profile rubber sole, and fat laces, the classic continues to make its mark on the streets today.",
"availability": "in stock",
"max_available": 99,
"whatsapp_product_can_appeal": true,
"retailer_id": "puma1",
"checkmark": false,
"is_approved": true,
"approval_status": "APPROVED",
"price": "80.50",
"currency": "USD",
"images": [
{
"url": "https://2chat-user-data-dev.s3.amazonaws.com/w/p/595981461442/6498277906923281_1"
}
]
},
{
"id": "9846351425439378",
"is_hidden": false,
"url": "https://2chatdemo.com/products/herschel-iona",
"name": "HERSCHEL | IONA",
"description": "Featuring a cinch closure concealed by a slender top flap, the Iona backpack unites everyday practicality with clean design.",
"availability": "in stock",
"max_available": 99,
"whatsapp_product_can_appeal": true,
"retailer_id": "herschel1",
"checkmark": false,
"is_approved": true,
"approval_status": "APPROVED",
"price": "150.50",
"currency": "USD",
"images": [
{
"url": "https://2chat-user-data-dev.s3.amazonaws.com/w/p/595981461442/9846351425439378_1"
}
]
}
]
}
Field | Description |
---|---|
id | The ID of the product. You will need this value to make any kind of modification to this product |
is_hidden | Whether this product is hidden from your customers or not |
url | URL field of the product |
name | Name field of the product |
description | The description field of the product |
availability | true when the product is marked as available |
max_available | number of units available |
retailer_id | your custom ID for this product. For example, its SKU value |
checkmark | true when verified |
is_approved | true when the product was approved by WhatsApp and visible to your customers |
approval_status | Any of PENDING , OUTDATED , REJECTED or APPROVED |
price | The price you specified |
currency | The currency used in your catalog |
images | A list of images of the product |