Home
Documentation
Resources
Partners
Community

Resources

Check for updates on our solutions and system performance, or request technical support.

Partners

Discover our program for agencies or developers that offer integration services and sellers who want to hire them.

Community

Get the latest news, ask others for help and share your knowledge.

Refund order - Online payments - Mercado Pago Developers

Intelligent search powered by OpenAI 

Refund order

POST

https://api.mercadopago.com/v1/orders/{order_id}/refund
This endpoint performs a full or partial refund of the transactions associated with an order. To perform a full refund, you must not send the amount to be refunded in the request body. To perform a partial refund you must indicate the amount to be refunded, along with the transaction ID you wish to return. In case of success, the request will return a response with status 201.
Request's parameters
PATH
order_id
string

REQUIRED

ID of the order that is being refunded. This value is returned in the response to the Create order request.
HEADER
X-Idempotency-Key
string

REQUIRED

This function allows you to repeat requests safely, without the risk of carrying out the same action more than once by mistake. This is useful to avoid mistakes such as creating two identical payments. To ensure that eac...View more
BODY
transactions
array

REQUIRED

Contains information about the transactions associated with the order. It can contain up to 2 transactions. For example, if you want to create an order with two cards, you can add another item to the array "payments" nod...View more
Response parameters
id
string
Identifier of the order being processed in the request.
status
string
Current status of the order.
processed: All transactions have been succesfully processed.
refunded: The order has been refunded.
status_detail
string
Details about payment status.
refunded: The order has been refunded.
partially_refunded: The order has been partially refunded.
transactions
object
Contains information about the transactions associated with the order.
Errors

400Request error.

empty_required_header

The 'X-Idempotency-Key' header is required and was not sent. Make the requisition again including it.

invalid_path_param

The order_id provided in the request path is not correct. Please confirm it and provide a valid ID to try again.

refund_amount_exceeds

The requested refund amount is greater than the available amount.

404Not found.

Error. Order not found.

Error. Transaction not found.

409Some specific system rule does not allow the action to be performed due to defined restrictions.

Some specific system rule does not allow the action to be performed due to defined restrictions.

Error. Order already refunded.

The order cannot be refunded. Please check the order status and try again.

500Generic error.

idempotency_validation_failed

Validation fail. Please try submitting the request again.

internal_error

Generic error. Please try submitting the request again.

Request
curl -X POST \
    'https://api.mercadopago.com/v1/orders/{order_id}/refund'\
    -H 'Content-Type: application/json' \
       -H 'X-Idempotency-Key: 0d5020ed-1af6-469c-ae06-c3bec19954bb' \
       -H 'Authorization: Bearer TEST-8971*********918-01191*********5874530a4*********4799fdf-1*********' \
    -d '{
  "transactions": [
    {
      "id": "PAY01J67CQQH5904WDBVZEM4JMEP3",
      "amount": "24.90"
    }
  ]
}'
Sample answer
{
  "id": "ORD01J49MMW3SSBK5PSV3DFR32959",
  "status": "processed",
  "status_detail": "refunded",
  "transactions": {
    "refunds": [
      {
        "id": "REF01J49MMW3SSBK5PSV3DFR32959",
        "transaction_id": "PAY01JEVQM06WDW16MAQ8B5SC0MSC",
        "reference_id": "01JEVQM899NWSQC4FYWWW7KTF9",
        "amount": "24.90",
        "status": "processed"
      }
    ]
  }
}