LogoLogo
Become a PartnerStatus Page
  • get started
    • Welcome to 360Dialog
    • Quickstarts
      • Getting started as a partner
      • Register as a Meta Tech Provider
      • Add a WhatsApp Number
      • Set up Integrated Onboarding
      • Create a Message Template
      • Send a Message
    • Pricing & Billing
      • Payment Methods for BR: Pix & Boleto
      • Month Closing Invoice (MCI)
    • Get API Access
    • Tech Provider Program
      • Understanding the Meta Tech Provider Program
      • Becoming a Meta Tech Provider: A Step-by-Step Guide
  • MM Lite Beta Program
    • Onboarding
    • Sending Messages
    • MM Lite versus Cloud API
    • Expected Errors & Programming Languages
  • Voice Message Alpha Program
  • Partner & Account Management
    • Solutions for Partners
      • Benefits for Partners
      • Partner Hub
      • WABA Management
    • Account Setup & Management
      • Prerequisites and best practices for account creation
      • Account Structure
      • Account Creation
  • Integrations & API Development
    • Webhook Events & Setup
      • Webhook Events (Partner & Messaging API)
      • Webhook Configuration & Management
    • Integration Best Practices
      • Architecture and Security
      • Best Practices for Designing Integrations
        • Design a Stable Webhook Receiving Endpoint
      • Sizing Your Environment Based on Expected Throughput
      • Design a Resilient Message Sending Service
      • Integrated Onboarding
        • Basic Integrated Onboarding
        • Custom Integrated Onboarding
        • Host Your Own Embedded Signup
      • API Key Authentication for the Partner API
  • API Reference
    • Messaging API
    • Messaging Health Status
    • Sandbox (Test API Key)
    • Differences Between Cloud API and On-Premise API for Partners
      • [will be deprecated] Messaging with On-Premise API
    • Partner API
  • WABA Management
    • Managing WABA Accounts
      • Using the Partner Hub to manage Clients and Channels
      • Using the Partner API to manage Clients and Channels
      • Partner Permission to Generate API Key
      • Checking Usage & Statistics
    • Phone Number & Hosting
      • Migrating a Phone Number
        • Migrate number from Meta or alternate BSP to 360Dialog
        • Migrate a phone number to a new WABA
        • Migrate a phone number to a new WABA to change messaging Currency
      • WhatsApp Coexistence
        • Coexistence Onboarding
        • Coexistence Webhooks
        • Testing different messaging scenarios
      • Hosting type Change (On-premise API to Cloud API)
    • WABA Profile & Compliance
      • Display Name Guidelines
      • WABA Profile Info
      • WABA Policy Enforcement
      • Business Account Verification
    • Partner change (between 360Dialog Partners)
    • WhatsApp Flows
    • Accelerated Onboarding
    • Business Account Verification
  • Messaging
    • Sending & Receiving Messages
      • Conversations
      • Receiving messages
      • Before sending a message
    • Message Types
      • Conversational Components
      • Checklist for Message Broadcasts and Campaigns
      • Text messages
      • Interactive messages
        • Single and Multi Product Messages
        • Location Request Messages
        • Address Messages (India and Singapore only)
      • Contacts & Location Messages
    • Template Messages
      • Template Library
      • Template Elements
      • Sending Template Messages
      • Authentication Templates
        • Zero-Tap Authentication Templates
        • One-Tap Autofill Authentication Templates
        • Copy Code Authentication Templates
      • Catalog Templates
      • Product Card Carousel Templates
      • Single-Product Message Templates
      • Coupon Code Templates
      • Limited-Time Offer Templates
      • Multi-Product Templates
    • Media Messages
      • Upload, retrieve or delete media
    • Messaging Health & Troubleshooting
      • Messaging Limits & Quality Rating
      • Errors While Messaging
      • Messages statuses
  • Commerce & Payments
    • Payments (India Only)
      • Receive WhatsApp Payments via Payments Gateway
      • Receive WhatsApp Payments via Payment Links
      • Order Details Template Message
    • Payments (Singapore Only)
      • Receive WhatsApp Payments via Stripe
    • Payments API Brazil
      • Implementation
    • Products and Catalogs
      • India Businesses: Compliance for Commerce
  • Support & Updates
    • Help & Troubleshooting
      • FAQ
      • Error Code Reference
      • User Support Documentation
        • Tutorials
          • Page How to Troubleshoot Login Issues in the 360dialog Hub
          • How to Report an Issue
          • How to Contact Support
        • How-To Guides
          • Raise a Support Request
          • Requesting a Status Update for Business Verification
        • Reference
          • Troubleshooting Embedded Signup Issues
          • Commerce Policy Checks for WhatsApp API Access
          • Support Availability & SLAs
          • Incident Issue Prioritization
          • Case Types Table
        • Explanation
          • Why Business Verification Takes Time
          • Why Some Issues Are Not Emergencies
          • Understanding the Support Process
      • Support with Meta
    • Imprint & Data Privacy
    • Product Updates & News
      • How to ensure your Template Messages will be received
      • Integrated Onboarding new look and Campaigns Best Practices
