# Refund order This endpoint allows you to create a total or partial refund for transactions associated with an order for Mercado Pago QR Code. For a total refund, do not send a body in the request. For a partial refund, send the transactions array with the transaction identifier and the amount to be refunded. Partial refunds are available for MLA, MLU, and MLC only. Only orders with "status=processed" can be refunded. In case of success, the request will return a response with status 201. **POST** `/v1/orders/{order_id}/refund` ## Request parameters ### Header - `X-Idempotency-Key` (string, required) This feature allows you to safely retry requests without the risk of accidentally performing the same action more than once. To ensure that each request is unique, you must use an exclusive value in the header of each unique value for each call. If you use a value already assigned to another request, you will receive information corresponding to that created resource in response, not this new request. We suggest using a UUID V4 or random strings. ### Path - `order_id` (string, required) ID of the order that contains the associated payment transaction to be refunded. This value is returned in the response to the 'Create order' ("/v1/orders") request. ## Response parameters - `id` (string, optional) Identifier of the order to be refunded, received in the response to its creation. - `status` (string, optional) Current status of the order. Possible enum values: - `processed` The order continues with a payment in "status=processed", which is what allows the refund to be issued. To check the status of the refund, run the 'Get order by ID' ("/v1/orders/{id}") request and confirm it in the "transactions.refunds.status" field, and enable your Webhooks notifications. - `status_detail` (string, optional) The order continues with a payment in "status=accredited", which is what allows the refund to be issued. To check the status of the refund, run the 'Get order by ID' ("/v1/orders/{id}") request and confirm it in the "transactions.refunds.status_detail" field, and enable your Webhooks notifications. - `transactions` (object, optional) Contains information about the transaction associated with the order. - `transactions.refunds` (array, optional) Contains information about the refund associated with the order. - `transactions.refunds[].id` (string, optional) Identifier of the refund transaction, automatically generated by Mercado Pago. - `transactions.refunds[].transaction_id` (string, optional) Identifier of the "payments" or "cash_outs" that will be refunded, assigned to the transaction at the time of order creation. - `transactions.refunds[].amount` (string, optional) Amount returned in the refund. If the payment was discounted, that amount will be reflected. - `transactions.refunds[].status` (string, optional) Current status of the refund. Possible enum values: - `processing` The refund was successfully requested and is being processed. Enable your Webhooks notifications to receive an alert if the refund was successful, or to find out if there was an error. - `transactions.refunds[].reference_id` (string, optional) ID that associates the transaction and its refund. ## Errors | Status | Error | Description | | ------- | ------- | ----------- | | 400 | empty_required_header | The "X-Idempotency-Key" header is required and was not sent. Make the requisition again including it. | | 400 | 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. | | 400 | 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 180 days period from the order creation date. | | 400 | partial_refund_not_allowed_with_cashout | Partial refunds are not allowed for orders with cashouts. | | 401 | unauthorized | The value sent as Access Token is incorrect. Please check and try again with the correct value. | | 404 | 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. | | 409 | 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. | | 409 | 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. | | 409 | order_already_refunded | You are trying to return an order that has been already refunded. Verify if you have submitted the correct ID. | | 409 | movement_operations_pending | The order has pending movements, please wait a few minutes. | | 500 | 500 | Generic error. Please try submitting the request again. | ## Request example ### cURL ```bash curl -X POST \ 'https://api.mercadopago.com/v1/orders/{order_id}/refund' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{}' ``` ## Response example ```json { "id": "ORD0000ABCD222233334444555566", "status": "processed", "status_detail": "accredited", "transactions": { "refunds": [ { "id": "REF01J67CQQH5904WDBVZEM1234D", "transaction_id": "PAY01J67CQQH5904WDBVZEM4JMEP3", "amount": "24.50", "status": "processing", "reference_id": "12345678" } ] } } ```