logo
enes

Order details and payment

Last update: 6 hours ago by Irais Aguirre

Integration summary

  • Endpoint: POST https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging
  • Token: messaging token, in the Authorization: Bearer {{wa-msg-api-token}} header (how to generate it)
  • Common fields: from, to (phone number or BSUID) and type (details)
  • type values on this page: "interactive"
  • Response: the same for every message (see response)

Interactive order details message (order_details) with one or more payment methods for customers in Brazil. All amounts are in Brazilian reais (BRL). All are sent with POST /v1/messaging; headers (Headers), common fields and the response (Response) are in HTTP connection.

Order details

Sends the details of an order and requests payment. The type field must be "interactive" and the content goes in the order_details object with the "review_and_pay" action. Examples for each payment method are in the following sections.

Body

Fields for Order details:

NameDescriptionTypeRequirements
fromPhone number (with country code) the message is sent from.StringRequired
toRecipient's phone number in E.164 format, without the + sign. You can also use the user's BSUID, for example, US.13491208655302741918.StringRequired
typeMessage type. Must be "interactive".StringRequired
order_detailsObject with the message content and payment details.ObjectRequired

Order details object

NameDescriptionTypeRequirements
bodyMain text of the message.StringRequired
footerFooter text of the message.StringOptional
headerImageOptional image header (link or id).ObjectOptional
actionObject with the action and its parameters.ObjectRequired

Action object

NameDescriptionTypeRequirements
nameAction name. Must be "review_and_pay".StringRequired
parametersObject with the order and payment data.ObjectRequired

Parameters object

NameDescriptionTypeRequirements
reference_idUnique order ID. Only English letters, numbers, hyphens, underscores, and periods are allowed.StringRequired
payment_typeMust be "br". This section documents the Brazil-specific payment flow only; other payment_type values belong to a separate global payments API that is not documented here.StringRequired
typeType of goods. Possible values:
  • digital-goods
  • physical-goods
StringRequired
payment_settingsList of payment methods. Accepts one or more methods.ArrayRequired
currencyPayment currency. Must be "BRL".StringRequired
total_amount.valueTotal amount as an integer.LongRequired
total_amount.offsetMust be 100.IntegerRequired
orderOrder breakdown (status, tax, items, and subtotal). Omitted in the simplified payload.ObjectOptional

Note: supported_payment_methods belongs to the separate global payments API and is not valid in this Brazil flow (payment_type=br). This service does not block the combination; Meta rejects it upstream and returns the corresponding Graph API error, which is surfaced back to the caller.

Order object

NameDescriptionTypeRequirements
statusOrder status. Values: pending, processing, partially_shipped, shipped, completed, canceled.StringRequired when order is sent
catalog_idCatalog identifier.StringOptional
expirationObject { timestamp, description }.ObjectOptional
itemsList of order items.List of objectsRequired when order is sent
subtotalamount object for the subtotal. value must be > 0.ObjectRequired when order is sent
taxamount object for tax.ObjectOptional
shippingamount object for shipping.ObjectOptional
discountamount object for discount.ObjectOptional

items[] object

NameDescriptionTypeRequirements
nameItem name.StringRequired
amountamount object for the item. amount.value > 0.ObjectRequired
quantityItem quantity.IntegerOptional
retailer_idRetailer item identifier.StringOptional
catalog_idCatalog identifier.StringOptional
sale_amountamount object with the sale price.ObjectOptional

amount object

NameDescriptionTypeRequirements
valueAmount as integer.LongRequired (> 0)
offsetScale factor. Must be 100 when payment_type is br.IntegerRequired

Payment settings object

NameDescriptionTypeRequirements
typePayment method. Possible values:
  • payment_link: Payment link.
  • pix_dynamic_code: PIX dynamic code.
  • boleto: Boleto.
StringRequired
payment_linkObject with the Payment link data.ObjectRequired if type is payment_link
pix_dynamic_codeObject with the PIX dynamic code data.ObjectRequired if type is pix_dynamic_code
boletoObject with the Boleto data.ObjectRequired if type is boleto

Payment link object

NameDescriptionTypeRequirements
uriURL that opens in the browser when the button is tapped. Must use the https scheme.StringRequired

Pix dynamic code object

NameDescriptionTypeRequirements
codePIX dynamic code the buyer copies to make the payment.StringRequired
merchant_nameName of the PIX account holder.StringRequired
keyMerchant's PIX key.StringRequired
key_typeKey type. Possible values:
  • CPF
  • CNPJ
  • EMAIL
  • PHONE
  • EVP
StringRequired

Boleto object

NameDescriptionTypeRequirements
digitable_lineDigitable line the buyer copies to pay at their bank.StringRequired


PIX dynamic code

Shows a button the buyer uses to copy the PIX code and pay from their banking app.

Example

Complete PIX dynamic code example:

HTTP request with full payload

curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \
-H 'Authorization: Bearer {{wa-msg-api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"from": "5511900000001",
"to": "5511900000002",
"type": "interactive",
"order_details": {
"body": "Detalhes do seu pedido",
"footer": "Pagamento seguro",
"action": {
"name": "review_and_pay",
"parameters": {
"reference_id": "pix-full-001",
"payment_type": "br",
"type": "digital-goods",
"payment_settings": [
{
"type": "pix_dynamic_code",
"pix_dynamic_code": {
"code": "00020101021226700014br.gov.bcb.pix2548pix.example.com",
"merchant_name": "Minha Loja",
"key": "39580525000189",
"key_type": "CNPJ"
}
}
],
"currency": "BRL",
"total_amount": { "value": 50000, "offset": 100 },
"order": {
"status": "pending",
"tax": { "value": 0, "offset": 100, "description": "Imposto" },
"items": [
{
"retailer_id": "SKU-001",
"name": "Bolo de chocolate",
"amount": { "value": 50000, "offset": 100 },
"quantity": 1
}
],
"subtotal": { "value": 50000, "offset": 100 }
}
}
}
}
}'

HTTP request with simplified payload

curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \
-H 'Authorization: Bearer {{wa-msg-api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"from": "5511900000001",
"to": "5511900000002",
"type": "interactive",
"order_details": {
"body": "Detalhes do seu pedido",
"action": {
"name": "review_and_pay",
"parameters": {
"reference_id": "pix-simple-002",
"payment_type": "br",
"type": "digital-goods",
"payment_settings": [
{
"type": "pix_dynamic_code",
"pix_dynamic_code": {
"code": "00020101021226700014br.gov.bcb.pix2548pix.example.com",
"merchant_name": "Minha Loja",
"key": "39580525000189",
"key_type": "CNPJ"
}
}
],
"currency": "BRL",
"total_amount": { "value": 50000, "offset": 100 }
}
}
}
}'


Boleto

Shows a button the buyer uses to copy the boleto's digitable line and pay it at their bank.

Example

Complete Boleto example:

HTTP request with full payload

curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \
-H 'Authorization: Bearer {{wa-msg-api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"from": "5511900000001",
"to": "5511900000002",
"type": "interactive",
"order_details": {
"body": "Detalhes do seu pedido",
"footer": "Pagamento seguro",
"action": {
"name": "review_and_pay",
"parameters": {
"reference_id": "boleto-br-full-001",
"payment_type": "br",
"type": "digital-goods",
"payment_settings": [
{
"type": "boleto",
"boleto": { "digitable_line": "03399026944140000002628346101018898510000008848" }
}
],
"currency": "BRL",
"total_amount": { "value": 50000, "offset": 100 },
"order": {
"status": "pending",
"tax": { "value": 0, "offset": 100, "description": "Imposto" },
"items": [
{
"retailer_id": "SKU-001",
"name": "Bolo de chocolate",
"amount": { "value": 50000, "offset": 100 },
"quantity": 1
}
],
"subtotal": { "value": 50000, "offset": 100 }
}
}
}
}
}'

HTTP request with simplified payload

curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \
-H 'Authorization: Bearer {{wa-msg-api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"from": "5511900000001",
"to": "5511900000002",
"type": "interactive",
"order_details": {
"body": "Detalhes do seu pedido",
"action": {
"name": "review_and_pay",
"parameters": {
"reference_id": "boleto-br-simple-002",
"payment_type": "br",
"type": "digital-goods",
"payment_settings": [
{
"type": "boleto",
"boleto": { "digitable_line": "03399026944140000002628346101018898510000008848" }
}
],
"currency": "BRL",
"total_amount": { "value": 50000, "offset": 100 }
}
}
}
}'


Multiple payment methods

A single message can offer PIX, Payment link, and Boleto at the same time, along with buttons for websites and phone contact.

Example

Complete Multiple payment methods example:

HTTP request with PIX, Payment link, and Boleto

curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \
-H 'Authorization: Bearer {{wa-msg-api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"from": "5511900000001",
"to": "5511900000002",
"type": "interactive",
"order_details": {
"body": "Detalhes do seu pedido",
"action": {
"name": "review_and_pay",
"parameters": {
"reference_id": "multi-br-001",
"payment_type": "br",
"type": "digital-goods",
"payment_settings": [
{
"type": "pix_dynamic_code",
"pix_dynamic_code": {
"code": "00020101021226700014br.gov.bcb.pix2548pix.example.com",
"merchant_name": "Minha Loja",
"key": "39580525000189",
"key_type": "CNPJ"
}
},
{
"type": "payment_link",
"payment_link": { "uri": "https://minhaloja.com.br/pagar/001" }
},
{
"type": "boleto",
"boleto": { "digitable_line": "03399026944140000002628346101018898510000008848" }
}
],
"currency": "BRL",
"total_amount": { "value": 50000, "offset": 100 }
}
}
}
}'


WhatsApp — Previous
Payments Brasil
Next — WhatsApp
Order status