Skip to content

SendProduct#

Test Postman Apidog

To use this method, you must have a WhatsApp Business account.

The method is designed to send a product from the catalog to a chat.

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 send a product, you need to send a request to the address:

POST
{{apiUrl}}/waInstance{{idInstance}}/sendProduct/{{apiTokenInstance}}

To obtain the request parameters idInstance and apiTokenInstance, refer to the section Before you start.

Request parameters#

Parameter Type Required Description
chatId string Yes Recipient identifier in the format 79876543210@c.us
productId string Yes Unique product identifier in WhatsApp
quotedMessageId string No Quoted message Id.
If present, the message will be sent quoting the specified chat message.
Quoting a message is only possible from the same chat to which it is sent.
To send messages from another chat, use the ForwardMessages
archive boolean No The flag indicates whether the chat should archived or not
typingTime integer No Display the time of the message typing notification in the interlocutor's chat.
Time is limited by values from 1000 to 20000 milliseconds (from 1 to 20 seconds).

Request body example#

{
  "chatId": "79876543210@c.us",
  "productId": "26437451389197252",
  "quotedMessageId": "3EB0C767D097B7C7C030"
}

Response#

Response fields#

Field Type Description
idMessage string Unique identifier of the sent message

Response body example#

{
  "idMessage": "BAE56159AFC66DB7"
}

SendProduct errors#

For a list of common errors for all methods, see the section Common errors

Code examples#

import requests

url = "{{apiUrl}}/waInstance{{idInstance}}/sendProduct/{{apiTokenInstance}}"

payload = {
    "chatId": "79876543210@c.us",
    "productId": "26437451389197252",
    "quotedMessageId": "3EB0C767D097B7C7C030"
}
headers = {
    'Content-Type': 'application/json'
}

response = requests.post(url, json=payload, headers=headers)

print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/sendProduct/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "chatId": "79876543210@c.us",
    "productId": "26437451389197252",
    "quotedMessageId": "3EB0C767D097B7C7C030"
}'