WhatsApp· 7 min read

Accept WhatsApp payments in India: order_details and UPI


To collect a payment inside a WhatsApp chat in India, send an interactive order_details message whose payment_settings points to a UPI intent link or a linked payment gateway. The customer taps Review and Pay, then pays in a UPI app or the gateway’s checkout. The amount is in paise and the currency can only be INR. For UPI, Meta now recommends a dynamic UPI intent link over the older payment configuration. Meta’s payments pages carry no update date, so recheck them before you launch.

Pick one of Meta’s three integration modes

Meta’s overview describes three modes, and they differ in who reports the payment and who refunds it (Meta Payments API India overview, accessed 2026-11-04).

Mode Gateways Status shown in chat WhatsApp status webhooks Refunds through WhatsApp
UPI Intent and Payment Links Your own gateway, if it can generate UPI intents or payment links No, you send order_status No No
Payment Gateway Deep Integration “Razorpay, PayU, Billdesk, and Zaakpay only” Yes Yes Yes
Enhanced Payment Links Razorpay, PayU or Cashfree links in a template Yes, the card updates itself No, the gateway reports No, the gateway refunds

Tickets fit Deep Integration, or UPI Intent when your gateway isn’t on the list. Bill and subscription reminders fit Enhanced Payment Links for the fastest launch, or Deep Integration when you need refunds and status inside WhatsApp. Enhanced Payment Links is a template with one dynamic URL button and no header (Enhanced payment links, accessed 2026-11-04), close to URL buttons with a dynamic suffix. Meta says “Payment links are currently available on a limited-access basis”, and PayU and Cashfree links need allowlisting through your Solution Partner.

What has to be in place first

Every mode needs the merchant’s order trigger APIs or CSVs, plus payment posting APIs to close orders. Deep Integration needs the gateway account owner to authorize linking it to Meta Business Suite. UPI Intent needs the VPA, merchant category code and purpose code from your gateway.

The Messaging account must accept the WhatsApp Payments terms of service. Until it does, sends fail with 134011 “WhatsApp Payments terms of service has not been accepted”, and error_data.details carries the acceptance link. The onboarding APIs return 131005 “Access denied” for the same reason (onboarding APIs).

Meta’s merchant checklist asks for a verified business with a verified check on the WhatsApp contact, and customer support details on the profile screen. It also mentions a merchant-initiated messaging tier in older wording; read the current levels in messaging limits. The pages we read state no other eligibility rule, such as a required country of registration.

The UPI page tells businesses on “the older payment configuration method” to “plan to migrate to dynamic VPA” (UPI Intent dynamic VPA, accessed 2026-11-04). The gateway page’s checklist also says to migrate to payment_settings in place of payment_type and payment_configuration. In this mode, payment_settings holds one entry of type upi_intent_link with the full upi://pay link.

Meta states that “The UPI intent only supports the following “&” separated attributes- pa, pn, mc, purpose, and tr”. The same page’s example link also carries am, cu, mode and tn. Build the link with the five listed attributes and confirm the format with your gateway.

These are the order_details rules from the UPI and gateway pages (payment gateway integration).

Field Rule
action.name review_and_pay
reference_id Required, unique per business, case-sensitive, up to 35 letters, digits, _, - or .. Add a suffix for resends, e.g. BM345A-12
type digital-goods or physical-goods. Shipped physical goods need beneficiaries with a 6-digit postal_code and country India
currency INR only
Amounts Integer value in paise, offset always 100
total_amount subtotal + tax + shipping - discount
subtotal Sum of item amount × quantity, using sale_amount when present
order.status Only pending
order.items[] name up to 60 characters, integer quantity. Without catalog_id, country_of_origin, importer_name and importer_address are required
order.expiration Optional, timestamp in UTC seconds at least 300 s ahead, description up to 120
body.text / footer.text Up to 1024 / up to 60 characters

UPI transactions are capped at ₹5,00,000, and an optional order.type of quick_pay shows only Pay Now.

The function below builds the payload from that field reference and Meta’s UPI sample, and refuses to return one whose arithmetic doesn’t add up. Meta’s sample totals 21000, but each item carries a sale_amount of 100 while the subtotal uses the full 10000 amounts. By Meta’s own subtotal rule that sample is wrong, so this version drops sale_amount and keeps the 21000 total. It covers digital goods; shipped physical goods would also need beneficiaries.

# order_details.py. Print: python3 order_details.py
# Send:  PHONE_NUMBER_ID=... ACCESS_TOKEN=... TO=RECIPIENT_PHONE python3 order_details.py
import json
import os
import re
import time
import urllib.error
import urllib.parse
import urllib.request

GRAPH = "https://graph.facebook.com/v26.0"
UPI_CAP = 5_00_000 * 100  # Rs 5,00,000 in paise
REF_ID = re.compile(r"[A-Za-z0-9_.-]{1,35}")
IMPORTER_KEYS = ("country_of_origin", "importer_name", "importer_address")


