Create refund - Refunds - Mercado Pago Developers
Which documentation are you looking for?

Do not know how to start integrating? 

Check the first steps
Create refund

POST

/v1/payments/{id}/refunds
Create 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.
Request's parameters
id

REQUIRED

string
Localization: pathPayment identifier
X-Idempotency-Key
string
Localization: headerIdempotency key. When used, avoids duplicated refund
amount
number
Localization: bodyRefund amount. If this property (amount) is removed from body, it will create a full refund.
Response parameters
id
number
Localization: bodyRefund identifier
payment_id
number
Localization: bodyPayment identifier
amount
number
Localization: bodyRefund amount
metadata
array
Localization: bodyContains payment metadata that is sent to us in the payment post
Request
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
}'
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 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