Skip to main content

How to Use Checkout Button Template API

Updated yesterday

Summary

Want to streamline payments on WhatsApp? Facebook’s Checkout Button Template makes it easy for businesses to collect payments directly in chat. This guide gives you a quick overview of how these templates work with the WhatsApp Cloud API, so you can start offering a seamless checkout experience to your customers.

Instructions

Checkout Button Template is a feature of the WhatsApp Cloud API that lets you embed a Pay Now or Buy Now button directly into a message. When tapped, the button opens a secure payment experience so the customer can complete their purchase in just a few clicks.

What you need to get started

Before using checkout button templates, make sure you have:

  • A verified WhatsApp Business Account (WABA)

  • Access to the WhatsApp Cloud API

  • A Meta payment account (set up via Meta Commerce Manager)

  • A hosted storefront or payment experience (via Meta or third-party provider)

How checkout button templates work

The checkout button is sent using a message template that includes:

  • Header: Optional, can include text or media

  • Body: Describes the product or payment request

  • Button: Triggers the checkout flow when tapped

Once the customer taps the button, they’ll be directed to a pre-configured payment experience. This can be a one-time checkout page or linked to a specific product or cart.

Key benefits

  • Faster purchases: Customers don’t need to leave WhatsApp to pay

  • Better engagement: Reduces drop-offs during checkout

  • Secure transactions: Payments are handled through Meta’s verified infrastructure

Example use cases

  • Sharing a “Pay Now” message after order confirmation

  • Sending a payment link for pre-orders or subscriptions

  • Enabling quick reorders for returning customers

Endpoint

POST https://{your-account-endpoint}/api/v1/checkout_button_template

The checkout_button_template endpoint allows you to embed a Pay Now or Buy Now button directly into a message. When tapped, the button opens a secure payment experience so the customer can complete their purchase in just a few clicks.

Step 1: Locate your API endpoint

You can find your specific API endpoint under the /api-docs section in your Wati account. It will look something like this: https://live-server-xxxx.wati.io

Your final endpoint to send the order will be:

POST https://{your-account-endpoint}/api/v1/checkout_button_template

Here’s the list of parameters for this endpoint:

phone_number : This is the message receiver’s phone number.

template_name : Is the name of the template you created.

custom_params : This depends on the variables in the template.

order_details : The amount of the order_details should be the same as the number of carousel cards in the template.

reference_id : This is a unique ID for each order.

Step 2: How to send the Checkout Button Template using the API endpoint

Here’s a sample payload for a checkout_button_template with the 3 carousel cards:

Sample payload