def money(paise):
    if not isinstance(paise, int) or paise < 0:
        raise ValueError(f"amounts are non-negative integers in paise: {paise!r}")
    return {"value": paise, "offset": 100}


def upi_intent_link(vpa, payee_name, mcc, purpose, tr):
    # Meta: the intent supports only pa, pn, mc, purpose and tr
    query = urllib.parse.urlencode(
        {"pa": vpa, "pn": payee_name, "mc": mcc, "purpose": purpose, "tr": tr},
        quote_via=urllib.parse.quote, safe="@",
    )
    return f"upi://pay?{query}"


def build_order_details(to, reference_id, items, tax, payment_setting, body_text,
                        shipping=0, discount=0, expires_in=None, footer_text=None):
    if not REF_ID.fullmatch(reference_id):
        raise ValueError("reference_id: 1-35 letters, digits, _ - . only")
    if not 0 < len(body_text) <= 1024:
        raise ValueError("body text: 1-1024 characters")
    if footer_text is not None and len(footer_text) > 60:
        raise ValueError("footer text: up to 60 characters")

    order_items, subtotal = [], 0
    for item in items:
        if not 0 < len(item["name"]) <= 60:
            raise ValueError(f"item name: 1-60 characters: {item['name']!r}")
        qty = item["quantity"]
        if not isinstance(qty, int) or qty < 1:
            raise ValueError(f"quantity must be a positive integer: {qty!r}")
        missing = [k for k in IMPORTER_KEYS if k not in item]
        if missing:
            raise ValueError(f"items without catalog_id need {missing}")
        entry = {"name": item["name"], "amount": money(item["amount"]), "quantity": qty}
        unit = item["amount"]
        if "sale_amount" in item:
            if not item["sale_amount"] < item["amount"]:
                raise ValueError("sale_amount must be below amount")
            entry["sale_amount"] = money(item["sale_amount"])
            unit = item["sale_amount"]
        entry.update({k: item[k] for k in IMPORTER_KEYS})
        order_items.append(entry)
        subtotal += unit * qty

    total = subtotal + tax + shipping - discount
    if total <= 0:
        raise ValueError(f"total must be positive, got {total}")
    if payment_setting["type"] == "upi_intent_link" and total > UPI_CAP:
        raise ValueError("UPI payments are capped at Rs 5,00,000")

    order = {"status": "pending", "items": order_items,
             "subtotal": money(subtotal), "tax": money(tax)}
    if shipping:
        order["shipping"] = money(shipping)
    if discount:
        order["discount"] = money(discount)
    if expires_in is not None:
        if expires_in < 300:
            raise ValueError("expiration must be at least 300 seconds ahead")
        order["expiration"] = {"timestamp": str(int(time.time()) + expires_in),
                               "description": "Unpaid orders are canceled"}

    interactive = {
        "type": "order_details",
        "body": {"text": body_text},
        "action": {"name": "review_and_pay", "parameters": {
            "reference_id": reference_id,
            "type": "digital-goods",
            "payment_settings": [payment_setting],
            "currency": "INR",
            "total_amount": money(total),
            "order": order,
        }},
    }
    if footer_text:
        interactive["footer"] = {"text": footer_text}
    return {"messaging_product": "whatsapp", "recipient_type": "individual",
            "to": to, "type": "interactive", "interactive": interactive}


def send(payload):
    req = urllib.request.Request(
        f"{GRAPH}/{os.environ['PHONE_NUMBER_ID']}/messages",
        data=json.dumps(payload).encode(),
        headers={"Authorization": f"Bearer {os.environ['ACCESS_TOKEN']}",
                 "Content-Type": "application/json"},
    )
    try:
        with urllib.request.urlopen(req) as res:
            return json.load(res)
    except urllib.error.HTTPError as err:
        return json.load(err)


if __name__ == "__main__":
    importer = {
        "country_of_origin": "India",
        "importer_name": "IMPORTER_NAME",
        "importer_address": {"address_line1": "ADDRESS_LINE_1", "city": "CITY",
                             "zone_code": "DL", "postal_code": "110093",
                             "country_code": "IN"},
    }
    items = [
        {"name": "Monthly plan", "amount": 10000, "quantity": 1, **importer},
        {"name": "Add-on pack", "amount": 10000, "quantity": 1, **importer},
    ]
    setting = {"type": "upi_intent_link", "upi_intent_link": {
        "link": upi_intent_link("MERCHANT_VPA@PSP", "MERCHANT_NAME",
                                "MCC_CODE", "PURPOSE_CODE", "ORDER-1042")}}
    payload = build_order_details(os.environ.get("TO", "RECIPIENT_PHONE"), "ORDER-1042",
                                  items, tax=1000, payment_setting=setting,
                                  body_text="Your order ORDER-1042 is ready to pay.",
                                  expires_in=3600)
    print(json.dumps(payload, indent=2))
    if "ACCESS_TOKEN" in os.environ:
        print(send(payload))

