# 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](/docs/conversation/api-reference/conversation/messages/messages_sendmessage#messages/messages_sendmessage/t=request&path=message&oneof=0/channel_specific_message) or an [explicit channel message](/docs/conversation/channel-support/whatsapp/message-support/#explicit-channel-messages) 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. ![Payments Brazil, image from Meta](/assets/payments_handset_br.9cd02d6987d488af0359be741d193d0b5c6cc49c7f9d0ec49d18b9e454a6e00b.3a8dbadf.png) *The above image was provided by Meta. Third-party images are subject to change at any time.* The overall process is described below: 1. 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](/docs/conversation/message-types/list-message/#product-list-message). 2. The recipient sends a mobile originated (MO) message response indicating an interest or desire to purchase the product(s) in the original MT message. 3. The business sends an MT message with the `order_details` object populated. 4. The recipient provides payment information in an MO response to the `order_details` message. A `POST` is made to the `EVENT_INBOUND` webhook with [relevant information](/docs/conversation/callbacks/#contact-message-event). 5. 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](/docs/conversation/callbacks/#contact-message-event) can be retrieved from `POST` calls made to the `EVENT_INBOUND` webhook. ![Payments flow](/assets/payments_flow_br.ffd0dde91b92500abdab7b6a267ffd3602f1cbfdcfd3942e1c16f172d0be3f1e.3a8dbadf.png) *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 the `payment` object is set to `br`, 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: ```json { "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 } ] } } } } } } } ``` ### Payment Link Payment Method Below is an example of a channel specific message payload that represents an `order_details` message for a Payment Link Payment: ```json { "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": { "payment_link": { "uri": "https://your-payment-link" } }, "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 } ] } } } } } } } ``` ### Boleto Payment Method Below is an example of a channel specific message payload that represents an `order_details` message for a Boleto Payment: ```json { "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": { "boleto": { "digitable_line": "digitable-line" } }, "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](/docs/conversation/api-reference/conversation/messages/messages_sendmessage#messages/messages_sendmessage/t=request&path=message&oneof=0/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](/docs/conversation/callbacks/#contact-message-event) 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: ```json { "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](/docs/conversation/api-reference/conversation/messages/messages_sendmessage#messages/messages_sendmessage/t=request&path=message&oneof=0/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](/docs/conversation/callbacks/#contact-message-event) populated to the `EVENT_INBOUND` webhook, which contains information relevant to the order, and it's progress through the payment flow.