Recusar refund
curl --request POST \
--url https://api.sandbox.z2pay.com/v1/refunds/{id}/refuse \
--header 'x-api-key: <api-key>'const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.z2pay.com/v1/refunds/{id}/refuse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sandbox.z2pay.com/v1/refunds/{id}/refuse"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text){
"id": "rfd_j3cpkaysqmix17mxhcmv8qypl",
"transactionId": "txn_aqbcw2lky42xfidw5pcdss8h1",
"paymentId": "pay_jxt9b5qv1x0h0h8ustleqjgr8",
"amount": 14990,
"currency": "BRL",
"status": "refused",
"reason": "Cliente solicitou cancelamento da compra",
"requestedByType": "api",
"paymentMethod": "credit_card",
"customerId": "cust_lhsmn6ugmjotm5qvnunrr2hz1",
"customerName": "Maria Silva",
"customerEmail": "maria.silva@example.com",
"customerDocument": "12345678909",
"customerDocumentType": "cpf",
"additionalInfo": {
"checkoutLinkId": "chk_byd8p3p79re859jpkmr0j65n3"
},
"failureReason": null,
"reviewedAt": "2025-06-29T15:05:00.000Z",
"refundedAt": null,
"createdAt": "2025-06-29T13:45:30.000Z",
"updatedAt": "2025-06-29T15:05:00.000Z"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Refund not found"
}
}{
"error": {
"code": "CONFLICT",
"message": "No refundable payment found"
}
}{
"error": "Idempotency key already used with a different request body"
}Reembolsos
Recusar reembolso
Recusa um reembolso pendente. A decisão é terminal — o pedido não volta a ficar disponível.
POST
/
refunds
/
{id}
/
refuse
Recusar refund
curl --request POST \
--url https://api.sandbox.z2pay.com/v1/refunds/{id}/refuse \
--header 'x-api-key: <api-key>'const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.z2pay.com/v1/refunds/{id}/refuse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sandbox.z2pay.com/v1/refunds/{id}/refuse"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text){
"id": "rfd_j3cpkaysqmix17mxhcmv8qypl",
"transactionId": "txn_aqbcw2lky42xfidw5pcdss8h1",
"paymentId": "pay_jxt9b5qv1x0h0h8ustleqjgr8",
"amount": 14990,
"currency": "BRL",
"status": "refused",
"reason": "Cliente solicitou cancelamento da compra",
"requestedByType": "api",
"paymentMethod": "credit_card",
"customerId": "cust_lhsmn6ugmjotm5qvnunrr2hz1",
"customerName": "Maria Silva",
"customerEmail": "maria.silva@example.com",
"customerDocument": "12345678909",
"customerDocumentType": "cpf",
"additionalInfo": {
"checkoutLinkId": "chk_byd8p3p79re859jpkmr0j65n3"
},
"failureReason": null,
"reviewedAt": "2025-06-29T15:05:00.000Z",
"refundedAt": null,
"createdAt": "2025-06-29T13:45:30.000Z",
"updatedAt": "2025-06-29T15:05:00.000Z"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Refund not found"
}
}{
"error": {
"code": "CONFLICT",
"message": "No refundable payment found"
}
}{
"error": "Idempotency key already used with a different request body"
}POST /refunds/:id/refuse
Faz parte do recurso Reembolsos — o objeto, os status e o ciclo estão lá.
Recusa um reembolso que ficou aguardando decisão. A requisição não tem corpo: o que ela grava é a
decisão e o instante, que sai em reviewedAt. Quem decidiu não aparece na resposta — a recusa
nominal, com o usuário identificado, é a do painel.
Só reembolso
pending pode ser recusado, e a recusa é terminal. refused é estado final —
não há como reverter nem reenviar o mesmo pedido. Para estornar depois de recusar, é preciso criar
um novo estorno em POST /payments/{paymentId}/refund.Em qualquer outro estado a resposta é 409, inclusive numa segunda chamada sobre o que já foi
recusado.O motivo da recusa não é registrado. A API não tem campo para ele, e o painel também não pede.
O que fica gravado é a decisão e o instante — o
reason do reembolso continua sendo o
motivo do estorno, informado quando ele foi criado.Endpoint idempotente. Envie o header
Idempotency-Key para que um retry por timeout não produza
uma segunda tentativa de recusa. Veja Convenções.Response
Refund recusado