curl --location 'https://mt-dev-gke-server.watiapp.io/103128/api/v1/checkout_
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqd
--header 'Content-Type: application/json' \
--data '{
"phone_number": "918606328257",
"template_name": "checkout_button_template_yzn_1",
"custom_params": [
{
"name": "name"
,
"value": "TEST_NAME"
}
],
"order_details": [
{
"reference_id": "yzn-test-7",
"type": "physical-goods",
"currency": "INR",
"payment_settings": [
{
"type": "payment_gateway",
"payment_gateway": {
"type": "razorpay",
"configuration_name": "razorpay_test_payment_2"
}
}
],
"shipping_info": {
"country": "IN",
"addresses": [
{
"name": "Nidhi Tripathi",
"phone_number": "919000090000",
"address": "Bandra Kurla Complex",
"city": "Mumbai",
"state": "Maharastra",
"in_pin_code": "400051",
"house_number": "12",
"tower_number": "5",
"building_name": "One BKC",
"landmark_area": "Near BKC Circle"
}
]
},
"order": {
"items": [
{
"amount": {
"offset": 100,
"value": 200
},
"sale_amount": {
"offset": 100,
"value": 150
},
"name": "Blue Elf Aloe"
,
"quantity": 1,
"country_of_origin": "India",
"importer_name": "Lucky Shrub Imports and Exports",
"importer_address": {
"address_line1": "One BKC",
"address_line2": "Bandra Kurla Complex",
"city": "Mumbai",
"zone_code": "MH",
"postal_code": "400051",
"country_code": "IN"
}
}
],
"subtotal": {
"offset": 100,
"value": 150
},
"shipping": {
"offset": 100,
"value": 20
},
"tax": {
"offset": 100,
"value": 10
},
"discount": {
"offset": 100,
"value": 15,
"description": "Additional 10% off"
},
"status": "pending",
"expiration": {
"timestamp": "1726627150",
"description": "description"
}
},
"total_amount": {
"offset": 100,
"value": 165
}
},
{
"reference_id": "yzn-test-8",
"type": "physical-goods",
"currency": "INR",
"payment_settings": [
{
"type": "payment_gateway",
"payment_gateway": {
"type": "razorpay",
"configuration_name": "razorpay_test_payment_2"
}
}
],
"shipping_info": {
"country": "IN",
"addresses": [
{
"name": "Nidhi Tripathi",
"phone_number": "919000090000",
"address": "Bandra Kurla Complex",
"city": "Mumbai",
"state": "Maharastra",
"in_pin_code": "400051",
"house_number": "12",
"tower_number": "5",
"building_name": "One BKC",
"landmark_area": "Near BKC Circle"
}
]
},
"order": {
"items": [
{
"amount": {
"offset": 100,
"value": 200
},
"sale_amount": {
"offset": 100,
"value": 150
},
"name": "Blue Elf Aloe"
,
"quantity": 1,
"country_of_origin": "India",
"importer_name": "Lucky Shrub Imports and Exports",
"importer_address": {
"address_line1": "One BKC",
"address_line2": "Bandra Kurla Complex",
"city": "Mumbai",
"zone_code": "MH",
"postal_code": "400051",
"country_code": "IN"
}
}
],
"subtotal": {
"offset": 100,
"value": 150
},
"shipping": {
"offset": 100,
"value": 20
},
"tax": {
"offset": 100,
"value": 10
},
"discount": {
"offset": 100,
"value": 15,
"description": "Additional 10% off"
},
"status": "pending",
"expiration": {
"timestamp": "1726627150",
"description": "description"
}
},
"total_amount": {
"offset": 100,
"value": 165
}
},
{
"reference_id": "yzn-test-9",
"type": "physical-goods",
"currency": "INR",
"payment_settings": [
{
"type": "payment_gateway",
"payment_gateway": {
"type": "razorpay",
"configuration_name": "razorpay_test_payment_2"
}
}
],
"shipping_info": {
"country": "IN",
"addresses": [
{
"name": "Nidhi Tripathi",
"phone_number": "919000090000",
"address": "Bandra Kurla Complex",
"city": "Mumbai",
"state": "Maharastra",
"in_pin_code": "400051",
"house_number": "12",
"tower_number": "5",
"building_name": "One BKC",
"landmark_area": "Near BKC Circle"
}
]
},
"order": {
"items": [
{
"amount": {
"offset": 100,
"value": 200
},
"sale_amount": {
"offset": 100,
"value": 150
},
"name": "Blue Elf Aloe"
,
"quantity": 1,
"country_of_origin": "India",
"importer_name": "Lucky Shrub Imports and Exports",
"importer_address": {
"address_line1": "One BKC",
"address_line2": "Bandra Kurla Complex",
"city": "Mumbai",
"zone_code": "MH",
"postal_code": "400051",
"country_code": "IN"
}
}
],
"subtotal": {
"offset": 100,
"value": 150
},
"shipping": {
"offset": 100,
"value": 20
},
"tax": {
"offset": 100,
"value": 10
},
"discount": {
"offset": 100,
"value": 15,
"description": "Additional 10% off"
},
"status": "pending",
"expiration": {
"timestamp": "1726627150",
"description": "description"
}
},
"total_amount": {
"offset": 100,
"value": 165
}
}
]
}'

How to create a Checkout Button Template in Wati

This guide walks you through the steps to create the Checkout Buttom Template in a few clicks:

1. Log in to your Wati account.

2. Go to Broadcasts and select Your Templates.

3. Click on New Template Message.

4. Enter a name for your template so you can easily find it later.

5. Under Category, choose Marketing.

6. Select the language you want the template to be in.

7. Under Select Marketing Template, choose Checkout Template.

8. Enter your body content - this is the main message your customer will see.

9. Add carousel cards as per your requirements.

Note:

  • You can add up to 5 cards.

  • For each card, you can add an image or a video.

  • You can insert buttons for each card so your customers can take action and engage.

Did this answer your question?