摘要

想要簡化 WhatsApp 上的付款流程嗎?Facebook 的結帳按鈕範本 (Checkout Button Template) 讓企業能輕鬆直接在對話中收款。本指南將快速概述這些範本如何與 WhatsApp Cloud API 搭配運作,協助您開始為客戶提供流暢的結帳體驗。

說明

結帳按鈕範本是 WhatsApp Cloud API 的一項功能,可讓您將「立即付款」或「立即購買」按鈕直接嵌入訊息中。客戶點擊按鈕後,系統會開啟安全的付款頁面,讓客戶只需點擊幾下即可完成購買。

入門準備

在使用結帳按鈕範本之前,請確保您已具備:

  • 經過驗證的 WhatsApp Business Account (WABA)

  • 存取 WhatsApp Cloud API 的權限

  • Meta 付款帳戶(透過 Meta Commerce Manager 設定)

  • 託管式店面或付款體驗(透過 Meta 或第三方供應商)

結帳按鈕範本運作方式

結帳按鈕是透過包含以下內容的訊息範本發送的:

  • 頁首 (Header):可選,可包含文字或媒體

  • 本文 (Body):描述產品或付款請求

  • 按鈕 (Button):點擊後會觸發結帳流程

當客戶點擊按鈕後,將被導向至預先設定的付款體驗。這可以是單次結帳頁面,或是連結至特定產品或購物車。

主要優勢

  • 購買更快速:客戶無需離開 WhatsApp 即可完成付款

  • 互動性更佳:減少結帳過程中的流失率

  • 交易安全性高:付款均透過 Meta 的驗證基礎設施處理

使用案例範例

  • 在訂單確認後發送「立即付款」訊息

  • 為預購或訂閱發送付款連結

  • 讓回頭客能快速重新下單

端點

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

checkout_button_template 端點允許您將「立即付款」或「立即購買」按鈕直接嵌入訊息中。點擊按鈕後,會開啟安全的付款體驗,讓客戶只需點擊幾下即可完成購買。

注意:此 API 端點目前處於私人測試 (Private Beta) 階段,僅開放給部分客戶使用。若您需要存取權限,請聯絡 Wati 支援團隊。

步驟 1:確認您的 API 端點

您可以在 Wati 帳戶中找到專屬的 API 端點。請前往連接器 (Connectors) > API Tokens。它看起來會像這樣:https://live-mt-server.wati.io

您發送訂單的最終端點為:

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

以下是此端點的參數列表:

phone_number:訊息接收者的電話號碼。

template_name:您所建立的範本名稱。

custom_params:取決於範本中的變數。

order_details:order_details 的數量應與範本中的輪播卡片數量相同。

reference_id:每筆訂單的唯一 ID。

步驟 2:如何使用 API 端點發送結帳按鈕範本

以下是包含 3 張輪播卡片的 checkout_button_template 範例負載 (Payload):

範例負載


curl --request POST \
--url 'https://live-mt-server.wati.io/{tenantId}/api/v1/checkout_button_template' \
--header 'Authorization: Bearer <TOKEN>' \
--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": "Maharashtra",
"in_pin_code": "400051",
"house_number": "12",
"tower_number": "5",
"building_name": "One BKC",
"landmark_area": "Near BKC Circle"
}
]
},
"order": {
"items": [
{
"name": "Blue Elf Aloe",
"quantity": 1,
"country_of_origin": "India",
"importer_name": "Lucky Shrub Imports and Exports",
"amount": {
"offset": 100,
"value": 200
},
"sale_amount": {
"offset": 100,
"value": 150
},
"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": "Maharashtra",
"in_pin_code": "400051",
"house_number": "12",
"tower_number": "5",
"building_name": "One BKC",
"landmark_area": "Near BKC Circle"
}
]
},
"order": {
"items": [
{
"name": "Blue Elf Aloe",
"quantity": 1,
"country_of_origin": "India",
"importer_name": "Lucky Shrub Imports and Exports",
"amount": {
"offset": 100,
"value": 200
},
"sale_amount": {
"offset": 100,
"value": 150
},
"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": "Maharashtra",
"in_pin_code": "400051",
"house_number": "12",
"tower_number": "5",
"building_name": "One BKC",
"landmark_area": "Near BKC Circle"
}
]
},
"order": {
"items": [
{
"name": "Blue Elf Aloe",
"quantity": 1,
"country_of_origin": "India",
"importer_name": "Lucky Shrub Imports and Exports",
"amount": {
"offset": 100,
"value": 200
},
"sale_amount": {
"offset": 100,
"value": 150
},
"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
}
}
]
}'

如何在 Wati 中建立結帳按鈕範本

本指南將引導您透過幾個簡單步驟建立結帳按鈕範本:

1. 登入您的 Wati 帳戶。

2. 前往行銷活動 (Campaigns) 並選擇範本訊息 (Template Messages)。

3. 點擊新建範本訊息 (New Template Message)。

4. 輸入範本的名稱,以便日後輕鬆找到它。

5. 在類別 (Category) 下,選擇行銷 (Marketing)。

6. 選擇您希望範本使用的語言。

7. 在選擇行銷範本 (Select Marketing Template) 下,選擇結帳範本 (Checkout Template)。

8. 輸入您的本文內容 (body content)——這是客戶會看到的主要訊息。

9. 根據您的需求新增輪播卡片。

注意:

  • 您最多可以新增 5 張卡片。

  • 每張卡片皆可新增圖片或影片。

  • 您可以為每張卡片插入按鈕,讓客戶能採取行動並進行互動。

Did this answer your question?