Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/rahul-baberwal/django-meta-whatsapp/llms.txt

Use this file to discover all available pages before exploring further.

django-meta-whatsapp integrates with Meta Commerce catalogs, letting you sync your product inventory locally and send interactive product messages — single product cards, product lists, full catalog messages, and scrollable carousels.

WhatsAppCatalogProduct Model Fields

Each synced product is stored as a WhatsAppCatalogProduct record:
FieldTypeDescription
accountForeignKeyThe WhatsAppAccount this product belongs to
catalog_idCharFieldThe Meta Commerce Catalog ID
retailer_idCharFieldYour internal product ID (Meta’s retailer_id)
nameCharFieldProduct display name
priceCharFieldPrice string including currency (e.g. "1500 INR")
image_urlURLFieldProduct image URL pulled from Meta
is_activeBooleanFieldWhether the product is active in the local mirror
synced_atDateTimeFieldTimestamp of the last successful sync (auto_now=True)
Products are uniquely identified by the combination of (account, catalog_id, retailer_id).

Syncing the Catalog

Before you can send product messages, sync your catalog from Meta to populate the local WhatsAppCatalogProduct table. Step 1: Set the default_catalog_id on your WhatsAppAccount record in the dashboard at /whatsapp/settings/accounts/. Step 2: Trigger a sync from the UI at /whatsapp/catalog/sync/, or do it programmatically:
from django_meta_whatsapp.utils import sync_catalog_products
from django_meta_whatsapp.models import WhatsAppAccount

account = WhatsAppAccount.objects.get(pk=1)
result = sync_catalog_products(catalog_id="123456789", account=account)
print(f"Synced {result['synced']} products")
The sync function paginates through all products in the catalog (100 per page) and uses update_or_create to upsert each product locally. Re-running it is safe and idempotent.

Sending Product Messages

django-meta-whatsapp provides four dedicated functions for sending interactive product messages via the Meta Cloud API.

Single Product

Send a single product card with a body text and optional footer. The recipient sees the product image, name, and price with an Add to Cart button.
from django_meta_whatsapp.utils import send_single_product_message

send_single_product_message(
    phone_number="919876543210",
    catalog_id="123456789",
    retailer_id="SKU-001",
    body="Check out this item!",
    footer="Limited stock",
    account=account
)

Product List (Multi-Section)

Send a scrollable product list organised into named sections. Each section can contain multiple products identified by their product_retailer_id.
from django_meta_whatsapp.utils import send_multi_product_message

sections = [
    {
        "title": "Best Sellers",
        "product_items": [
            {"product_retailer_id": "SKU-001"},
            {"product_retailer_id": "SKU-002"},
        ]
    }
]
send_multi_product_message(
    phone_number="919876543210",
    catalog_id="123456789",
    sections=sections,
    header="Our Products",
    body="Browse our top picks",
    footer="Free shipping over ₹500",
    account=account
)

Full Catalog

Send a catalog message that lets the recipient browse your entire catalog. A single product is shown as the thumbnail that the recipient taps to open the full catalog.
from django_meta_whatsapp.utils import send_catalog_message

send_catalog_message(
    phone_number="919876543210",
    thumbnail_retailer_id="SKU-001",  # product shown as catalog thumbnail
    body="Browse our full collection",
    footer="Tap to explore",
    account=account
)
Send a horizontally scrollable carousel of individual product cards. Pass a list of retailer_id values and the recipient can swipe through each product.
from django_meta_whatsapp.utils import send_product_carousel_message

send_product_carousel_message(
    phone_number="919876543210",
    catalog_id="123456789",
    retailer_ids=["SKU-001", "SKU-002", "SKU-003"],
    body="Swipe through our featured products",
    account=account
)
Send a plain text message containing a direct link to your WhatsApp catalog storefront. The link opens the catalog inside WhatsApp on the recipient’s device.
from django_meta_whatsapp.utils import send_catalog_link_message

send_catalog_link_message(
    phone_number="919876543210",
    wa_number="919876543210",  # your WhatsApp Business phone number (no +)
    account=account
)
# Sends: "Browse our full catalog here: https://wa.me/c/919876543210"

Managing Products in the UI

The catalog product list is available at /whatsapp/catalog/. From there you can:
  • Add a product manually with its catalog_id, retailer_id, name, price, and image URL
  • Edit an existing product’s details
  • Delete a product from the local mirror
  • Sync all products from Meta at /whatsapp/catalog/sync/ — this pulls the latest product data and upserts it into the local database

Build docs developers (and LLMs) love