Powered by GitBook
On this page
  • Pré-requisitos
  • Etapas para implementar
  • Enviando PIX sem janela de conversa aberta (usando templates)
  • Gerando um código PIX estático
  • Coleção no Postman
  • English
  • Pre-requisites
  • Steps to implement
  • Sending PIX without open conversation (using templates)
  • Generating a static Pix code
  • Postman collection
  • Extra resources

Was this helpful?

  1. Commerce & Payments
  2. Payments API Brazil

Implementation

Implementação: etapas, pré-requisitos e referências.

PreviousPayments API BrazilNextProducts and Catalogs

Last updated 2 days ago

Was this helpful?

Pré-requisitos

  • Seu número deve ser um WABA brasileiro (Conta Comercial do WhatsApp).

  • Sua WABA deve estar integrada via 360Dialog.

  • Você deve ter:

    • Um gateway de pagamento já implementado (para gerar PIX).

    • Um bot integrado ao WhatsApp (para gerenciar as conversas).

    • Sua chave de API e webhook devidamente configurados.

Etapas para implementar

As etapas abaixo funcionam com uma janela de conversa aberta. Para iniciar uma conversa, verifique outros exemplos mais abaixo.

1

Enviando um catálogo de produtos

Quando o usuário final estiver pronto para escolher produtos, envie uma mensagem com o catálogo de produtos.

Endpoint: https://waba-v2.360dialog.io/messages

Exemplo:

**************ENVIAR CATÁLOGO DE PRODUTOS***************
URL: https://waba-v2.360dialog.io/messages
Sample Request Body:
{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "{RECIPIENT_USER_PHONE_NO_HERE}",
    "type": "interactive",
    "interactive": {
        "type": "list",
        "header": {
            "type": "text",
            "text": "Obrigado por participar desta DEMO"
        },
        "body": {
            "text": "O objetivo é demonstrar como integrar pagamentos no Brasil usando PIX como Gateway de Pagamento"
        },
        "footer": {
            "text": ""
        },
        "action": {
            "button": "Buy an Item",
            "sections": [
                {
                    "title": "Items",
                    "rows": [
                        {
                            "id": "item-chocolate-10",
                            "title": "Chocolate (R$ 10)",
                            "description": "Chocolate Ao Leite Recheio Oreo Lacta Pacote 90g"
                        },
                        {
                            "id": "item-coffee-20",
                            "title": "Café (R$ 20)",
                            "description": "Café Torrado E Moído A Vácuo 3 Corações Gourmet Pacote 250g"
                        }
                    ]
                }
            ]
        }
    }
}

2

Gerando e enviando um código PIX com os detalhes do pedido

