Send order message
#
Method#
/send-orderPOST
https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/send-order
#
HeaderKey | Value |
---|---|
Client-Token | ACCOUNT SECURITY TOKEN |
#
ConceptWith this method, you can send order messages containing products from your catalog or custom products created at the time of sending.
Important
This method is available only for WhatsApp Business accounts.
#
Attributes#
RequiredAttribute | Type | Description |
---|---|---|
phone | string | Recipient's phone number in the format DDI DDD NUMBER, e.g., 551199999999. IMPORTANT: Send only numbers, without formatting or masks. |
order | object | Information about the order to be sent |
Object (order)
Attribute | Type | Description |
---|---|---|
currency | string | Currency code |
products | array object | Information about products related to the order |
Object (products)
Attribute | Type | Description |
---|---|---|
name | string | Product name |
value | number | Product value |
quantity | number | Quantity |
#
OptionalObject (order)
Attribute | Type | Description |
---|---|---|
discount | number | Discount amount |
tax | number | Tax amount |
shipping | number | Shipping cost |
Object (products)
Attribute | Type | Description |
---|---|---|
productId | string | Catalog product ID |
#
Request Body#
Including optional parameters#
Only required parametersTip
When sending a product in the "products" list without the "productId" attribute, it is considered a "custom product." It receives an ID to be used in the context of this order, which is returned in the webhook of ReceivedCallback and should be used for order status updates.
#
Response#
200Attribute | Type | Description |
---|---|---|
zaapId | string | z-api ID |
messageId | string | WhatsApp ID |
id | string | Added for compatibility with Zapier; it has the same value as messageId |
Example
#
405In this case, ensure that you are correctly following the method specification, i.e., check if you sent the POST or GET as specified at the beginning of this topic.
#
415If you receive a 415 error, make sure to add the "Content-Type" of the object you are sending to the request headers, which is usually "application/json."
#
Webhook ResponseLink to the webhook response (upon receiving)