Cobranças
Arquivar Cobrança
POST
/v1/charges/:chargeId/archiveBase 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 |
Guarda uma cobrança do histórico sem cancelá-la, útil para organizar cobranças antigas.
Arquivar cobrança
Só cobranças canceladas podem ser arquivadas.
const url = 'https://sandbox.validapay.com.br/v1/charges/:chargeId/archive';
const options = {
method: 'POST',
headers: {
'Authorization': 'Bearer {{token}}'
},
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Response Examples
200200
{
"chargeId": "cha_xxx",
"status": "ARCHIVED",
"archivedAt": "2024-01-20T10:00:00Z"
}400400
{
"code": "CHARGE_NOT_ARCHIVABLE",
"message": "Só cobranças canceladas podem ser arquivadas"
}404404
{
"code": "CHARGE_NOT_FOUND"
}