Skip to main content

Add a collection to your 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.

info

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.

tip

You may need the product IDs of these products to make modifications to your catalog.

caution

Just like with the app, each modification you make will go through a verification process made by WhatsApp that can take between a few minutes to a few hours.

Request body

For each request, you must specify the phone number you connected to 2Chat that you want to use as the client.

caution

The name of a collection can't be changed once created. To change it, you must delete the entire collection and add it back with the right name.

{
"from_number": "+595981461442",
"collection": {
"name": "Shoes",
"product_ids": [ "9846351425439378" ]
}

}

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/collection 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 exmple: https://api.p.2chat.io/open/whatsapp/catalog/products/+595981461442.

tip

Use +595981461442 as an example of a live working set of products you can query

Invocation


curl --location --request POST 'https://api.p.2chat.io/open/whatsapp/catalog/collection' \
--header 'X-User-API-Key: your_api_key_here' \
--data '{
"from_number": "+595981461442"
}'

Response

{
"success": true
}