POST /v1/charges
const url = 'https://seu-endereco-da-api/v1/charges';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"provider":"asaas","manual":{"pixCode":"example","boletoLine":"example","paymentUrl":"example"},"contactId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","dealId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","valueCents":1,"dueDate":"example","description":"example","document":"example","idempotencyKey":"example","confirmDuplicate":true,"newDealPipelineId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "provider": "asaas", "manual": { "pixCode": "example", "boletoLine": "example", "paymentUrl": "example" }, "contactId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "dealId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "valueCents": 1, "dueDate": "example", "description": "example", "document": "example", "idempotencyKey": "example", "confirmDuplicate": true, "newDealPipelineId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Permissão que a Chave de acesso precisa: Emitir e cancelar cobranças pelo Asaas (charges:manage).
Authorizations
Seção intitulada “Authorizations”Request Bodyrequired
Seção intitulada “Request Bodyrequired”object
object
Responses
Seção intitulada “Responses”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
Whether the boleto PDF was saved in the files of the charge’s deal
Example
{ "provider": "asaas", "status": "creating", "environment": "sandbox", "methods": [ "pix" ]}Invalid CPF/CNPJ, due date in the past, or contact not linked to the deal
Asaas not connected, or contact/deal not found
Open charge already exists, charging is off, or the charge is still being created
Payer CPF/CNPJ missing, Asaas refused the charge, or a manual charge without a code or link
Asaas did not answer