Cobranças
Cancelar Cobrança
DELETE
/v1/charges/:chargeIdBase URL Produção:
https://api.validapay.com.brBase URL Sandbox:
https://sandbox.validapay.com.brAutenticação
bearerAuthorizationstring · header · obrigatório
Envie no header:
Authorization: Bearer {{token}}Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| chargeId | string | Required | Chargeid |
Cancela uma cobrança que ainda não foi paga, invalidando o Pix ou boleto gerado.
Cancelar cobrança
const url = 'https://sandbox.validapay.com.br/v1/charges/:chargeId';
const options = {
method: 'DELETE',
headers: {
'Authorization': 'Bearer {{token}}'
},
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Response Examples
200200
{
"message": "Cobrança cancelada com sucesso",
"chargeId": "cha_xxx"
}400400
{
"code": "CHARGE_NOT_CANCELABLE",
"message": "Status não permite cancelamento"
}404404
{
"code": "CHARGE_NOT_FOUND"
}