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

https://api.mercadopago.com/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
PATH
id
string

REQUIRED

Payment identifier
HEADER
X-Idempotency-Key
string
This feature allows you to safely retry requests without the risk of accidentally performing the same action more than once. This is useful for avoiding errors, such as creating two identical refunds, for example. To ens...Ver más
BODY
amount
number
Refund amount. If this property (amount) is removed from body, it will create a full refund.
Response parameters
id
number
Refund identifier
payment_id
number
Payment identifier
amount
number
Refund amount
metadata
array
Contains payment metadata that is sent to us in the payment post
Errors

400Error

2063

The-action-requested-is-not-valid-for-the-current-payment-state

2085

Invalid-value-for-gateway_operation-

401Error

401

Invalid-token

4040

amount-attribute-must-be-positive

4041

amount-attribute-must-be-numeric

404Error

2000

Payment-not-found

2024

Payment-too-old-to-be-refunded

2032

Refund-not-found

3012

Invalid parameter security_code_length

3024

Not valid action - partial refund unsupported for this transaction

4211

Charge-detail-can't-be-null-or-empty

4248

Charge not found - Shown when the charge is not found

4291

Param-charge-id-can’t-be-null-or-empty

4292

Header-X-Idempotency-Key-can’t-be-null

4293

Invalid-payment-status-to-refund-charges

4294

Charge-type-not-valid-to-refund

4295

Partial-charge-refund-is-not-allowed

4296

Charge-already-refunded

4297

Invalid-charge-id

15016

Payment-too-old-to-be-refunded

Request
curl -X POST \
    'https://api.mercadopago.com/v1/payments/{id}/refunds'\
    -H 'Content-Type: application/json' \
       -H 'X-Idempotency-Key: 77e1c83b-7bb0-437b-bc50-a7a58e5660ac' \
       -H 'Authorization: Bearer TEST-8971*********918-01191*********5874530a4*********4799fdf-1*********' \
    -d '{
  "amount": 5
}'
Sample answer
{
  "id": 1009042015,
  "payment_id": 18552260055,
  "amount": 10,
  "metadata": [
    {}
  ],
  "source": [
    {
      "name": {
        "en": "Firstname Lastname",
        "pt": "Nome e sobrenome",
        "es": "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": [
    {}
  ]
}