Skip to content

Outgoing order message#

This section describes the messageData object incoming webhook format for an outgoing order (cart) message. For a description of the general format of incoming webhooks, refer to the Outgoing messages section.

To get incoming webhooks of this type, two conditions must be true:

typeWebhook = outgoingMessageReceived || outgoingAPIMessageReceived

messageData.typeMessage = orderMessage

Configuring an instance

To receive notifications about outgoing order messages, you need to enable the settings using one of the following options:

  1. Through the console enable the settings Receive notifications about messages sent from the phone and Receive notifications about messages sent via API, as well as the catalog notifications setting

  2. Through the SetSettings method enable the settings outgoingMessageWebhook, outgoingAPIMessageWebhook, and catalogWebhook

Getting order details

The orderId, token, and sellerJid fields from this notification contain the data required to call the GetOrderDetails method, which returns the full contents of the order.

Webhook#

Webhook parameters#

messageData object parameters

Parameter Type Description
typeMessage string Sent message type. For messages of this type, the field takes the value: orderMessage
orderMessage object Order data object

orderMessage object parameters

Parameter Type Description
orderId string Order identifier. Used in the GetOrderDetails method
token string Order access token. Used in the GetOrderDetails method
totalPrice string Total order price (in minor currency units, e.g., 250000 = 2500.00 RUB)
totalCurrencyCode string Order currency code in ISO 4217 format (e.g., RUB)
sellerJid string JID of the seller who owns the catalog, in the format 79876543210@c.us. Used in the GetOrderDetails method
itemsCount integer Number of items in the order
jpegThumbnail string Order image preview in base64

Webhook body example#

{
  "typeWebhook": "outgoingAPIMessageReceived",
  "idMessage": "3EB00DAD87A9587390FE46",
  "instanceData": {
    "idInstance": 1101111111,
    "wid": "79876543210@c.us",
    "typeInstance": "whatsapp"
  },
  "timestamp": 1783335526,
  "senderData": {
    "chatId": "79001234567@c.us",
    "sender": "79876543210@c.us",
    "senderName": "Seller",
    "senderContactName": "Seller",
    "chatName": "Ivan"
  },
  "messageData": {
    "typeMessage": "orderMessage",
    "orderMessage": {
      "orderId": "1300936245456254",
      "token": "AeBZD0f8NlE/H8JVglqhlYLaQq4r9PoaTKCJmT9csclblQ==",
      "totalPrice": "250000",
      "totalCurrencyCode": "RUB",
      "sellerJid": "79876543210@c.us",
      "itemsCount": 1,
      "jpegThumbnail": "/9j/2wCEAAEBAQ="
    }
  }
}