Receive Responses From Customers

After receiving single- or multi-product messages, WhatsApp users can ask for more information about a product or place an order. These actions are communicated via messages webhook.

Message Status

Message status (sent, delivered, read) webhooks have the following format:

{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "id": "<WHATSAPP_BUSINESS_ACCOUNT_ID>",
      "changes": [
        {
          "value": {
            "messaging_product": "whatsapp",
            "metadata": {
              "display_phone_number": "<BUSINESS_DISPLAY_PHONE_NUMBER>",
              "phone_number_id": "<BUSINESS_PHONE_NUMBER_ID>"
            },
            "statuses": [
              {
                "id": "<WHATSAPP_MESSAGE_ID>",
                "recipient_id": "<WHATSAPP_USER_ID>",
                "status": "<MESSAGE_STATUS>",
                "timestamp": "<WEBHOOK_TIMESTAMP>",
                "conversation": {
                  "id": "<CONVERSATION_ID>",
                  "expiration_timestamp": "<CONVERSATION_EXPIRATION_TIMESTAMP>",
                  "origin": {
                    "type": "<CONVERSATION_ORIGIN>"
                  }
                },
                "pricing": {
                  "pricing_model": "CBP",
                  "billable": <IS_BILLABLE>,
                  "category": "<CONVERSATION_CATEGORY>"
                }
              }
            ]
          },
          "field": "messages"
        }
      ]
    }
  ]
}
PlaceholderDescriptionExample Value

<BUSINESS_DISPLAY_PHONE_NUMBER>

WhatsApp business display phone number.

15550783881

<BUSINESS_PHONE_NUMBER_ID>

WhatsApp business phone number ID.

106540352242922

<CONVERSATION_CATEGORY>

Indicates conversation category. Values can be:

authentication — Indicates conversation is an authentication conversation.

marketing — Indicates conversation is a marketing conversation.

service — Indicates conversation is service conversation.

utility — Indicates conversation is a utility conversation.

referral_conversion — Indicates conversation is a free entry point conversation.

service

<CONVERSATION_EXPIRATION_TIMESTAMP>

Unix timestamp indicating when the conversation will expire.

1723570080

<CONVERSATION_ID>

Conversation ID. Use this to track messages that are part of an existing conversation.

bc1c8848e7bb6118ea72231e07bf1d2c

<CONVERSATION_ORIGIN>

Indicates conversation category. Values can be:

authentication — Indicates conversation is an authentication conversation.

marketing — Indicates conversation is a marketing conversation.

service — Indicates conversation is service conversation.

utility — Indicates conversation is a utility conversation.

referral_conversion — Indicates conversation is a free entry point conversation.

service

<IS_BILLABLE>

Indicates if message is part of a billable conversation.

true

<MESSAGE_STATUS>

Message send status. Values can be:

delivered — Indicates message was delivered to WhatsApp client.

read — Indicates message was displayed in WhatsApp client.

sent — Indicates message was sent to WhatsApp user.

sent

<WEBHOOK_TIMESTAMP>

Unix timestamp indicating when the webhook was sent to your callback URL.

1723483654

<WHATSAPP_BUSINESS_ACCOUNT_ID>

WhatsApp Business Account ID.

102290129340398

<WHATSAPP_MESSAGE_ID>

WhatsApp message ID.

wamid.HBgLMTY0NjcwNDM1OTUVAgARGBIwNDM4QjExREVBMDgwMTRGNkMA

<WHATSAPP_USER_ID>

WhatsApp user ID.

16505551234

Asking For Information

Whenever a WhatsApp user receives a single- or multi-product message, they can ask for more information by sending you a text message (type is text) as a standard message in an existing WhatsApp thread, or by first tapping a Message Business or Message button when viewing a specific product.

The only difference between these messages webhook payloads is that if the message originated via a button on a product details page, a context property will be included, whose value is an object describing the product the user was viewing.

Text Messages Inquiry

{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "id": "<WHATSAPP_BUSINESS_ACCOUNT_ID>",
      "changes": [
        {
          "value": {
            "messaging_product": "whatsapp",
            "metadata": {
              "display_phone_number": "<BUSINESS_DISPLAY_PHONE_NUMBER>",
              "phone_number_id": "<BUSINESS_PHONE_NUMBER_ID>"
            },
            "contacts": [
              {
                "profile": {
                  "name": "<WHATSAPP_USER_NAME>"
                },
                "wa_id": "<WHATSAPP_USER_ID>"
              }
            ],
            "messages": [
              {

                /* The `context` property is only included if the user tapped a button
                   on the product details page to send you the message */
                "context": {
                  "from": "<BUSINESS_DISPLAY_PHONE_NUMBER>",
                  "id": "<CONTEXT_ID>",
                  "referred_product": {
                    "catalog_id": "<CATALOG_ID>",
                    "product_retailer_id": "<PRODUCT_ID>"
                  }
                },

                "from": "<WHATSAPP_USER_PHONE_NUMBER>",
                "id": "<WHATSAPP_MESSAGE_ID>",
                "timestamp": "<WEBHOOK_TIMESTAMP>",
                "text": {
                  "body": "<MESSAGE_TEXT>"
                },
                "type": "text"
              }
            ]
          },
          "field": "messages"
        }
      ]
    }
  ]
}
PlaceholderDescriptionExample Value

