DeleteProduct#
To use this method, you must have a WhatsApp Business account.
The method is designed to delete one or more products from the catalog.
Irreversibility of deletion
Deleting a product cannot be undone. After deletion, the product is no longer displayed in the catalog, and its productId becomes invalid.
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 delete product(s), you need to send a request to the address:
{{apiUrl}}/waInstance{{idInstance}}/deleteProduct/{{apiTokenInstance}}
To obtain the request parameters idInstance and apiTokenInstance, refer to the section Before you start.
Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
productIds | array | Yes | Array of product identifiers to delete |
Request body example#
{
"productIds": ["26304465135919794"]
}
Response#
Response fields#
| Field | Type | Description |
|---|---|---|
deleted | boolean | Returns true if the deletion was successful |
deletedProductIds | array | Array of product identifiers that were deleted |
Response body example#
{
"deleted": true,
"deletedProductIds": [
"26304465135919794"
]
}
DeleteProduct 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}}/deleteProduct/{{apiTokenInstance}}"
payload = {
"productIds": ["26304465135919794"]
}
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url, json=payload, headers=headers)
print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/deleteProduct/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"productIds": ["26304465135919794"]
}'