We are making changes to the WhatsApp Business Platform pricing model. See Pricing Updates on the WhatsApp Business Platform.
This document describes single-product message (MPM) templates, their uses, and how to create them.
SPM templates are marketing templates that allow you to present a single product from your ecommerce catalog, accompanied by a product image, product title, and product price (all pulled from your product within your catalog), along with customizable body text, optional footer text, and an interactive View button.
WhatsApp users can tap the button to see details about the product, and can add or remove the product from the WhatsApp shopping cart:
If the WhatsApp user adds the product to the carts and submits an order, you will be notified via webhook and the user will see that an order has been placed:
Users who place an order are also able to use the View details button to see information about the order:
You must have an ecommerce product catalog, with inventory, connected to your WhatsApp Business Account. See the Cloud API Commerce guide to learn more about connecting a catalog to your account.
When a customer adds one or more products to their cart and submits an order, we will send you a webhook that describes the order.
Use the POST /<WHATSAPP_BUSINESS_ACCOUNT_ID>/message_templates endpoint to create an SPM template.
POST /<WHATSAPP_BUSINESS_ACCOUNT_ID>/message_templates
{ "name": "<TEMPLATE_NAME>", "language": "<TEMPLATE_LANGUAGE>", "category": "marketing", "components": [ { "type": "header", "format": "product" }, { "type": "body", "text": "<CARD_BODY_TEXT>", "example": { "body_text": [ [ "<CARD_BODY_TEXT_VARIABLE_EXAMPLE>", "<CARD_BODY_TEXT_VARIABLE_EXAMPLE>" ] ] } }, { "type": "footer", "text": "<CARD_FOOTER_TEXT>" }, { "type": "buttons", "buttons": [ { "type": "spm", "text": "View" } ] } ] }
Placeholder | Description | Example Value |
---|---|---|
String | Required. Card body text. Supports variables. Maximum 160 characters. |
|
String | Required if card body text uses variables. Card body text example variable string(s). Number of strings must match the number of variable placeholders in the card body text string. If card body text uses a single variable, |
|
String | Optional. Footer text. |
|
String | Required. Template language and locale code. |
|
String | Required. Template name. Maximum 512 characters. |
|
curl 'https://graph.facebook.com/v21.0
/102290129340398/message_templates' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
"name": "abandoned_cart_offer",
"language": "en_US",
"category": "marketing",
"components": [
{
"type": "header",
"format": "product"
},
{
"type": "body",
"text": "Use code {{1}} to get {{2}} off our newest succulent!",
"example": {
"body_text": [
[
"25OFF",
"25%"
]
]
}
},
{
"type": "footer",
"text": "Offer ends September 30, 2024"
},
{
"type": "buttons",
"buttons": [
{
"type": "spm",
"text": "View"
}
]
}
]
}'
Once your SPM template has been approved, you can use Cloud API to send it in a template message.