A success response carries messages[0].id, which means the API accepted the message. It doesn’t mean the customer paid.

Payment configurations for gateway mode

Deep Integration still runs on payment configurations. “To receive payments on WhatsApp, you must add a payment configuration to the corresponding Messaging account”, each with a unique name that your messages’ configuration_name must match. Meta gives no WhatsApp Manager click path, and warns that an invalid name leaves the customer unable to pay.

Operation Method and path
List GET /v26.0/{WHATSAPP_BUSINESS_ACCOUNT_ID}/payment_configurations
Get one GET /v26.0/{WHATSAPP_BUSINESS_ACCOUNT_ID}/payment_configuration/{CONFIGURATION_NAME}
Create POST /v26.0/{WHATSAPP_BUSINESS_ACCOUNT_ID}/payment_configuration
New OAuth link POST /v26.0/{WHATSAPP_BUSINESS_ACCOUNT_ID}/generate_payment_configuration_oauth_link
Remove DELETE /v26.0/{WHATSAPP_BUSINESS_ACCOUNT_ID}/payment_configuration

Create takes configuration_name and provider_name (razorpay, payu, zaakpay or upi_vpa). For a gateway it returns an oauth_url that the gateway account owner opens to link the account. A configuration’s status is Active, Needs_Connecting or Needs_Testing, and changes arrive on the payment_configuration_update webhook field. Meta’s samples write "RazorPay" and "Needs Testing", which don’t match its own enums, so normalize case and treat spaces and underscores alike.

To use the builder above in gateway mode, swap the payment setting for the gateway page’s shape, trimmed of the BillDesk additional_info fields:

{"type": "payment_gateway", "payment_gateway": {"type": "billdesk", "configuration_name": "PAYMENT_CONFIGURATION"}}

payment_gateway.type is billdesk, razorpay, payu or zaakpay, and configuration_name takes up to 60 characters. Above ₹5,00,000, Meta says to set enabled_payment_options to ["web"], because payments over the cap fail while UPI is enabled.

How you learn that the customer paid

In UPI Intent mode, WhatsApp sends no payment webhook. Your business “waits for a payment or transaction status updates directly from Payment Gateway”, through the gateway’s webhooks, then relays the result to the customer with order_status.

In gateway mode, WhatsApp posts a statuses[] entry with "type": "payment" on the messages webhook field. Its payment object carries your reference_id, the amount and a transaction with the gateway’s IDs. The order is pending (unpaid, or attempted and failed) or captured. Each transaction is pending, success or failed, with at most one success per order. Meta’s sample identifies the customer by recipient_id only; the recipient_user_id fallback used on other status webhooks isn’t shown on the payments pages. Verify the webhook signature before you trust any of it.

Businesses “should not rely solely on the status of the transaction provided in the webhook” and “must use payment lookup API to retrieve the statuses directly from WhatsApp.” The lookup answers in the same HTTP session and takes the configuration name and reference_id from the order. The pages don’t say which value goes in that slot for UPI Intent mode.

curl -s "https://graph.facebook.com/v26.0/PHONE_NUMBER_ID/payments/PAYMENT_CONFIGURATION/REFERENCE_ID" \
  -H "Authorization: Bearer ACCESS_TOKEN"

The response holds a payments array shaped like the webhook’s payment object. “WhatsApp does not support payment reconciliations”, so reconcile in your gateway account. Refunds exist in gateway mode only, through POST /v26.0/{PHONE_NUMBER_ID}/payments_refund with reference_id, payment_config_id and an amount whose value is a string in paise.

Update the order with order_status

Order updates go out as order_status messages, not plain text. This is Meta’s sample with the placeholders filled in and messaging_product added, which the sample omits and every other send on these pages carries:

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "RECIPIENT_PHONE",
  "type": "interactive",
  "interactive": {
    "type": "order_status",
    "body": { "text": "Payment received. Your pass is being issued." },
    "action": {
      "name": "review_order",
      "parameters": {
        "reference_id": "ORDER-1042",
        "order": { "status": "processing", "description": "Pass issued within 10 minutes" }
      }
    }
  }
}

processing, partially-shipped and shipped can move to each other or to completed or canceled, which are terminal. An invalid move returns 2046. Canceling an order with a successful or pending payment fails, and 2047 means the user already paid. Meta’s table writes partially-shipped with a hyphen and its sample writes partially_shipped, so test which one the API accepts.

Send order details as a template

To start from a template, Meta offers a UTILITY template with a fixed ORDER_DETAILS button labeled “Review and Pay” (order details template). You create it through message_templates or in WhatsApp Manager under Utility. To send it, put the same order_details object in a button component with sub_type order_details and a parameter of type action. Meta’s sample mixes payment_settings with the legacy payment_type and payment_configuration, so send only payment_settings. For a catalog flow before checkout, see product messages, and for collecting details such as an address, WhatsApp Flows.

Z-API Omni team