Crear reembolso - Reembolsos - Mercado Pago Developers
Crear reembolso

POST

/v1/payments/{id}/refunds
Crear reembolsos parciales/totales para un pago específico. Si el campo de suma ha sido completado, creará un reembolso parcial, en caso contrario, creará un reembolso total.
Parámetros para la solicitud
id

REQUERIDO

string
Localización: pathIdentificador de pago
X-Idempotency-Key
string
Localización: headerIdempotency key. Al usarse, evita los reembolsos duplicados
amount
number
Localización: bodyMonto de reembolso. Si esta propiedad (monto) es removida del body, creará un reembolso total.
Parámetros de respuesta
id
number
Localización: bodyIdentificador de reembolso
payment_id
number
Localización: bodyIdentificador de pago
amount
number
Localización: bodyMonto de reembolso
metadata
array
Localización: bodyContiene metadatos del pago que nos envían en el post del payment
Solicitud
curl
curl -X POST \
      'https://api.mercadopago.com/v1/payments/{id}/refunds' \
      -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
      -H 'Content-Type: application/json' \ 
      -d '{
  "amount": 5
}'
Respuesta
json
{
  "id": 1009042015,
  "payment_id": 18552260055,
  "amount": 10,
  "metadata": [
    {}
  ],
  "source": [
    {
      "name": "Nombre y apellido",
      "id": "1003743392",
      "type": "collector"
    }
  ],
  "date_created": "2021-11-24T13:58:49.312-04:00",
  "unique_sequence_number": null,
  "refund_mode": "standard",
  "adjustment_amount": 0,
  "status": "approved",
  "reason": null,
  "label": [
    {}
  ],
  "partition_details": [
    {}
  ]
}
Errores
400bad_request
2063 missing information on header or the payment was fully refund-
2085Invalid-value-for-gateway_operation-
401bad_request
401 Valid token required
4040 Amount should be more than 0
4041 Amount should be a number
404bad_request
2000 Payment_id does not exist
2024Payment-too-old-to-be-refunded
2032 X-Idempontency-key already used
3012Invalid parameter security_code_length
3024Not valid action - partial refund unsupported for this transaction
4211 Triggered when empty or null is sent in the charge_details field
4248Charge not found - Shown when the charge is not found
4291 Triggered when empty or null is sent in the charge_id field
4292 Triggered when the X-Idempotency-Key parameter is not sent and charges idempotency is enabled.
4293 Triggered when the status and status_detail of the payment are different from "approved" and "accredited" respectively
4294 Triggered when trying to refund a charge type that is not allowed.
4295 Triggered when attempting to partially refund a charge.
4296 Triggered when trying to refund a charge that has already been refunded.
4297 Triggered when the charge id has an invalid format.
15016Payment-too-old-to-be-refunded