POST /v1/charges/{id}/messages
const url = 'https://seu-endereco-da-api/v1/charges/example/messages';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"conversationId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","templateId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","variables":["example"],"idempotencyKey":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://seu-endereco-da-api/v1/charges/example/messages \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "conversationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "templateId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "variables": [ "example" ], "idempotencyKey": "example" }'Permissão que a Chave de acesso precisa: Enviar mensagem e atender (conversations:write) e Emitir e cancelar cobranças pelo Asaas (charges:manage).
Authorizations
Seção intitulada “Authorizations”Parameters
Seção intitulada “Parameters”Path Parameters
Seção intitulada “Path Parameters”Request Bodyrequired
Seção intitulada “Request Bodyrequired”object
Example generated
{ "conversationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "templateId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "variables": [ "example" ], "idempotencyKey": "example"}Responses
Seção intitulada “Responses”object
object
Null for a manual charge
Methods the charge offers, in the order they are sent
Payment link: the Asaas invoice page, or the link typed for a manual charge
Pix copy and paste code
Boleto digitable line
Order items, only for a charge sent as order details
object
object
Asaas page with the proof of payment, known once the payment is confirmed
When the charge stops accepting payment
When the money became available in the Asaas account
How many times the payment message was sent again to the customer
Example
{ "charge": { "provider": "asaas", "status": "creating", "environment": "sandbox", "methods": [ "pix" ] }}Not an approved payment template of the conversation’s account, or wrong variable count
Charge, conversation or template not found
The charge is not open, lacks a method of the template, belongs to another contact, or the channel is not WhatsApp Business
The Pix receiver is missing for an order by Pix