¿Te sirvió esta información?
Sí
No
Crear reembolso/v1/payments/{id}/refundsCrear 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.
POST
Productos que lo utilizan:
Parámetros para la solicitud
idstring
Localización: pathIdentificador de pagoREQUERIDO
X-Idempotency-Key
Localización: headerIdempotency key. Al usarse, evita los reembolsos duplicadosstring
amount
Localización: bodyMonto de reembolso. Si esta propiedad (monto) es removida del body, creará un reembolso total.number
Parámetros de respuesta
id
Localización: bodyIdentificador de reembolsonumber
payment_id
Localización: bodyIdentificador de pagonumber
amount
Localización: bodyMonto de reembolsonumber
metadata
Localización: bodyContiene metadatos del pago que nos envían en el post del paymentarray
Solicitud
curl
curl -X POST \
'https://api.mercadopago.com/v1/payments/{id}/refunds' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN \
-H 'Content-Type: application/json' \
-H 'X-Idempotency-Key: 77e1c83b-7bb0-437b-bc50-a7a58e5660ac' \
-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
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