WhatsApp product messages are interactive messages that pull items from a Meta catalog. interactive.type is product for one item, product_list for up to 30 and catalog_message for the whole catalog. When the customer sends a cart, an order webhook arrives. All three are service messages, so they go out only while a conversation with the customer is open.
What you need before the first send
You need a catalog in Meta’s commerce tools, connected to your phone number’s account. Meta’s catalog message page requires “inventory uploaded to Meta in an ecommerce catalog connected to your WhatsApp account hierarchy” (Meta catalog messages, accessed 2026-11-04).
Meta allows one catalog per WhatsApp account hierarchy (Meta upload inventory, accessed 2026-11-04). You create it in Commerce Manager or through the Commerce API. For the connection step, that page links to Help Center and documents no Graph API call. A Solution Partner can connect the catalog in WhatsApp Manager if the client grants permission.
Each product has a product_retailer_id, the item ID that product payloads reference. Meta’s catalogs overview also requires compliance with the Commerce and Business Policies, and adds online-selling rules for businesses based in India (Meta catalogs overview, accessed 2026-11-04).
Turn the cart and storefront on per number
Commerce settings belong to each business phone number, through /<BUSINESS_PHONE_NUMBER_ID>/whatsapp_commerce_settings (Meta commerce settings, accessed 2026-11-04). Both fields are query parameters on a POST, and a GET reads the current values.
| Field | Default | When false |
|---|---|---|
is_cart_enabled |
true |
Customers can still view products, but cart buttons are hidden |
is_catalog_visible |
false |
The storefront icon and catalog buttons are hidden, and catalog links show “Invalid catalog link” |
Check is_catalog_visible first if a catalog message renders as a broken link.
The four product message types
Meta documents three interactive product types in the Messages API reference (Meta Messages API reference, accessed 2026-11-04), plus a product carousel on its own page.
| Message | interactive.type |
What it shows | Limits Meta states |
|---|---|---|---|
| Single product | product |
One item | Header “Cannot be set”; body and footer optional |
| Multi-product | product_list |
Items in sections | Up to 30 products; text header required; section title max 24 characters |
| Catalog message | catalog_message |
The whole catalog | Body required, max 1024; footer max 60 |
| Product carousel | carousel |
Swipeable product cards | 2 to 10 cards; no header, footer or buttons |
Reply buttons and lists are in interactive buttons and list messages.
For a single product, action “Must include both catalog_id and product_retailer_id” (Meta single-product messages, accessed 2026-11-04). If the item doesn’t match your catalog, Meta returns an error and the message isn’t sent.
The multi-product page says you can “display up to 30 products from your catalog” (Meta multi-product messages, accessed 2026-11-04). The Messages API reference marks the section title “Required if the message has more than one section.” If no item matches, the API returns an error. If at least one matches, the message goes out and Meta drops the unmatched items.
Neither page gives a cap on sections for this interactive message. The 10-section figure comes from Meta’s multi-product template page, which says “up to 10 sections” and 30 products across them (Meta MPM templates, accessed 2026-11-04). Meta doesn’t state that cap for the interactive version.
Meta’s curl examples on both pages are malformed: - d with a space, a // comment in place of the body and unbalanced braces. This is Meta’s product_list interactive object instead, with its ... placeholder lines removed so it parses.
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "PHONE_NUMBER",
"type": "interactive",
"interactive": {
"type": "product_list",
"header": {
"type": "text",
"text": "HEADER_CONTENT"
},
"body": {
"text": "BODY_CONTENT"
},
"footer": {
"text": "FOOTER_CONTENT"
},
"action": {
"catalog_id": "CATALOG_ID",
"sections": [
{
"title": "SECTION_TITLE",
"product_items": [
{ "product_retailer_id": "PRODUCT-SKU" },
{ "product_retailer_id": "PRODUCT-SKU" }
]
},
{
"title": "SECTION_TITLE",
"product_items": [
{ "product_retailer_id": "PRODUCT-SKU" },
{ "product_retailer_id": "PRODUCT-SKU" }
]
}
]
}
}
}
A catalog message sets both type and action.name to catalog_message. thumbnail_product_retailer_id in action.parameters picks the header image. Without it, WhatsApp uses the first item in the catalog. Meta’s example on that page still calls v17.0. The script uses v26.0, the version on the other catalog pages.
The product carousel has its own page (Meta product carousel, accessed 2026-11-04). Meta says “You must add two card objects to your message, and can add a maximum of 10.” All cards use the same catalog_id. The script below doesn’t build carousels.
Send product messages from Python
This script sends the three main types, reads and changes commerce settings, and parses order webhooks. Payloads follow Meta’s interactive objects. It needs Python 3.9 or later and requests.
# product_messages.py
import json
import os
import sys
import requests
GRAPH_VERSION = os.environ.get("GRAPH_VERSION", "v26.0")
MAX_PRODUCTS = 30 # multi-product limit on Meta's page
SETTINGS = {"is_cart_enabled", "is_catalog_visible"}
def graph(method, path, **kwargs):
url = f"https://graph.facebook.com/{GRAPH_VERSION}/{path}"
headers = {"Authorization": f"Bearer {os.environ['WHATSAPP_TOKEN']}"}
r = requests.request(method, url, headers=headers, timeout=10, **kwargs)
try:
data = r.json()
except ValueError: # a non-JSON error page
r.raise_for_status()
raise
if not r.ok or "error" in data:
err = data.get("error", {})
sys.exit(f"HTTP {r.status_code}, code {err.get('code')}: {err.get('message')}")
return data
def send(to, interactive):
payload = {
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": to,
"type": "interactive",
"interactive": interactive,
}
data = graph("POST", f"{os.environ['PHONE_NUMBER_ID']}/messages", json=payload)
return data["messages"][0]["id"]
def product(catalog_id, retailer_id, body=None):
interactive = {
"type": "product", # no header allowed on this type
"action": {"catalog_id": catalog_id, "product_retailer_id": retailer_id},
}
if body:
interactive["body"] = {"text": body}
return interactive
def product_list(catalog_id, header, body, sections):
total = sum(len(ids) for _, ids in sections)
if total > MAX_PRODUCTS:
raise ValueError(f"{total} products, Meta allows up to {MAX_PRODUCTS}")
for title, _ in sections:
if len(title) > 24:
raise ValueError(f"section title over 24 characters: {title}")
return {
"type": "product_list",
"header": {"type": "text", "text": header},
"body": {"text": body},
"action": {
"catalog_id": catalog_id,
"sections": [
{"title": title, "product_items": [{"product_retailer_id": i} for i in ids]}
for title, ids in sections
],
},
}
def catalog_message(body, thumbnail_id=None):
action = {"name": "catalog_message"}
if thumbnail_id:
action["parameters"] = {"thumbnail_product_retailer_id": thumbnail_id}
return {"type": "catalog_message", "body": {"text": body}, "action": action}
def commerce_settings(changes):
path = f"{os.environ['PHONE_NUMBER_ID']}/whatsapp_commerce_settings"
if changes:
return graph("POST", path, params=changes) # values as "true" or "false"
return graph("GET", path)
def parse_event(event):
found = []
for entry in event.get("entry", []):
for change in entry.get("changes", []):
for msg in change.get("value", {}).get("messages", []):
sender = msg.get("from") or msg.get("from_user_id")
if msg.get("type") == "order":
order = msg["order"]
totals = {}
for item in order.get("product_items", []):
cost = item["quantity"] * item["item_price"]
totals[item["currency"]] = totals.get(item["currency"], 0) + cost
found.append({
"type": "order",
"message_id": msg["id"],
"sender": sender,
"catalog_id": order.get("catalog_id"),
"items": order.get("product_items", []),
"computed_totals": totals,
"text": order.get("text"),
})
elif msg.get("type") == "text":
product_ref = msg.get("context", {}).get("referred_product")
if product_ref:
found.append({
"type": "product_question",
"message_id": msg["id"],
"sender": sender,
"product": product_ref,
"text": msg.get("text", {}).get("body"),
})
return found
def parse_sections(args):
sections = []
for arg in args: # "Title=SKU1,SKU2"
title, _, ids = arg.partition("=")
sections.append((title, [i for i in ids.split(",") if i]))
return sections
USAGE = (
"usage: product_messages.py product TO CATALOG_ID RETAILER_ID [BODY]"
" | list TO CATALOG_ID HEADER BODY TITLE=SKU1,SKU2 [...]"
" | catalog TO BODY [THUMBNAIL_RETAILER_ID]"
" | settings [is_cart_enabled=true|false] [is_catalog_visible=true|false]"
" | parse FILE"
)
if __name__ == "__main__":
args = sys.argv[1:]
cmd = args[0] if args else ""
if cmd == "product" and len(args) >= 4:
print("accepted:", send(args[1], product(*args[2:5])))
elif cmd == "list" and len(args) >= 6:
interactive = product_list(args[2], args[3], args[4], parse_sections(args[5:]))
print("accepted:", send(args[1], interactive))
elif cmd == "catalog" and len(args) >= 3:
print("accepted:", send(args[1], catalog_message(*args[2:4])))
elif cmd == "settings":
changes = dict(a.partition("=")[::2] for a in args[1:])
if not set(changes) <= SETTINGS or not set(changes.values()) <= {"true", "false"}:
sys.exit(USAGE)
print(json.dumps(commerce_settings(changes)))
elif cmd == "parse" and len(args) == 2:
with open(args[1]) as f:
for item in parse_event(json.load(f)):
print(json.dumps(item))
else:
sys.exit(USAGE)
Run it with your token, number ID and catalog ID.
pip install requests
export WHATSAPP_TOKEN="ACCESS_TOKEN"
export PHONE_NUMBER_ID="PHONE_NUMBER_ID"
python product_messages.py settings is_catalog_visible=true
python product_messages.py product +16505551234 CATALOG_ID RETAILER_ID "Back in stock"
python product_messages.py list +16505551234 CATALOG_ID "Our picks" "Tap an item to see details" "Plants=SKU1,SKU2" "Pots=SKU3"
python product_messages.py catalog +16505551234 "Browse the full catalog here." RETAILER_ID
Meta’s interactive message pages say “Interactive messages do not require templates or pre-approvals.” They also say these messages “can only be sent as part of existing chat threads”. Outside the customer service window, send a template instead (error 131047). The template routes are multi-product templates, catalog templates and carousel templates with product cards.
If the customer’s WhatsApp app is too old, they see a notice and you get a webhook saying the message couldn’t be delivered. Meta’s pages don’t give the error code for this case.
Parse the order webhook
When the customer sends a cart, Meta’s order webhook “describes the contents of the order” (Meta order webhook, accessed 2026-11-04). It fires for orders from a catalog, single-product or multi-product message. Each item carries product_retailer_id, quantity, item_price and currency.
The test file below is not one Meta sample. Its messages[0] is Meta’s order example, and the envelope around it comes from Meta’s location webhook sample. Save it as order.json.
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "102290129340398",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "15550783881",
"phone_number_id": "106540352242922"
},
"contacts": [
{
"profile": {
"name": "Sheena Nelson"
},
"wa_id": "16505551234"
}
],
"messages": [
{
"from": "16505551234",
"id": "wamid.HBgLMTY1MDM4Nzk0MzkVAgASGBQzQUFERjg0NDEzNDdFODU3MUMxMAA=",
"timestamp": "1750096325",
"type": "order",
"order": {
"catalog_id": "194836987003835",
"text": "Love these!",
"product_items": [
{
"product_retailer_id": "di9ozbzfi4",
"quantity": 2,
"item_price": 30,
"currency": "USD"
},
{
"product_retailer_id": "nqryix03ez",
"quantity": 1,
"item_price": 25,
"currency": "USD"
}
]
}
}
]
},
"field": "messages"
}
]
}
]
}
python product_messages.py parse order.json
The parser prints computed_totals as {"USD": 85}. Meta’s field list has no order total, so the script multiplies quantity by item price. Check prices against your own system before you charge.
A customer can add “up to 99 units of each single catalog item” to a cart, and the cart stays in the chat until they send it. An order is an inbound message, so by Meta’s window rule it should start or reset the 24-hour window. The order webhook page doesn’t say so directly.
Questions about a product arrive as ordinary text messages (Meta text webhook, accessed 2026-11-04). If the customer tapped a “Message business” button, context.referred_product holds the catalog_id and product_retailer_id. The parser reports those messages as product_question. The sender comes from from, with from_user_id as the fallback, as in the FastAPI webhook receiver.
Z-API Omni team