Depois que o usuário escolher um produto e fizer o pedido, envie um resumo com os detalhes e o código PIX para pagamento.

  1. O negócio (cliente ou parceiro) pode gerar o PIX internamente (veja a próxima seção desta página) usando sua própria implementação de gateway de pagamento, e usar esse código diretamente na API de mensagens para que chegue ao usuário final.

  2. O cliente/parceiro pode ter seus próprios status de pedido, conforme seu sistema interno de gestão. Por exemplo, após o pedido, o status pode ser "pendente", "confirmado" ou outro.

  3. O usuário verá uma mensagem de WhatsApp message com as informações do pedido e o Pix para copiar.

Garanta o uso de um reference_id para cada order_details mensagem. Esse ID deve ser o mesmo na geração do código PIX e na mensagem do WhatsApp, para permitir o rastreamento correto do . Se você for enviar várias mensagens order_details para o mesmo pedido, recomenda-se incluir um número sequencial no reference_id.

Para detalhes completos da implementação, consulte a .

Exemplo:

**************ENVIAR DETALHES DO PRODUTO COM CÓDIGO PIX DINÂMICO***************
URL: https://waba-v2.360dialog.io/messages
Sample Request Body:
{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "{RECIPIENT_USER_PHONE_NO_HERE}",
    "type": "interactive",
    "interactive": {
        "type": "order_details",
        "body": {
            "text": "Detalhes do seu pedido"
        },
        "action": {
            "name": "review_and_pay",
            "parameters": {
                "reference_id": "r123456789",
                "type": "digital-goods",
                "payment_type": "br",
           
                "payment_settings": [
                    {
                        "type": "pix_dynamic_code",
                        "pix_dynamic_code": {
                            "code": "{YOUR_DYNAMIC_PIX_CODE_HERE}",
                            "merchant_name": "Account holder name",
                            "key": "50561267000126",
                            "key_type": "CNPJ"
                        }
                    }
                ],
                "currency": "BRL",
                "total_amount": {
                    "value": 1000,
                    "offset": 100
                },
                "order": {
                    "status": "pending",
                    "tax": {
                        "value": 0,
                        "offset": 100,
                        "description": "imposto"
                    },
                    "items": [
                        {
                            "retailer_id": "1234567",
                            "name": "Chocolate (R$ 10)",
                            "amount": {
                                "value": 1000,
                                "offset": 100
                            },
                            "quantity": 1
                        }
                    ],
                    "subtotal": {
                        "value": 1000,
                        "offset": 100
                    }
                }
            }
        }
    }
}
3

Usuário realiza o pagamento

Agora, o usuário poderá copiar o código PIX, sair do WhatsApp e usar seu app de banco para concluir o pagamento.

A Meta não tem como rastrear esse pagamento, já que ocorre fora do WhatsApp e está vinculado aos sistemas internos do cliente/parceiro via gateway de pagamento.

4

Atualizando o status do pedido ao usuário

  • Depois que o pagamento for tentado pelo usuário, o cliente/parceiro recebe a atualização de status via gateway de pagamento.

  • Com base nisso, atualize o pedido internamente e envie uma mensagem de order_status ao usuário:

**************ENVIAR STATUS DO PEDIDO***************************
URL: https://waba-v2.360dialog.io/messages
Sample Request Body:
{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": ""{RECIPIENT_USER_PHONE_NO_HERE}"",
    "type": "interactive",
    "interactive": {
        "type": "order_status",
        "body": {
            "text": "Detalhes do seu pedido"
        },
        "footer" : {
            "text": "Reference: 123456789"
        },
        "action": {
            "name": "review_order",
            "parameters": {
                "reference_id": "123456789",
                "order": {
                    "status": "{ORDER_STATUS_HERE}"
                }
            }
        }
    }
}

Você pode enviar quantas atualizações forem necessárias, conforme seu fluxo interno.

Enviando PIX sem janela de conversa aberta (usando templates)

