Send order payment update
#
Method#
/order-payment-updatePOST
https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/order-payment-update
#
HeaderKey | Value |
---|---|
Client-Token | ACCOUNT SECURITY TOKEN |
#
ConceptIn this method, you can send messages to update the payment status of previously sent orders.
Important
This method is available only for WhatsApp Business accounts.
#
Attributes#
RequiredAttributes | 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 |
messageId | string | ID of the original WhatsApp message of the order |
referenceId | string | Reference ID of the order (returned in the webhook) |
orderRequestId | string | Order request reference ID (returned in the webhook) |
orderStatus | string | Current order status (pending, processing, shipped, completed, canceled) (returned in the webhook) |
paymentStatus | string | New payment status (pending, paid) |
order | object | Information about the order to be sent |
Object (order)
Attributes | Type | Description |
---|---|---|
currency | string | Currency code |
products | array object | Information about products related to the order |
Object (products)
Attributes | Type | Description |
---|---|---|
productId | string | Product ID (returned in the webhook) |
name | string | Product name |
value | number | Product value |
quantity | number | Quantity |
isCustomItem | boolean | Indicates if it's a custom product at the time of sending (returned in the webhook) |
#
OptionalAtributos | Tipo | Descrição |
---|---|---|
message | string | Text message |
Object (order)
Attributes | Type | Description |
---|---|---|
discount | number | Discount amount |
tax | number | Tax amount |
shipping | number | Shipping cost |
#
Request BodyCaution
In the request, you must include all the data previously provided when sending the order, with the addition of some mandatory additional parameters, which are returned in the webhook.
Tip
You can notice that the product with the "isCustomItem" attribute set to true has an ID with the "custom-item" prefix. This occurs when no product ID is provided when sending an order, meaning WhatsApp assumes it's a custom product. This ID is returned in the webhook and is a mandatory parameter, along with "isCustomItem," for order updates.
#
Response#
200Attributes | 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)