We are making changes to the WhatsApp Business Platform pricing model. See Pricing Updates on the WhatsApp Business Platform.

Sending Single-Product Template Messages

This document explains how to send an approved single-product message (SPM) template to a WhatsApp user.

Request Syntax

Use the POST /<BUSINESS_PHONE_NUMBER_ID>/messages endpoint to send an SPM template message.

POST /<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>/messages

Post Body

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "<WHATSAPP_USER_PHONE_NUMBER>",
  "type": "template",
  "template": {
    "name": "<TEMPLATE_NAME>",
    "language": {
      "policy": "deterministic",
      "code": "<TEMPLATE_LANGUAGE>"
    },
    "components": [
      {
        "type": "header",
        "parameters": [
          {
            "type": "product",
            "product": {
              "product_retailer_id": "<PRODUCT_ID>",
              "catalog_id": "<CATALOG_ID>"
            }
          }
        ]
      },
      {
        "type": "body",
        "parameters": [
          <CARD_BODY_VARIABLE>,
          <CARD_BODY_VARIABLE>
        ]
      }
    ]
  }
}

Post Body Parameters

PlaceholderDescriptionExample Value

<CARD_BODY_VARIABLE>

Object

Required if the template card body text uses variables, otherwise omit.

Object describing a card body variable. If the template uses multiple variables, you must define an object for each variable.

Supports text, currency, and date_time types. See Messages Parameters.

There is no maximum character limit on this value, but does count against the card body text limit of 160 characters.

{
  "type":"text",
  "text": "25OFF"
}

<CATALOG_ID>

String

Required.

ID of connected ecommerce catalog containing the product.

194836987003835

<PRODUCT_ID>

String

Required.

Product ID.

nqryix03ez

<TEMPLATE_LANGUAGE>

String

Required.

Template language and locale code.

en_US

<TEMPLATE_NAME>

String

Required.

Template name.

Maximum 512 characters.

abandoned_cart_offer

<WHATSAPP_USER_PHONE_NUMBER>

String

Required.

WhatsApp user phone number.

+16505551234

Example Request

This example sends an approved template named "abandoned_cart_offer" which injects two text variables (an offer code and the percentage discounted) into the template body, and which includes a footer. The product image is pulled from the catalog and displayed in the message header.

curl 'https://graph.facebook.com/v21.0/179776755229976/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "+16505551234",
  "type": "template",
  "template": {
    "name": "abandoned_cart_offer",
    "language": {
      "policy": "deterministic",
      "code": "en_US"
    },
    "components": [
      {
        "type": "header",
        "parameters": [
          {
            "type": "product",
            "product": {
              "product_retailer_id": "nqryix03ez",
              "catalog_id": "194836987003835"
            }
          }
        ]
      },
      {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "text": "25OFF"
          },
          {
            "type": "text",
            "text": "25%"
          }
        ]
      }
    ]
  }
}'