Se você quiser enviar um código PIX para o usuário sem conversa aberta, isso também é possível. Para isso, você precisará:

  1. Crie um template do tipo UTILITY (Utilidade) ou MARKETING (Marketing), seja via API ou pelo WhatsApp Manager.

  2. Use a versão pré-criada de order_details.

  3. Digite o nome desejado para o template.

  4. Preencha os componentes do template, como Cabeçalho (Header), Corpo (Body) e, opcionalmente, Rodapé (Footer), e envie.

  5. Após o envio, os templates serão e passarão por um processo de . Evite incluir conteúdo de marketing nos componentes do template.

  6. O template será aprovado ou rejeitado após a verificação dos componentes pelo sistema.

  7. Uma vez aprovado, o do template será alterado para ATIVO (ACTIVE).

Atenção: o status do template pode mudar automaticamente de ATIVO (ACTIVE) para PAUSADO (PAUSED) ou DESATIVADO (DISABLED) com base no feedback dos usuários. Recomendamos monitorar essas mudanças e tomar as ações apropriadas sempre que necessário.

Depois disso, você poderá enviar a mensagem do template incluindo as informações de order_details com o código PIX.

Exemplo: enviando detalhes do pedido com código de pagamento PIX dinâmico
**************ENVIAR DETALHES DO PEDIDO COM CÓDIGO DE PAGAMENTO PIX DINÂMICO***************************
URL: https://waba-v2.360dialog.io/messages
Sample Request Body:
{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "<end_user_number>",
  "type": "template",
  "template": {
    "name": "<template_name>",
    "language": {
      "policy": "deterministic",
      "code": "<template_language>"
    },
    "components": [
      {
        "type": "button",
        "sub_type": "order_details",
        "index": 0,
        "parameters": [
          {
            "type": "action",
            "action": {
              "order_details": {
                "reference_id": "unique-reference-id",
                "type": "digital-goods",
                "payment_type": "br",
                "payment_settings": [
                  {
                    "type": "pix_dynamic_code",
                    "pix_dynamic_code": {
                      "code": "<pix_code_here>",
                      "merchant_name": "<company_name>",
                      "key": "39580525000189",
                      "key_type": "CNPJ"
                    }
                  }
                ],
                "currency": "BRL",
                "total_amount": {
                  "value": 50000,
                  "offset": 100
                },
                "order": {
                  "status": "pending",
                  "tax": {
                    "value": 0,
                    "offset": 100,
                    "description": "optional text"
                  },
                  "items": [
                    {
                      "retailer_id": "1234567",
                      "name": "Cake",
                      "amount": {
                        "value": 50000,
                        "offset": 100
                      },
                      "quantity": 1
                    }
                  ],
                  "subtotal": {
                    "value": 50000,
                    "offset": 100
                  }
                }
              }
            }
          }
        ]
      }
    ]
  }
}

Gerando um código PIX estático

Coleção no Postman

Criamos uma coleção Postman para que você possa testar os requests. Basta substituir as variáveis pelos valores do seu negócio e importar a coleção para seu Postman:


English

Pre-requisites

  • Your number must be a Brazilian WABA (WhatsApp Business Account).

  • Your WABA must be onboarded via 360Dialog.

  • You must have:

    • A payment gateway already implemented (to generate PIX).

    • A bot integrated with WhatsApp (to manage conversations).

    • Your API key and webhook properly set up.

Steps to implement

The steps below work with an open conversation window. To initiate a conversation, please, check other examples below.

1

Send a product catalog

When end-user is ready for product selection, send a message with product catalog. Endpoint: https://waba-v2.360dialog.io/messages

Example:

**************Send PRODUCT CATALOGUE***************
URL: https://waba-v2.360dialog.io/messages
Sample Request Body:
{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "{RECIPIENT_USER_PHONE_NO_HERE}",
    "type": "interactive",
    "interactive": {
        "type": "list",
        "header": {
            "type": "text",
            "text": "Obrigado por participar desta DEMO"
        },
        "body": {
            "text": "O objetivo é demonstrar como integrar pagamentos no Brasil usando PIX como Gateway de Pagamento"
        },
        "footer": {
            "text": ""
        },
        "action": {
            "button": "Buy an Item",
            "sections": [
                {
                    "title": "Items",
                    "rows": [
                        {
                            "id": "item-chocolate-10",
                            "title": "Chocolate (R$ 10)",
                            "description": "Chocolate Ao Leite Recheio Oreo Lacta Pacote 90g"
                        },
                        {
                            "id": "item-coffee-20",
                            "title": "Café (R$ 20)",
                            "description": "Café Torrado E Moído A Vácuo 3 Corações Gourmet Pacote 250g"
                        }
                    ]
                }
            ]
        }
    }
}

