Implementation
Implementação: etapas, pré-requisitos e referências.
Last updated
Was this helpful?
Implementação: etapas, pré-requisitos e referências.
Last updated
Was this helpful?
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.
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.
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.
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.
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:
Se você quiser enviar um código PIX para o usuário sem conversa aberta, isso também é possível. Para isso, você precisará:
Crie um template do tipo UTILITY (Utilidade) ou MARKETING (Marketing), seja via API ou pelo WhatsApp Manager.
Use a versão pré-criada de order_details
.
Digite o nome desejado para o template.
Preencha os componentes do template, como Cabeçalho (Header), Corpo (Body) e, opcionalmente, Rodapé (Footer), e envie.
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.
O template será aprovado ou rejeitado após a verificação dos componentes pelo sistema.
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.
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:
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.
Once the user selects a product and places the order, send the product summary along with payment details containing a PIX Code
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.
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.
The user will see a WhatsApp message with order info and a PIX code to copy.
Example:
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.
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:
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.
Create a UTILITY or MARKETING template either via API or via WhatsApp Manager.
Use the pre-created order_details
version.
Enter the desired template name.
Please fill in template components such as Header, Body and optional footer text and submit.
The template will be approved or rejected after the template components are verified by the system.
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 :