Cobranças

Cancelar Cobrança

DELETE/v1/charges/:chargeId
Base URL Produção:https://api.validapay.com.br
Base URL Sandbox:https://sandbox.validapay.com.br

Autenticação

bearerAuthorizationstring · header · obrigatório

Envie no header:

Authorization: Bearer {{token}}

Path Parameters

NameTypeRequiredDescription
chargeIdstringRequiredChargeid

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"
}