SendOrder#
The method is designed to send an order from a buyer to a store.
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 an order, you need to send a request to the address:
POST
{{apiUrl}}/waInstance{{idInstance}}/sendOrder/{{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 |
productIds | array | Yes | Array of product identifiers included in the order |
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",
"productIds": ["26437451389197252", "25789428137398187"],
"quotedMessageId": "3EB0C767D097B7C7C030"
}
Response#
Response fields#
| Field | Type | Description |
|---|---|---|
idMessage | string | Unique identifier of the sent message |
Response body example#
{
"idMessage": "BAE550673B9C0497"
}
SendOrder errors#
For a list of common errors for all methods, see the section Common errors
Code examples#
import requests
url = "{{apiUrl}}/waInstance{{idInstance}}/sendOrder/{{apiTokenInstance}}"
payload = {
"chatId": "79876543210@c.us",
"productIds": ["26437451389197252", "25789428137398187"],
"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}}/sendOrder/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"chatId": "79876543210@c.us",
"productIds": ["26437451389197252", "25789428137398187"],
"quotedMessageId": "3EB0C767D097B7C7C030"
}'