cauril/Docs

Reembolsar un pago

post/v1/payments/{id}/refund

Reembolsa un pago total o parcialmente. Omitir amount reembolsa el saldo disponible. Requiere Idempotency-Key.

Request

BASH
curl -X POST https://api.cauril.com/v1/payments/<id>/refund \
  -H "Authorization: Bearer sk_test_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 5000,
    "reason": "requested_by_customer",
    "metadata": {}
  }'

Parámetros

idpathreqstring
Idempotency-KeyheaderreqstringClave única por operación (ej. un UUID). Reintentar con la misma key replica la respuesta original.

Cuerpo CreateRefund

amountMoney
reasonstring
metadataobject

Respuestas

201Reembolso creadoRefund
402ErrorError
409ErrorError
422ErrorError

Ejemplo de respuesta · 201

JSON
{
  "object": "refund",
  "id": "ref_01J...",
  "payment_id": "string",
  "amount": 5000,
  "currency": "USD",
  "status": "pending",
  "reason": null,
  "provider_refund_id": null,
  "metadata": {},
  "created_at": "2026-06-01T12:00:00Z",
  "updated_at": "2026-06-01T12:00:00Z"
}