# Refund order This endpoint performs a full or partial refund of a processed 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. Multiple partial refunds can be issued against the same order as long as the cumulative refunded amount does not exceed the total paid amount. In case of success, the request will return a response with status 200. **POST** `/v1/orders/{order_id}/refund` ## Request parameters ### Header - `Authorization` (string, required) Access token to authenticate the request. For more information, see the [Authentication](https://www.mercadopago.com/developers/en/docs/your-integrations/credentials) documentation. - `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 each request is unique, it is important to use a unique value in your request header. We suggest using a V4 UUID or random strings. ### Path - `order_id` (string, required) ID of the order that is being refunded. This value is returned in the response to the 'Create order' ("/v1/orders") request. - `transactions` (array, optional) Contains information about the transactions associated with the order. It can contain only one transaction. Required for partial refund. For a full refund, send an empty body. Mutually exclusive with "splits". - `transactions[].id` (string, optional) Identifier of the payment transaction to refund, returned in `transactions.payments[].id` from the Get order by ID response. - `transactions[].amount` (string, optional) Transaction amount. If only one payment method is used, it must be equivalent to the amount entered in the "total_amount" field. If two are used, it is the sum between the two "amount" that must be equivalent to the "total_amount" value. The field can contain two decimal places or none. - `splits` (array, optional) Split participants to refund. Mutually exclusive with "transactions". - `splits[].user_id` (integer, optional) User ID of the split participant to refund. - `splits[].amount` (string, optional) Amount to refund. If not specified, refunds the full split amount. The field can contain two decimal places or none. ## Response parameters - `id` (string, optional) Identifier of the order being processed in the request. - `status` (string, optional) Current status of the order. - `status_detail` (string, optional) Details about the order status. - `transactions` (object, optional) Contains information about the refund transactions. - `transactions.refunds` (array, optional) List of refund transactions. - `transactions.refunds[].id` (string, optional) Identifier of the refund transaction, automatically generated. - `transactions.refunds[].transaction_id` (string, optional) Identifier of the original payment transaction being refunded. - `transactions.refunds[].reference_id` (string, optional) External reference identifier. - `transactions.refunds[].amount` (string, optional) Refunded amount. - `transactions.refunds[].status` (string, optional) Status of the refund transaction. ## Errors | Status | Error | Description | | ------- | ------- | ----------- | | 400 | refund_amount_exceeds | An incorrect value for some property was sent. The amount provided exceeds what is available for refund. Check the message returned in the error details to find out what the problem was and try again. | | 400 | order_refund_already_in_process | A full refund is already being processed for this order. Check the message returned in the error details to find out what the problem was and try again. | | 401 | 401 | The value sent as Access Token is incorrect. Please check and try again with the correct value. | | 401 | invalid_credentials | There is no support for test credentials. Use test users with production credentials for the sandbox environment and your production credentials for the production environment. | | 404 | transaction_not_found | The transaction ID provided does not exist in this order. Use the id from `transactions.payments[].id`. | | 409 | idempotency_key_already_used | The value sent as the idempotency header ("X-Idempotency-Key") has already been used. Please try the request again sending a new value. | | 409 | order_already_refunded | Order already refunded. | | 409 | cannot_refund_order | Cannot refund order. Please check if the order is already refunded. | | 409 | order_refund_already_in_process | There is already a full refund request in process for the order in question. | | 500 | internal_error | 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 '{ "transactions": [ { "id": "PAY01HRYFWNYRE1MR1E60MW3X0T2P", "amount": "100.00" } ], "splits": [ { "user_id": 1, "amount": "50.00" } ] }' ``` ## Response example ```json { "id": "ORD01J49MMW3SSBK5PSV3DFR32959", "status": "string", "status_detail": "string", "transactions": { "refunds": [ { "id": "string", "transaction_id": "string", "reference_id": "string", "amount": "100.00", "status": "string" } ] } } ```