<BUSINESS_DISPLAY_PHONE_NUMBER>

WhatsApp business display phone number.

15550783881

<BUSINESS_PHONE_NUMBER_ID>

WhatsApp business phone number ID.

106540352242922

<CATALOG_ID>

Product catalog ID.

194836987003835

<CONTEXT_ID>

Message context ID.

wamid.HBgLMTY0NjcwNDM1OTUVAgARGA9wcm9kdWN0X2lucXVpcnkA

<MESSAGE_TEXT>

Message contents.

Does this come in additional sizes?

<PRODUCT_ID>

Product ID.

nqryix03ez

<WEBHOOK_TIMESTAMP>

Unix timestamp indicating when the webhook was sent to your callback URL.

1723483654

<WHATSAPP_BUSINESS_ACCOUNT_ID>

WhatsApp Business Account ID.

102290129340398

<WHATSAPP_MESSAGE_ID>

WhatsApp message ID.

wamid.HBgLMTY0NjcwNDM1OTUVAgARGBIwNDM4QjExREVBMDgwMTRGNkMA

<WHATSAPP_USER_ID>

WhatsApp user ID.

16505551234

<WHATSAPP_USER_NAME>

WhatsApp user name.

Pablo Morales

<WHATSAPP_USER_PHONE_NUMBER>

WhatsApp user phone number.

+16505551234

Placing an Order

When a WhatsApp user adds one or more products to their WhatsApp shopping cart and places an order, a messages webhook with type set to order will be triggered, describing the contents of the order. Use the order contents to fulfill the order.

{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "id": "<WHATSAPP_BUSINESS_ACCOUNT_ID>",
      "changes": [
        {
          "value": {
            "messaging_product": "whatsapp",
            "metadata": {
              "display_phone_number": "<BUSINESS_DISPLAY_PHONE_NUMBER>",
              "phone_number_id": "<BUSINESS_PHONE_NUMBER_ID>"
            },
            "contacts": [
              {
                "profile": {
                  "name": "<WHATSAPP_USER_NAME>"
                },
                "wa_id": "<WHATSAPP_USER_ID>"
              }
            ],
            "messages": [
              {
                "from": "<WHATSAPP_USER_PHONE_NUMBER>",
                "id": "<WHATSAPP_MESSAGE_ID>",
                "timestamp": "<WEBHOOK_TIMESTAMP>",
                "type": "order",
                "order": {
                  "catalog_id": "<CATALOG_ID>",
                  "text": "<MESSAGE_TEXT>",
                  "product_items": [
                    {
                      "product_retailer_id": "<PRODUCT_ID>",
                      "quantity": <PRODUCT_QUANTITY>,
                      "item_price": <PRODUCT_PRICE>,
                      "currency": "<PRODUCT_CURRENCY>"
                    }

                   /* Additional items would follow, if order contains multiple items */

                  ]
                }
              }
            ]
          },
          "field": "messages"
        }
      ]
    }
  ]
}
PlaceholderDescriptionExample Value

<BUSINESS_DISPLAY_PHONE_NUMBER>

WhatsApp business display phone number.

15550783881

<BUSINESS_PHONE_NUMBER_ID>

WhatsApp business phone number ID.

106540352242922

<CATALOG_ID>

Product catalog ID.

194836987003835

<MESSAGE_TEXT>

Message contents, if user included a message. If a message was not included, value will be an empty string.

Does this come in additional sizes?

<PRODUCT_ID>

Product ID.

nqryix03ez

<PRODUCT_CURRENCY>

Product currency code.

USD

<PRODUCT_PRICE>

Product price.

25

<PRODUCT_QUANTITY>

Product quantity.

1

<WEBHOOK_TIMESTAMP>

Unix timestamp indicating when the webhook was sent to your callback URL.

1723483654

<WHATSAPP_BUSINESS_ACCOUNT_ID>

WhatsApp Business Account ID.

102290129340398

<WHATSAPP_MESSAGE_ID>

WhatsApp message ID.

wamid.HBgLMTY0NjcwNDM1OTUVAgARGBIwNDM4QjExREVBMDgwMTRGNkMA

<WHATSAPP_USER_ID>

WhatsApp user ID.

16505551234

<WHATSAPP_USER_NAME>

WhatsApp user name.

Pablo Morales

<WHATSAPP_USER_PHONE_NUMBER>

WhatsApp user phone number.

+16505551234