Receive WhatsApp Payments via Stripe
Payments API Integration with Stripe allow customers to pay for their orders without leaving the WhatsApp customer app
The following sequence diagram demonstrates the typical integration flow for WA Payments API:

Integration Steps
The steps outlined below assume that the business already knows what the user is interested in through earlier conversations. The payments API is a standalone API and hence can work with various messages such as List Messages, Reply Buttons, Single or Multi-Product Messages.
Send Order Details Interactive Message
To send an order_details message, businesses must assemble an interactive object of type order_details with the following components:
type
object
Required.
Must be "order_details"
header
object
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
body
object
Required.
An object with the body of the message. The object contains the following field:
text string
Required if body is present. The content of the message. Emojis and markdown are supported. Maximum length is 1024 characters
footer
object
Optional.
An object with the footer of the message. The object contains the following field:
text string
Required if footer is present. The footer content. Emojis, markdown, and links are supported. Maximum length is 60 characters
action
object
Required.
An action object you want the user to perform after reading the message. This action object contains the following fields:
name string
Required. Use "
review_and_pay"
parameters object
See Parameters Object for information
Add Common Message Parameters
Once the interactive object is complete, append the other parameters that make a message: recipient_type, to, and type. Remember to set the type to interactive.
{
"recipient_type": "individual",
"to" : "whatsapp-id", // WhatsApp ID of the recipient
"type": "interactive",
"interactive":{
// The interactive object
}
}These are parameters common to all message types.
Receive Webhook about Transaction Status
A webhook notification for an updated transaction status looks like this:
{
"statuses": [{
"id": "gBGGFlB5YjhvAgnhuF1qIUvCo7A",
"from": "16315555555",
"type": "payment",
"status": "new-transaction-status",
"payment": {
"reference_id": "reference-id-value"
},
"timestamp": "1610561171"
}]
}Confirm Payment
After receiving the payment status change notification, or at any time, the business can look up the status of the payment or transaction.
To do that, businesses must make a GET call to /v1/payments/{payment-config-id}/{ref-id}, using the reference ID provided in the order_details message.
Update Order Status
To notify the customer with updates of an order, you can send an interactive message of type order_status as shown below:
{
"recipient_type": "individual",
"to": "whatsapp-id",
"type": "interactive",
"interactive": {
"type": "order_status",
"body": {
"text": "your-text-body-content"
},
"action": {
"name": "review_order",
"parameters": {
"reference_id": "reference-id-value",
"order": {
"status": "processing",
"description": "optional-text"
}
}
}
}
}Supported Order Status and Transitions
Currently, Meta supports the following order status values:
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
Order status transitions are restricted for consistency of consumer experience. Allowed status transitions are summarized below:
Initial status of an order is always
pending, which is sent inorder_detailsmessage.canceledandcompletedare terminal status and cannot be updated to any other status.pendingcan transition to any of the other statuses includingprocessing,shipped,partially-shipped.processing,shippedandpartially-shippedare equivalent statuses and can transition between one another or to one of the terminal statuses.

Upon sending an 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
An order can be 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 (left) and order details page is updated to show that the order is canceled and the "Secure Checkout" button removed (right). The optional text shown below "Order canceled" on the order details page can be specified using the description field in the order_status message.
An order can be canceled only if the user has not already paid for the order. If the user has paid and you send an 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'".

Reconcile Payments
Please note that neither 360dialog nor WhatsApp supports payment reconciliations. Businesses should use their Stripe account to reconcile the payments using the reference_id provided in the order_details messages and the transaction_id of the transactions returned as part of the webhooks or the payment status query.
Security Considerations for Payments API
Businesses should comply with local security and regulatory requirements in Singapore.
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.
To ensure secure financial processing, payment configurations such as the business’ VPA shared by all WhatsApp phone numbers must belong to the same Business Manager account. If you wish to separate payments for different phone numbers, then additional Business Manager Accounts must be created.
Businesses must always sanitize/validate the data in the API responses or webhooks to protect against SSRF attacks.
Last updated
Was this helpful?


