# Capture order fully This endpoint allows to totally capture a previously authorized order. Every associated payment will be captured in total. In case of success, the request will return a response with status 200. **POST** `/v1/orders/{order_id}/capture` ## Request parameters ### 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 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) Order ID whose values ​​will be captured. This value is returned in the response to the 'Create order' ("/v1/orders") request. ## Response parameters - `id` (string, optional) Identifier of the order being processed in the request. - `status` (string, optional) Current status of the order. Possible enum values: - `processed` All transactions have been succesfully processed. - `processing` The order is being processed and does not require any action from the integrator. For example, the payment may be pending manual review. - `status_detail` (string, optional) Details about payment status. Possible enum values: - `accredited` Payment accredited. - `in_process` When the "status=processing", the payment is being processed. - `transactions` (object, optional) Contains information about the transactions associated with the order. - `transactions.payments` (array, optional) Contains information about the payment associated with the order. - `transactions.payments[].id` (string, optional) Identifier of the payment transaction created in the request, automatically generated by Mercado Pago. - `transactions.payments[].amount` (string, optional) Transaction amount. - `transactions.payments[].status` (string, optional) Payment status. Possible enum values: - `processed` All transactions have been succesfully processed. - `processing` The order is being processed and does not require any action from the integrator. For example, the payment may be pending manual review. - `transactions.payments[].status_detail` (string, optional) Details about payment status. Possible enum values: - `accredited` Payment accredited. - `in_process` When the "status=processing", the payment is being processed. - `transactions.payments[].reference_id` (string, optional) Reference ID of the transaction. ## 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_idempotency_key_length | The value sent in the "X-Idempotency-Key" header exceeded the allowed size. The header accepts values between 1 and 64 characters. | | 400 | 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. | | 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. | | 402 | 402 | Order was created but some transaction failed. Check the "errors" field for more information. | | 404 | order_not_found | Order not found. Please check if you provided the correct order 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 | cannot_capture_order | Error. Order cannot be captured. The status of the order does not allow its capture. Only orders with "status=action_required" and "status_detail=waiting_capture" can be captured. | | 409 | operation_not_supported | The operation is not supported for this order. Please check the order "status" and "status_detail" and try again. | | 500 | idempotency_validation_failed | Validation fail. Please try submitting the request again. | | 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}/capture' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' ``` ## Response example ```json { "id": "ORD01J49MMW3SSBK5PSV3DFR32959", "status": "processed", "status_detail": "accredited", "transactions": { "payments": [ { "id": "PAY01J49MMW3SSBK5PSV3DFR32959", "amount": "24.50", "status": "processed", "status_detail": "accredited", "reference_id": "01JEVQM899NWSQC4FYWWW7KTF9" } ] } } ```