Skip to main content
curl -X POST "https://api.chargefy.io/v1/refunds" \
  -H "Authorization: Bearer {{API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{
    "charge": "ch_123"
  }'
{
  "id": "re_123",
  "object": "refund",
  "amount": 5000,
  "balance_transaction": null,
  "charge": "ch_123",
  "created_at": "2026-05-20T18:35:00Z",
  "currency": "brl",
  "customer": "cus_123",
  "description": null,
  "destination_details": null,
  "failure_balance_transaction": null,
  "failure_reason": null,
  "instructions_email": null,
  "livemode": true,
  "metadata": {
    "order_id": "1001"
  },
  "next_action": null,
  "payment_intent": "pi_123",
  "pending_reason": null,
  "reason": "requested_by_customer",
  "receipt_number": null,
  "source_transfer_reversal": null,
  "status": "succeeded",
  "transfer_reversal": null,
  "updated_at": "2026-05-20T18:35:00Z"
}
Cria um refund para uma charge capturada. Envie charge ou payment_intent; quando payment_intent é usado, a Chargefy resolve a charge capturada automaticamente. Se amount não for enviado, o refund usa todo o valor ainda disponível. Payment intents em requires_capture ainda não foram capturados e não geram refund. Nesse caso, cancele o payment intent com POST /v1/payment-intents/:id/cancel. Fees cobradas pela Chargefy não são devolvidas quando um refund é criado.
charge
string
ID da charge que será reembolsada (ch_*). Envie charge ou payment_intent, não ambos.
payment_intent
string
ID do payment intent (pi_*) cuja charge capturada será reembolsada. Envie charge ou payment_intent, não ambos.
amount
integer
Valor do refund, em centavos. Se omitido, usa o valor disponível inteiro.
metadata
object
Pares chave-valor livres associados ao refund.
reason
string
Motivo do refund: duplicate, fraudulent ou requested_by_customer. Chargeback/dispute é um fluxo separado, não um motivo de refund.
curl -X POST "https://api.chargefy.io/v1/refunds" \
  -H "Authorization: Bearer {{API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{
    "charge": "ch_123"
  }'
{
  "id": "re_123",
  "object": "refund",
  "amount": 5000,
  "balance_transaction": null,
  "charge": "ch_123",
  "created_at": "2026-05-20T18:35:00Z",
  "currency": "brl",
  "customer": "cus_123",
  "description": null,
  "destination_details": null,
  "failure_balance_transaction": null,
  "failure_reason": null,
  "instructions_email": null,
  "livemode": true,
  "metadata": {
    "order_id": "1001"
  },
  "next_action": null,
  "payment_intent": "pi_123",
  "pending_reason": null,
  "reason": "requested_by_customer",
  "receipt_number": null,
  "source_transfer_reversal": null,
  "status": "succeeded",
  "transfer_reversal": null,
  "updated_at": "2026-05-20T18:35:00Z"
}