Receive payments via payment gateways on WhatsApp | Developer Documentation
ChatArchitect availability: WhatsApp payment gateways. ChatArchitect supports ordinary links to an external payment website. Native WhatsApp payment-gateway integrations are not provided through ChatArchitect.
Use the external payment-link guide for the supported customer workflow. Your payment service handles checkout and transaction confirmation; WhatsApp delivery callbacks do not confirm payment. The imported Meta implementation below is retained as a separate reference and does not describe an available ChatArchitect setup.
ChatArchitect scope: Native Meta product catalogs, product cards, shopping carts and catalog order events are not supported by ChatArchitect. Review catalog availability in ChatArchitect when this imported payment reference mentions product messages. Confirm support for the payment operation separately for your ChatArchitect connection before implementing it.
Receive payments via payment gateways on WhatsApp
Overview
How it works
order_details message. An order_details message is a new type of interactive message, which always contains the same 4 main components: header, body, footer, and action. Inside the action component, the business includes all the information needed for the customer to complete their payment.order_details message contains a unique reference_id provided by the business, and that unique ID is used throughout the flow to track the order.Purchase flow in app
order_details message to the user. When the user taps on Review and Pay, they will see details about the order and total amount to be paid.Checkout with WhatsApp Pay:
Checkout on other UPI Apps:
order_status message to the consumer informing them about the status of the order. Each message will result in a message bubble (as shown below) that refers to the original order details message and also updates the status displayed on the order details page.Link your payment account
order_details message, you can specify the payment configuration to use for a specific checkout. WhatsApp will then generate a checkout flow using the associated payment gateway account.order_details message to customers with the payment configuration to receive payments.Steps to unlink Payment Configuration
Integration Steps
Sequence Diagram
Step 1: Send Order Details Interactive Message
order_details message, businesses must assemble an interactive object of type order_details with the following components:| Object | Description |
|---|---|
typeobject |
Required.
Must be “order_details”. |
headerobject |
Optional.
Header content displayed on top of a message. If a header is not provided, the API uses an image of the first available product as the header |
bodyobject |
Required.
An object with the body of the message. The object contains the following field:
text stringbody is present. The content of the message. Emojis and markdown are supported. Maximum length is 1024 characters |
footerobject |
Optional.
An object with the footer of the message. The object contains the following fields:
text stringfooter is present. The footer content. Emojis, markdown, and links are supported. Maximum length is 60 characters |
actionobject |
Required.
An action object you want the user to perform after reading the message. This action object contains the following fields:
name stringparameters object |
Parameters Object
| Object | Description |
|---|---|
reference_idstring |
Required.
Unique identifier for the order or invoice provided by the business. It is case sensitive and cannot be an empty string and can only contain English letters, numbers, underscores, dashes, or dots, and should not exceed 35 characters.
The reference_id must be unique for each order_details message for a given business. If there is a need to send multiple order_details messages for the same order, it is recommended to include a sequence number in the reference_id (for example, “BM345A-12”) to ensure reference_id uniqueness. |
typeobject |
Required.
The type of goods being paid for in this order. Current supported options are digital-goods and physical-goods. |
beneficiariesarray |
Required for shipped physical-goods.
An array of beneficiaries for this order. A beneficiary is an intended recipient for shipping the physical goods in the order. It contains the following fields:
Note: Beneficiary information isn’t shown to users but is needed for legal and compliance reasons.
name stringaddress_line1 stringaddress_line2 stringcity stringstate stringcountry stringpostal_code string |
currency |
Required.
The currency for this order. Currently the only supported value is INR. |
total_amountobject |
Required.
The
total_amount object contains the following fields:offset integer100 for INR.
value integertotal_amount.value must be equal to order.subtotal.value + order.tax.value + order.shipping.value - order.discount.value.UPI transactions are limited to ₹5,00,000. For higher amounts, set enabled_payment_options to ["web"]. See Restrict Available Payment Options. |
payment_settingsobject |
Required.
See Payment Settings object for more information. |
orderobject |
Required.
See order object for more information. |
Payment settings object
| Object | Description |
|---|---|
typestring |
Required.
Must be set to “payment_gateway” |
payment_gatewayobject |
Required.
An object that describes payment account information:
type stringconfiguration_name stringWhen configuration_name is invalid, the customer will be unable to pay for their order. We strongly advise businesses to conduct extensive testing of this setup during the integration phase.billdesk/razorpay/payu/zaakpay objectPlease refer Payment Gateway specific UDF object for more information. |
BillDesk, RazorPay, PayU and Zaakpay fields
notes, receipt and udf fields in Order Details message and receive this data back in payment signals. Here we will take a look at merchants can pass additional_info for BillDesk, notes and receipt fields for Razorpay, udf for PayU, extra for Zaakpay PGs.| Object | Description |
|---|---|
notesobject |
Optional. Only supported for Razorpay payment gateway
The object can be key value pairs with maximum 15 keys and each value limits to 256 characters. |
receiptString |
Optional. Only supported for Razorpay payment gateway
Receipt number that corresponds to this order, set for your internal reference. Maximum length of 40 characters supported with minimum length greater than 0 characters. |
udf1-4String |
Optional. Only supported for PayU payment gateway
User-defined fields (udf) are used to store any information corresponding to a particular order. Each UDF field has a maximum character limit of 255. |
extra1-2String |
Optional. Only supported for Zaakpay payment gateway
User-defined fields (extra) are used to store any information corresponding to a particular order. Each extra field has a maximum character limit of 180. |
additional_info1-7String |
Optional. Only supported for BillDesk payment gateway
User-defined fields (extra) are used to store any information corresponding to a particular order. Each extra field has a maximum character limit of 120. |
Order object
| Object | Description |
|---|---|
statusstring |
Required.
Only supported value in the
order_details message is pending.In an order_status message, status can be: pending, captured, or failed. |
type string |
Optional.
Only supported value is quick_pay. When this field is passed in we hide the “Review and Pay” button and only show the “Pay Now” button in the order details bubble. |
itemsobject |
Required.
An object with the list of items for this order, containing the following fields:
retailer_id stringname stringimage objectUsing this image field will limit the items array to a maximum of 10 items and this cannot be used with retailer_id or catalog_id.amount amount object with value and offset -- refer total amount field abovesale_amount amount objectquantity integercountry_of_origin stringcatalog_id is not present. The country of origin of the product
importer_name stringcatalog_id is not present. Name of the importer company
importer_adress stringcatalog_id is not present. Address of importer company |
subtotalobject |
Required.
The value must be equal to sum of
order.amount.value * order.amount.quantity. Refer to total_amount description for explanation of offset and value fieldsThe following fields are part of the
subtotal object:offset integer100 for INR
value integer |
taxobject |
Required.
The tax information for this order which contains the following fields:
offset integer100 for INR
value integerdescription string |
shippingobject |
Optional.
The shipping cost of the order. The object contains the following fields:
offset integer100 for INR
value integerdescription string |
discountobject |
Optional.
The discount for the order. The object contains the following fields:
offset integer100 for INR
value integerdescription stringdiscount_program_name string |
catalog_idobject |
Optional.
Unique identifier of the Facebook catalog being used by the business.
If you do not provide this field, you must provide the following fields inside the items object: country_of_origin, importer_name, and importer_address |
expirationobject |
Optional.
Expiration for that order. Business must define the following fields inside this object:
timestamp string – UTC timestamp in seconds of time when order should expire. Minimum threshold is 300 secondsdescription string – Text explanation for expiration. Max character limit is 120 characters |
Item Image Object
| Object | Description |
|---|---|
link string |
Required. A link to the image that will be shown to the user. Must be an image/jpeg or image/png and 8-bit, RGB or RGBA. Follows same requirements as image in media |
parameters value is a stringified JSON object.parameters value is a stringified JSON object.parameters value is a stringified JSON object.Step 2: Add Common Message Parameters
recipient_type, to, and type. Remember to set the type to interactive.Step 3:Make a POST Call to Messages Endpoint
/[PHONE_NUMBER_ID]/messages endpoint with the JSON object you have assembled. If your message is sent successfully, you get the following response:Product Experience
order_details message similar to the one below (left). When they click on “Review and Pay”, it opens up the order details screen as shown below (middle). Customer can then pay for their order using “Continue” button that opens up a bottom sheet with the payment options (right).Step 4: Receive Webhook about Transaction Status
| Object | Description |
|---|---|
idstring |
Required.
Webhook ID for the notification. |
recipient_id string |
Required.
WhatsApp ID of the customer. |
typestring |
Required.
For payment status update webhooks, type is “payment”. |
statusstring |
Required.
captured/pending: captured - when the payment is successfully completed, pending when the user attempted but yet to receive success transactions signal |
paymentobject |
Required.
Contains the following field:
reference_id stringUnique reference ID for the order sent in
order_details message. amount objectHas value and offset fields corresponding to total amount that user has paid.
currency stringcurrency is always INR.
transaction object Transaction attempt for this payment. Transaction object contains the following fields:id string Required. The alpha-numeric payment gateway order ID.pg_transaction_id string Optional. The alpha-numeric payment gateway payment ID.type string Required. The payment type for this transactions. Only, billdesk or razorpay or payu or zaakpay are supported.status string Required. The status of the transaction. Can be one of pending or success or failed.created_timestamp integer Required. Time when transaction was created in epoch seconds.updated_timestamp integer Required. Time when transaction was last updated in epoch seconds.method object (Optional. the payment method information might not be available for failed payments)
type string Required. The describes the type of payment method used by consumer to pay for the order. Can be one of upi or card or wallet or netbanking.error object (Optional. the payment error details might not be available for all payments attempts)code string Required. The describes the payment failure reason that is generated by payment gateway and Meta returns this to partners.
reason string Required. The describes the payment failure reason in plain text that is generated by payment gateway and Meta returns this to partners. additional_info1-7 string Optional.Only sent for billdesk payment gateway when the value is sent in order details message. Each of the keys additional_info1-4 has string values in them.
notes object Optional.Only sent for razorpay payment gateway when the value is sent in order details message. This contains key-value pair as passed in the Order Details message.
receipt string Optional.Only sent for razorpay payment gateway when the value is sent in order details message. Only sent for payu payment gateway when the value is sent in order details message. Each of the keys udf1-4 has string values in them.
udf1-4 string Optional.extra1-2 string Optional.refunds array Optional.
The list of refunds for this order. Each refund object contains the following fields: id string Required. The alpha-numeric ID of the refund.amount object Required. The total amount of the refund.speed_processed string Required. Speed by which refund was processed. Can be one of instant or normal.status string Required. The status of the refund. Can be one of pending, success or failed.created_timestamp integer Required. Time when refund was created in epoch seconds.updated_timestamp integer Required. Time when refund was last updated in epoch seconds. |
timestampstring |
Required.
Timestamp for the webhook. |
payment:Step 5: Confirm Payment
GET <PHONE_NUMBER_ID>/payments/<PAYMENT_CONFIGURATION>/<REFERENCE_ID>
payment_configuration and reference_id are same as that sent in the order_details message.| Field | Description |
|---|---|
reference_idstring |
Required.
The ID sent by the business in the order_details message |
statusstring |
Required.
Status of the payment for the order. Can be one of
pending or capturedRefer the table below for what these statuses mean. |
currencystring |
Required.
The currency for this payment. Currently the only supported value is INR. |
amountobject |
Required.
The amount for this payment. It contains the following fields:
offset integervalue integer |
transactionsarray |
Optional.
The list of transactions for this payment. This field is only present when at least one payment attempt has been made. If the payment status is
pending and no payment attempt has occurred, this field will not be returned. Each transaction object contains the following fields:id stringpg_transaction_id stringtype stringbilldesk or razorpay or payu or zaakpay are supported.
status stringpending or success or failed.
At most one transaction can have a success status.created_timestamp integerupdated_timestamp integermethod objectOptional. the payment method information might not be available for failed payments type string Required. The describes the type of payment method used by consumer to pay for the order. Can be one of upi or card or wallet or netbanking.
error objectOptional. the payment error details might not be available for all payments attempts code string Required. The describes the payment failure reason that is generated by payment gateway and Meta returns this to partners.reason string Required. The describes the payment failure reason in plain text that is generated by payment gateway and Meta returns this to partners.
refunds arrayOptional. The list of refunds for this order. Each refund object contains the following fields: id string Required. The alpha-numeric ID of the refund.amount object Required. The total amount of the refund.speed_processed string Required. Speed by which refund was processed. Can be one of instant or normal.status string Required. The status of the refund. Can be one of pending, success or failed.created_timestamp integer Required. Time when refund was created in epoch seconds.updated_timestamp integer Required. Time when refund was last updated in epoch seconds. |
additional_info1-7string |
Optional.
Supported for only BillDesk PG, this contains string values sent as part of Order Details message. |
receiptstring |
Optional.
Supported for only Razorpay PG, this contains the receipt-value sent as part of Order Details message. |
notesobject |
Optional.
Supported for only Razorpay PG, this contains the key-value pairs sent as part of Order Details message. |
udf1-4string |
Optional.
Supported for only PayU PG, this contains string values sent as part of Order Details message. |
extra1-2string |
Optional.
Supported for only Zaakpay PG, this contains string values sent as part of Order Details message. |
Payment Status
| Status | Description |
|---|---|
pending |
The order has been created but payment has not yet been captured. This status covers two scenarios: No payment attempt yet: The transactions array will not be present in the response.Payment attempted but failed: The transactions array will contain one or more entries with status set to failed. |
captured |
The payment was successfully captured. The transactions array will contain an entry with status set to success. |
Response by Payment Stage
transactions array is not present.transactions array contains the successful transaction with payment method details.pending (the order is still awaiting successful payment), but the transactions array contains the failed attempt with error details.Step 6: Update Order Status
order_status message instead of text messages since the latest status of an order displayed on the order details page is only based on order_status messages.interactive message of type order_status as shown below.order_status interactive message:| Object | Description |
|---|---|
typestring |
Required. Must be “order_status” |
bodyobject |
Required.
An object with the body of the message. The object contains the following field:
text stringbody is present. The content of the message. Emojis and markdown are supported. Maximum length is 1024 characters. |
footerobject |
Optional.
An object with the footer of the message. The object contains the following field:
text stringfooter is present. The footer content. Emojis, markdown, and links are supported. Maximum length is 60 characters. |
actionobject |
Required.
An action object you want the user to perform after reading the message. This action object contains the following fields:
name stringparameters object |
Parameters object
parameters object contains the following fields:| Value | Description |
|---|---|
reference_idstring |
Required.
The ID sent by the business in the order_details message. |
orderobject |
Required. This object contains the following fields:
status stringstatus. Must be one of processing, partially_shipped, shipped, completed, canceled.
description stringorder_details. Could be useful while sending cancellation. Max character limit is 120 characters. |
order_status message introduces two new errors that are summarized below.| Error Code | Description |
|---|---|
2046 - Invalid status transition |
The order status transition is not allowed. |
2047 - Cannot cancel order |
Cannot cancel the order since the user has already paid for it. |
Product Experience
order_status update as a separate message in their chat thread, that references their original order_details message as shown below (left). The order details page always displays the latest valid status communicated to the customer using the order_status message as shown below (right).Supported Order Status and Transitions
| Value | Description |
|---|---|
pending |
User has not successfully paid yet |
processing |
User payment authorized, merchant/partner is fulfilling the order, performing service, etc. |
partially-shipped |
A portion of the products in the order have been shipped by the merchant |
shipped |
All the products in the order have been shipped by the merchant |
completed |
The order is completed and no further action is expected from the user or the partner/merchant |
canceled |
The partner/merchant would like to cancel the order_details message for the order/invoice. The status update will fail if there is already a successful or pending payment for this order_details message |
pending, which is sent in order_details message.canceled and completed are terminal status and cannot be updated to any other status.pending can transition to any of the other statuses including processing, shipped, partially-shipped.processing, shipped and partially-shipped are equivalent statuses and can transition between one another or to one of the terminal statuses.
order_status message with an invalid transition, you will receive an error webhook with the error code 2046 and message “New order status was not correctly transitioned.”Canceling an Order
canceled by sending an order_status message with the status canceled. The customer cannot pay for an order that is canceled. The customer receives an order_status message and order details page is updated to show that the order is canceled and the “Continue” button removed. The optional text shown below “Order canceled” on the order details page can be specified using the description field in the order_status message.order_status message with canceled status, you will receive an error webhook with error code 2047 and message “Could not change order status to ‘canceled’”.Step 7: Reconcile Payments
reference_id provided in the order_details messages and the id of the transactions returned as part of the payment lookup query.Merchant Preferred UPI Payment Method
Updates to Order Details Payload
List of supported apps:
| UPI Application | Application ID to be passed in Order Details payload |
|---|---|
|
Google Pay |
gpay |
|
PhonePe |
phonepe |
|
PayTm |
paytm |
|
BHIM |
bhim |
|
Amazon Pay |
amazonpay |
|
CRED |
cred |
|
Mobikwik |
mobikwik |
Restrict Available Payment Options
enabled_payment_options to ["web"] to use your payment gateway’s web checkout. Payments with UPI enabled above this limit will fail.Updates to Order Details Payload
List of payment options
| Enabled Option | Experience in checkout flow |
|---|---|
|
upi |
Only UPI apps are show in checkout flow |
|
web |
Payment gateway webpage is loaded and merchant payment gateway account configured payment options will be shown in the checkout flow. |
Third Party Validation with Razorpay and PayU Payment Gateways
Updates to Order Details Payload to support TPV for Razorpay merchants
Updates to Order Details Payload to support TPV for PayU merchants
Security Considerations
Checklist for Integrated Merchants
order_status message is send to consumer informing them about updates to an order after receiving transaction updates for an order.
No comments to display
No comments to display