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.

Payments Brazil, image from Meta

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 .
  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 .
  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 can be retrieved from POST calls made to the EVENT_INBOUND webhook.

Payments flow

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:

Copy
Copied
{
  "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:

Copy
Copied
{
  "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.

We'd love to hear from you!
Rate this content:
Still have a question?
 
Ask the community.