Criar reembolso - Reembolsos - Mercado Pago Developers
Qual documentação você quer buscar?

Não sabe como começar a integrar? 

Acesse os primeiros passos
Criar reembolso

POST

https://api.mercadopago.com/v1/payments/{id}/refunds
Criar um reembolso parcial/total para um pagamento específico. Se o campo amount estiver preechido, será criado um reembolso parcial, caso contrário, se criará um reembolso total.
Parâmetros de requisição
PATH
id
string

OBRIGATÓRIO

Identificador de pagamento
HEADER
X-Idempotency-Key
string
Esta função permite repetir solicitações de forma segura, sem o risco de realizar a mesma ação mais de uma vez por engano. Isso é útil para evitar erros, como a criação de dois reembolsos idênticos, por exemplo. Para gar...Ver más
BODY
amount
number
Valor do reembolso. Se a propriedade (amount) for removida do body, criará um reembolso integral.
Parâmetros de resposta
id
number
Identificador do reembolso
payment_id
number
Identificador de pagamento
amount
number
Valor do reembolso
metadata
array
Contém metadados de pagamento que nos são enviados no post de payment
Erros

400Erro

2063

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

2085

Invalid-value-for-gateway_operation-

401Erro

401

Invalid-token

4040

amount-attribute-must-be-positive

4041

amount-attribute-must-be-numeric

404Erro

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

Requisição
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-5599*********291-02171*********139a4791e*********f7f5835-1*********' \
    -d '{
  "amount": 5
}'
Resposta de exemplo
{
  "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": [
    {}
  ]
}