Create refund/v1/payments/{id}/refundsCreate Partial/Full Refund for a specific payment. If the amount field is filled, it will create a partial refund, if not, it will create a full refund.
POST
Products that use it:
Request's parameters
idstring
Localization: pathPayment identifierREQUIRED
X-Idempotency-Key
Localization: headerIdempotency key. When used, avoids duplicated refundstring
amount
Localization: bodyRefund amount. If this property (amount) is removed from body, it will create a full refund.number
Response parameters
id
Localization: bodyRefund identifiernumber
payment_id
Localization: bodyPayment identifiernumber
amount
Localization: bodyRefund amountnumber
metadata
Localization: bodyContains payment metadata that is sent to us in the payment postarray
Request
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
}'
Answer
json
{
"id": 1009042015,
"payment_id": 18552260055,
"amount": 10,
"metadata": [
{}
],
"source": [
{
"name": "Firstname Lastname",
"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": [
{}
]
}
Errors
400bad_request
2063
401bad_request
401Valid-token-required-
4040Amount-should-be-more-than-0-
4041Amount-should-be-a-number-
404bad_request
2032X-Idempontency-key-already-used-
2000Payment_Id_does_not_exist-