2

Generate and send a PIX code with order details

Once the user selects a product and places the order, send the product summary along with payment details containing a PIX Code

  1. The business (client or partner) can generate the PIX internally (check at the next section of this page) at their end using their payment gateway implementation, and use the code directly in the message API, so it reaches the end user.

  2. The client/partner is free to have their own order statuses as per their internal order management system and use the same in order details message. For example, once the user places the order, you can maintain order in pending or confirmed, or any state that is applicable to your internal systems.

  3. The user will see a WhatsApp message with order info and a PIX code to copy.

Example:

**************Send PRODUCT DETAILS with DYNAMIC PIX PAYMENT CODE***************
URL: https://waba-v2.360dialog.io/messages
Sample Request Body:
{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "{RECIPIENT_USER_PHONE_NO_HERE}",
    "type": "interactive",
    "interactive": {
        "type": "order_details",
        "body": {
            "text": "Detalhes do seu pedido"
        },
        "action": {
            "name": "review_and_pay",
            "parameters": {
                "reference_id": "r123456789",
                "type": "digital-goods",
                "payment_type": "br",
           
                "payment_settings": [
                    {
                        "type": "pix_dynamic_code",
                        "pix_dynamic_code": {
                            "code": "{YOUR_DYNAMIC_PIX_CODE_HERE}",
                            "merchant_name": "Account holder name",
                            "key": "50561267000126",
                            "key_type": "CNPJ"
                        }
                    }
                ],
                "currency": "BRL",
                "total_amount": {
                    "value": 1000,
                    "offset": 100
                },
                "order": {
                    "status": "pending",
                    "tax": {
                        "value": 0,
                        "offset": 100,
                        "description": "imposto"
                    },
                    "items": [
                        {
                            "retailer_id": "1234567",
                            "name": "Chocolate (R$ 10)",
                            "amount": {
                                "value": 1000,
                                "offset": 100
                            },
                            "quantity": 1
                        }
                    ],
                    "subtotal": {
                        "value": 1000,
                        "offset": 100
                    }
                }
            }
        }
    }
}
3

User completes payment

Now user can copy the PIX code, navigate outside Whatsapp to their payment app and complete the payment

Please note that META does not have a way to track this payment status currently as the payment is happening on different bank apps and the payment gateway account is linked to the client/partner internal systems.

4

Update the user with order status

  • Once the end user attempts payment, you will receive the payment status update from your payment gateway

  • Basis the payment status received, you can update the status of the order in your order management system

  • Once the payment status is received from the payment gateway and internal order management steps/status updates are completed, you can send an update to the user using an order_status message:

**************Send ORDER STATUS***************************
URL: https://waba-v2.360dialog.io/messages
Sample Request Body:
{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": ""{RECIPIENT_USER_PHONE_NO_HERE}"",
    "type": "interactive",
    "interactive": {
        "type": "order_status",
        "body": {
            "text": "Detalhes do seu pedido"
        },
        "footer" : {
            "text": "Reference: 123456789"
        },
        "action": {
            "name": "review_order",
            "parameters": {
                "reference_id": "123456789",
                "order": {
                    "status": "{ORDER_STATUS_HERE}"
                }
            }
        }
    }
}

You can send updates as often as needed, based on your internal order workflow.

Sending PIX without open conversation (using templates)

