This endpoint allows to create a refund for all the transactions associated with an order for Mercado Pago QR Code. That is, the refund will be issued on the order, so all transactions, whether payments, cashouts, or both, will be returned. Additionally, only orders with "status=processed" can be refunded. In case of success, the request will return a response with status 201.
POST
REQUIRED
REQUIRED
REQUIRED
400Error.
empty_required_header
The "X-Idempotency-Key" header is required and was not sent. Make the requisition again including it.
invalid_order_owner
The value sent as the Access Token is not the same as the one used to create the order. Check the value sent to adjust it and try again.
in_store_payment_refund_order
The time limit for issuing a refund for the order has been exceeded. Please verify that you are within the 330 days period from the order creation date.
partial_refund_not_allowed_with_cashout
Partial refunds are not allowed for orders with cashouts.
401Error.
unauthorized
The value sent as Access Token is incorrect. Please check and try again with the correct value.
404Error.
order_not_found
The value sent as Order ID does not correspond to a created order, therefore it could not be found. Please check and try again with the correct value.
409Error.
idempotency_key_already_used
The value sent as the idempotency header has already been used with a different request within the last 24 hours. Please try the request again sending a new value.
invalid_order_status
There was an attempt to refund an order with a status that does not allow it. Please verify that the status is "processed", otherwise the refund cannot be processed.
order_already_refunded
You are trying to return an order that has been already refunded. Verify if you have submitted the correct ID.
500Error.
500
Generic error. Please try submitting the request again.
curl -X POST \
'https://api.mercadopago.com/v1/orders/{order_id}/refund'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer APP_USR-8*********932064-12*********edf6d3c99*********2236c703f*********668' \
-H 'X-Idempotency-Key: 22a7ffd1-a22a-4639-bbed-2266db63891a' \
{
"id": "ORD0000ABCD222233334444555566",
"status": "processed",
"status_detail": "accredited",
"transactions": {
"refunds": [
{
"id": "REF01J67CQQH5904WDBVZEM1234D",
"transaction_id": "PAY01J67CQQH5904WDBVZEM4JMEP3",
"amount": "25",
"status": "processing",
"reference_id": "12345678"
}
]
}
}