POST /v1/charges/{id}/mark-paid
POST
/v1/charges/{id}/mark-paid
const url = 'https://seu-endereco-da-api/v1/charges/example/mark-paid';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"winDeal":true}'};
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/mark-paid \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "winDeal": true }'Permissão que a Chave de acesso precisa: 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”id
required
string
Request Bodyrequired
Seção intitulada “Request Bodyrequired”Media typeapplication/json
object
winDeal
boolean
Example generated
{ "winDeal": true}Responses
Seção intitulada “Responses”Media typeapplication/json
object
id
required
string
provider
required
string
contactId
required
string
dealId
required
string
status
required
string
environment
required
Null for a manual charge
string
valueCents
required
number
description
required
string
dueDate
required
string format: date
methods
required
Methods the charge offers, in the order they are sent
Array<string>
invoiceUrl
required
Payment link: the Asaas invoice page, or the link typed for a manual charge
string
pixCode
required
Pix copy and paste code
string
boletoLine
required
Boleto digitable line
string
order
required
Order items, only for a charge sent as order details
object
items
required
Array<object>
object
retailerId
required
string
name
required
string
amountCents
required
number
quantity
required
number
taxCents
required
number
shippingCents
required
number
discountCents
required
number
receiptUrl
required
Asaas page with the proof of payment, known once the payment is confirmed
string
failureReason
required
string
expiresAt
required
When the charge stops accepting payment
string format: date-time
paidAt
required
string format: date-time
availableAt
required
When the money became available in the Asaas account
string format: date-time
refundedAt
required
string format: date-time
canceledAt
required
string format: date-time
expiredAt
required
string format: date-time
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
createdByName
required
string
markedPaidByName
required
string
lastResentAt
required
string format: date-time
lastResentByName
required
string
resendCount
required
How many times the payment message was sent again to the customer
number
Example
{ "provider": "asaas", "status": "creating", "environment": "sandbox", "methods": [ "pix" ]}Charge not found
The charge is not open, or it is an Asaas charge, which Asaas itself marks as paid