If you need to send the PIX code directly to the end-user number without an open conversation window, it is also possible, but keep in mind that you will need to create a template and add the order_details message within the template.

  1. Create a UTILITY or MARKETING template either via API or via WhatsApp Manager.

  2. Use the pre-created order_details version.

  3. Enter the desired template name.

  4. Please fill in template components such as Header, Body and optional footer text and submit.

  5. The template will be approved or rejected after the template components are verified by the system.

Example: sending order details with dynamic PIX payment code
**************Send ORDER DETAILS with DYNAMIC PIX PAYMENT CODE***************************
URL: https://waba-v2.360dialog.io/messages
Sample Request Body:
{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "<end_user_number>",
  "type": "template",
  "template": {
    "name": "<template_name>",
    "language": {
      "policy": "deterministic",
      "code": "<template_language>"
    },
    "components": [
      {
        "type": "button",
        "sub_type": "order_details",
        "index": 0,
        "parameters": [
          {
            "type": "action",
            "action": {
              "order_details": {
                "reference_id": "unique-reference-id",
                "type": "digital-goods",
                "payment_type": "br",
                "payment_settings": [
                  {
                    "type": "pix_dynamic_code",
                    "pix_dynamic_code": {
                      "code": "<pix_code_here>",
                      "merchant_name": "<company_name>",
                      "key": "39580525000189",
                      "key_type": "CNPJ"
                    }
                  }
                ],
                "currency": "BRL",
                "total_amount": {
                  "value": 50000,
                  "offset": 100
                },
                "order": {
                  "status": "pending",
                  "tax": {
                    "value": 0,
                    "offset": 100,
                    "description": "optional text"
                  },
                  "items": [
                    {
                      "retailer_id": "1234567",
                      "name": "Cake",
                      "amount": {
                        "value": 50000,
                        "offset": 100
                      },
                      "quantity": 1
                    }
                  ],
                  "subtotal": {
                    "value": 50000,
                    "offset": 100
                  }
                }
              }
            }
          }
        ]
      }
    ]
  }
}

Generating a static Pix code

Postman collection

Extra resources

Check here Meta documentations on the subject:

Para todos os detalhes, consulte a .

Como visto acima, é necessário configurar a mensagem com um código PIX. Se você não sabe como gerar um código PIX estático, há um repositório público no GitHub que pode ajudar. .

Make sure to use a unique reference_id for each order_details message. This ID should be consistent across the PIX code generation and the WhatsApp message to allow accurate internal tracking of . If you plan to send multiple order_details messages for the same order or invoice, we recommend including a sequence number in the reference_id to ensure uniqueness.

For complete implementation details, please refer to the official .

Once submitted, templates will be and undergo the please refrain from having marketing content as part of template components.

Once approved template will be changed to ACTIVE.

Please be informed that template's status can change automatically from ACTIVE to PAUSED or DISABLED based on customer feedback. We recommend that you and take appropriate actions whenever such change occurs.

After that, you can send the template message including the order_details information with the PIX code. For all the details, please verify the official documentation .

As you observed above, you must configure a payment setting that includes your Pix code. If you are unsure how to generate a static Pix code to implement in your solution, we used a public GitHub repository to obtain one. For more information, you can access the repository .

We built a Postman collection that you can use to test the requests, replacing the current variables with their corresponding values from your business. Please, download it below and :

documentação oficial
Veja aqui
payment statuses
Meta documentation
categorized as per the guidelines
approval process,
status
monitor status changes
here
here
import it into your collection
status do pagamento
documentação do Meta
aprovação
status
Payments API - Brazil - WhatsApp Cloud API - Documentation - Meta for DevelopersMeta for Developers
Pix - Documentation - Meta for DevelopersMeta for Developers
Order Details Template - Documentation - Meta for DevelopersMeta for Developers
Logo
Logo
Logo
9KB
Native Payment - PIX.postman_collection.json
Postman collection
9KB
Native Payment - PIX.postman_collection.json
Postman collection
Payments API Brazil: Payment option
Payments API Brazil: Payment option
categorizados conforme as diretrizes