WhatsApp Payments: Brazil
Note:
This WhatsApp functionality is not yet generally available to all customers. Additionally, the functionality provided by Sinch to enable this WhatsApp feature is only available to select customers for closed beta testing.
If you are a business based in Brazil or Singapore, and you have access to WhatsApp's Payments API, you can use a channel specific message or an explicit channel message to access that functionality. This functionality will allow you (the business) to send product information, respond to customer interest, facilitate payments, and provide order status updates, all within WhatsApp.
The above image was provided by Meta. Third-party images are subject to change at any time.
The overall process is described below:
- A business sends a mobile terminated (MT) message to a potential customer. This could either be a single product list message or a multi-product list message .
- The recipient sends a mobile originated (MO) message response indicating an interest or desire to purchase the product(s) in the original MT message.
-
The business sends an MT message with the
order_details
object populated. -
The recipient provides payment information in an MO response to the
order_details
message. APOST
is made to theEVENT_INBOUND
webhook with relevant information . -
The business processes the payment. The business may also send
order_status
MT messages to the recipient in order to provide updates on the progress of the order. This information can be retrieved fromPOST
calls made to theEVENT_INBOUND
webhook.
The above image was provided by Meta. Third-party images are subject to change at any time.
In order to send an order_details
message, you should use channel_specific_message
feature of the Conversation API.
Sending an order_details
message
This section includes examples of order_details
messages.
Note the following:
- This WhatsApp functionality is not yet generally available to all customers. Additionally, the functionality provided by Sinch to enable this WhatsApp feature is only available to select customers for closed beta testing.
-
If the
type
field of thepayment
object is set tobr
, all corresponding "amount" fields (for example,total_amount_value
) must be included in the payload at an offset of 100. For example, to represent an amount of 500, you must set the value to 50000.
Pix Payment Method
Below is an example of a channel specific message payload that represents an order_details
message for a Pix Payment:
{
"app_id": "{{APP}}",
"recipient": {
"identified_by": {
"channel_identities": [
{
"channel": "WHATSAPP",
"identity": "{{MSISDN}}"
}
]
}
},
"message": {
"channel_specific_message": {
"WHATSAPP": {
"message_type": "order_details",
"message": {
"header": {
"type": "text",
"text": "Payment message header"
},
"body": {
"text": "Payment message body"
},
"footer": {
"text": "Payment message footer"
},
"payment": {
"type": "br",
"reference_id": "{{YOUR_UNIQUE_REFERENCE_ID}}",
"type_of_goods": "digital-goods",
"payment_settings": {
"dynamic_pix": {
"code": "business-pix-code",
"merchant_name": "Business Account Name",
"key": "39580525000189",
"key_type": "CNPJ"
}
},
"total_amount_value": 50000,
"order": {
"tax_value": 0,
"tax_description": "optional text",
"subtotal_value": 50000,
"items": [
{
"retailer_id": "1234567",
"name": "Cake",
"amount_value": 50000,
"quantity": 1
}
]
}
}
}
}
}
}
}
Note:
For information on all possible parameters related to this type of message, see the channel specific message documentation.
Once the order_details
message is sent, the recipient will be able to interact with it and provide payment
information.
Upon doing so, the Conversation API will POST
an inbound event with the contact_message_event
object populated to the EVENT_INBOUND
webhook.
Sending an order_status
message
Note:
This WhatsApp functionality is not yet generally available to all customers. Additionally, the functionality provided by Sinch to enable this WhatsApp feature is only available to select customers for closed beta testing.
In order to send an order_status
message, you should use channel_specific_message
feature of the Conversation API.
Below is an example of a channel specific message payload:
{
"app_id": "{{APP}}",
"recipient": {
"identified_by": {
"channel_identities": [
{
"channel": "WHATSAPP",
"identity": "{{MSISDN}}"
}
]
}
},
"message": {
"channel_specific_message": {
"WHATSAPP": {
"message_type": "order_status",
"message": {
"header": {
"type": "text",
"text": "Payment message header"
},
"body": {
"text": "Payment message body"
},
"footer": {
"text": "Payment message footer"
},
"payment": {
"reference_id": "{{YOUR_UNIQUE_REFERENCE_ID}}",
"order": {
"status": "processing",
"description": "Payment status update description"
}
}
}
}
}
}
}
Note:
For information on all possible parameters related to this type of message, see the channel specific message documentation.
Tracking order's progress
You, as the business,
can view the order's progress through the payment flow by subscribing to the EVENT_INBOUND
webhook.
The Conversation API will POST
inbound events with the contact_message_event
object
populated to the EVENT_INBOUND
webhook, which contains information relevant to the order,
and it's progress through the payment flow.