Skip to main content

Add a product to your catalog

This endpoint will let you add a product to a WhatsApp catalog. If you also want to add it to a certain collection, you can do that with the Add Collection endpoint.

danger

This endpoint needs that at least 1 product exists in your catalog. Add one manually using the app if you don't have any.

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. It can take between a few minutes to a few hours.

Available fields

FieldDescription
nameName field of the product. This field is mandatory
image_urlAn URL pointing to the default image of the product. This field is mandatory
descriptionA description of the product
priceThe price of your product
currencyThis value defaults to the currency of the country of your number. E.g.: USD, EUR, MXN, PYG, etc.
is_hiddenWhether this product is hidden from your customers or not
urlURL field of the product. For example, the link to the product in your Shopify store
retailer_idyour custom ID for this product. For example, its SKU value

Setting a currency

You can specify a currency that isn't your number's default but you won't be able to change it later. For example, if you have a United States number your default currency will be USD. If you don't specify any value for this field, this is the currency that will be displayed alongside your product prices.

However, you can also set it to CAD for example, but you won't be able to edit the product to change it back to USD later. You would have to delete the product and add it back in to restore it to USD.

For a list of valid currency codes, see IBAN's list.

Invocation

Make a POST request to https://api.p.2chat.io/open/whatsapp/catalog/product to add a new product and specify the following request body:

Request body

For each request, you must specify the phone number you connected to 2Chat where you want to add the new product and the fields you want to fill out. Only the name and the image_url are mandatory.

{
"from_number": "+595981461442",
"product": {
"name": "PUMA | SUEDE CLASSIC REGAL",
"image_url": "https://2chat.co/img/2chat-logo.png",
"price": "110.00",
"currency": "USD",
"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.",
"retailer_id": "puma1"
}

}

curl --location --request POST 'https://api.p.2chat.io/open/whatsapp/catalog/product' \
--header 'X-User-API-Key: your_api_key_here' \
--data '{
"from_number": "+595981461442",
"product": {
"name": "PUMA | SUEDE CLASSIC REGAL",
"image_url": "https://2chat.co/img/2chat-logo.png",
"price": "110.00",
"currency": "USD",
"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.",
"retailer_id": "puma1"
}

}'

Response

{
"success": true
}