Summary
Want to send personalized order messages directly to your customer's WhatsApp using the Wati API? This guide walks you through how to use the POST /api/v1/order_details_template
endpoint to send a structured message that includes order items, pricing, and payment options. You'll also find a sample payload to help you get started quickly.
Endpoint
POST https://{your-account-endpoint}/api/v1/order_details_template
The order_details_template
endpoint allows you to send a order detail template messag to a customer's WhatsApp. You can include one or more items in the message, specify pricing, and link it to a payment gateway like PayU, Razorpay etc.
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/order_details_template
Step 2: Understand the importance of reference_id
Every order message must include a unique reference_id
. You generate this value and use it to track each order. No two orders should have the same reference_id
.
Step 3: Structure your payload
Here’s a sample payload showing how to format your order_details_template
. You can customize fields like the product name, price, importer details, and payment configuration as needed.
Sample payload
curl --location 'https://mt-dev-gke-server.watiapp.io/103128/api/v1/order_deta
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqd
--header 'Content-Type: application/json' \
--data '{
"phone_number": "918606328257",
"template_name": "order_details_template_yzn_1",
"language_code": "en_US",
"is_broadcast": true,
"custom_params": [
{
"name": "name"
,
"value": "Madhavan"
},
{
"name": "discount",
"value": "60%"
}
],
"order_details": {
"reference_id": "yzn-test-6",
"type": "digital-goods",
"payment_configuration": "razorpay_test_payment_2",
"payment_type": "payment_gateway:razorpay",
"currency": "INR",
"total_amount": {
"offset": 100,
"value": 100
},
"order": {
"discount": {
"offset": 100,
"value": 100
},
"items": [
{
"amount": {
"offset": 100,
"value": 100
},
"name": "ORDER_ITEM_NAME",
"quantity": 1,
"retailer_id": "ORDER_ITEM_RETAILER_ID",
"country_of_origin": "ORIGIN_COUNTRY",
"importer_name": "IMPORTER_NAME",
"importer_address": {
"address_line1": "IMPORTER_ADDRESS",
"city": "CITY",
"country_code": "COUNTRY",
"postal_code": "ZIP_CODE"
}
}
],
"shipping": {
"offset": 100,
"value": 0
},
"status": "pending",
"subtotal": {
"offset": 100,
"value": 100
},
"tax": {
"offset": 100,
"value": 100
}
}
}
}'
Notes
Currency and offsets: The amount values use an offset system (e.g., value: 21000 and offset: 100 = ₹210.00).
Product details: You can send multiple products in one message.
Image header: Provide a valid media URL to show an image at the top of the message.
Payment gateway: The Payment Gateway supported by Facebook for eg: Razorpay, Payu, Zaakpay, and Billdesk.
How to link your payment account to Facebook
To receive payments on WhatsApp, you need to link your payment gateway to your WhatsApp Business Account through a payment configuration.
Here’s a quick visual walkthrough:
How to Create an Order Details Template in Wati
Want to send order information quickly and clearly to your customers? Use the Order Details template in Wati to design and send structured messages. This guide walks you through the steps to create one in just a few clicks.
Follow these steps to set up an Order Details template in Wati:
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 or Utility
6. Select the language you want the template to be in.
7. Under Select Marketing Template, choose Order Details.
8. Choose how you want the message to start:
To add a text or image as a title, select Text or Image under Broadcast title.
If you prefer to skip the title and start with the body, choose None under Broadcast title.
9. Enter your body content—this is the main message your customer will see.
10. Once everything looks good, click Save and Submit.
That’s it! Your Order Details template is now ready to use in your campaigns.
Note: You can create the Order Details template under Marketing as well as the Utility template category.