CreateProduct#
To use this method, you must have a WhatsApp Business account.
The method is designed to create a product in the catalog.
For the method to work successfully, at least one product catalog must have been previously created on the phone.
WhatsApp-side limitations
If catalog methods are called frequently, WhatsApp may temporarily restrict access to the Business Catalog API. Do not send a large number of requests to catalog methods over a short period of time.
Request#
To create a product in the catalog, you need to send a request to the address:
POST
{{apiUrl}}/waInstance{{idInstance}}/createProduct/{{apiTokenInstance}}
To obtain the request parameters idInstance and apiTokenInstance, refer to the section Before you start.
Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Product name |
countryCode | string | Yes | Country of origin code in ISO 3166-1 alpha-2 format (e.g., GB) |
price | string | Yes | Price (regular format, e.g., "850" = 850 Euro). A decimal part is allowed, e.g., "99.90" |
imageUrl | string | Yes | Product image URL. Must start with http:// or https:// |
description | string | No | Product description |
currency | string | No | Currency code in ISO 4217 format (e.g., EUR). If not specified, it is determined by countryCode |
retailerId | string | No | Product identifier from the retailer |
url | string | No | Product page URL. Must start with http:// or https:// |
isHidden | boolean | No | Whether the product is hidden (default false) |
Request body example#
{
"name": "Handmade Ceramic Mug",
"countryCode": "ENG",
"price": "850",
"description": "Hand-painted ceramic mug, 350ml. Dishwasher safe.",
"imageUrl": "https://example.com/mug.jpg",
"currency": "USD",
"retailerId": "12345",
"url": "https://example.com",
"isHidden": true
}
Response#
Response fields#
| Field | Type | Description |
|---|---|---|
productId | string | Unique identifier of the created product in WhatsApp. |
Response body example#
{
"productId": "26437451389197252"
}
CreateProduct errors#
For a list of common errors for all methods, see the section Common errors
| HTTP code | Error identifier | Description |
|---|---|---|
| 400 | Catalog mutations require a business account | WhatsApp-side restriction that occurs when catalog methods are called frequently. Returned even when the request is made from a Business account |
Code examples#
import requests
url = "{{apiUrl}}/waInstance{{idInstance}}/createProduct/{{apiTokenInstance}}"
payload = {
"name": "Handmade Ceramic Mug",
"countryCode": "ENG",
"price": "850",
"description": "Hand-painted ceramic mug, 350ml. Dishwasher safe.",
"imageUrl": "https://example.com/mug.jpg",
"currency": "USD",
"retailerId": "12345",
"url": "https://example.com",
"isHidden": True
}
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url, json=payload, headers=headers)
print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/createProduct/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Handmade Ceramic Mug",
"countryCode": "ENG",
"price": "850",
"description": "Hand-painted ceramic mug, 350ml. Dishwasher safe.",
"imageUrl": "https://example.com/mug.jpg",
"currency": "USD",
"retailerId": "12345",
"url": "https://example.com",
"isHidden": true
}'