After receiving Multi or Single product messages, users can: ask for more information about a product, add products to a shopping cart, and place an order. The best way to track a customer’s response to a message is by checking the webhooks alerts received for a specific message.
After sending a message, you get a message status notification webhook mentioning the status of that message. A sample webhook for successfully sent business-initiated conversation looks like this:
{ "object": "whatsapp_business_account", "entry": [{ "id": "WHATSAPP_BUSINESS_ACCOUNT_ID", "changes": [{ "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "PHONE_NUMBER", "phone_number_id": "PHONE_NUMBER_ID" }, "statuses": [{ "id": "wamid.ID", "recipient_id": "PHONE_NUMBER", "status": "sent", "timestamp": "TIMESTAMP", "conversation": { "id": "CONVERSATION_ID", "expiration_timestamp": TIMESTAMP, "origin": { "type": "business_initated" } }, "pricing": { "pricing_model": "CBP", "billable": true, "category": "business_initated" } }] }, "field": "messages" }] }] }
Save that message ID to track how customers are receiving that message.
Whenever a customer receives a Multi or Single Product Message, they can ask for more information about that specific product. There are two ways customers can use to ask for information:
Once the customer sends a question, the business gets an inbound message webhook notification. These notifications include a messages object with the following components:
Component | Description |
---|---|
| For this use case, type will be set to |
| The question and/or comments raised by the customer. |
| Information about the product being mentioned by the customer. You can see a product’s unique identifier as well as their catalog ID. |
The webhook will look like this:
{ "object": "whatsapp_business_account", "entry": [ { "id": "ID", "changes": [ { "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "PHONE_NUMBER", "phone_number_id": "PHONE_NUMBER_ID", }, "contacts": [ { "profile": { "name": "NAME" }, "wa_id": "PHONE_NUMBER_ID" } ], "messages": [ { "from": "PHONE_NUMBER", "id": "wamid.ID", "text": { "body": "MESSAGE_TEXT" }, "context": { "from": "PHONE_NUMBER", "id": "wamid.ID", "referred_product": { "catalog_id": "CATALOG_ID", "product_retailer_id": "PRODUCT_ID" } }, "timestamp": "TIMESTAMP", "type": "text" } ] }, "field": "messages" } ] } ] }
Use the webhook information to respond to the customer's query.
Once customers have added a product to their shopping cart, they can send that cart to the business to complete the order. A business knows they have received an order by keeping up with their webhook notifications.
These notifications are of the order
type and they include a messages object with the following components:
Component | Description |
---|---|
| For this use case, type will be set to |
| Information about the products added to the customer’s shopping cart. The order object contains the catalog ID and an array called |
The webhook will look like this:
{ "object": "whatsapp_business_account", "entry": [ { "id": "8856996819413533", "changes": [ { "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "16505553333", "phone_number_id": "phone-number-id", }, "contacts": [ { "profile": { "name": "Kerry Fisher" }, "wa_id": "16315551234" } ], "messages": [ { "from": "16315551234", "id": "wamid.ABGGFlCGg0cvAgo6cHbBhfK5760V", "order": { "catalog_id": "the-catalog_id", "product_items": [ { "product_retailer_id":"the-product-SKU-identifier", "quantity":"number-of-item", "item_price":"unitary-price-of-item", "currency":"price-currency" }, ... ], "text":"text-message-sent-along-with-the-order" }, "context": { "from": "16315551234", "id": "wamid.gBGGFlaCGg0xcvAdgmZ9plHrf2Mh-o" }, "timestamp": "1603069091", "type": "order" } ] }, "field": "messages" } ] } ] }
Use the webhook information to prepare the customer's order.