# Capture payment This endpoint captures or cancels an advanced payment. To capture, send the wallet payment data with the "capture" field set to "true". To cancel, send the wallet payment data with the "status" field set to "canceled". In case of success, the request will return a response with status 200. **PUT** `/v1/advanced_payments/{advanced_payment_id}` ## Request parameters ### Path - `advanced_payment_id` (number, required) Unique identifier of the advanced payment. - `capture` (boolean, optional) Send this field set to "true" to confirm and capture the payment. Omit it when canceling. - `wallet_payment` (object, optional) Payment data from a seller with a prior Wallet Connect agreement. - `wallet_payment.transaction_amount` (number, optional) Payment amount. - `wallet_payment.description` (string, optional) Brief description of the payment. - `wallet_payment.external_reference` (string, optional) Custom seller reference used to correlate a Mercado Pago payment with an internal order. - `status` (string, optional) Send this field with the value "canceled" to cancel the payment. Omit it when capturing. ## Response parameters - `id` (number, optional) Unique identifier of the advanced payment. - `payments` (array, optional) List of payments generated within the advanced payment. - `payments[].id` (number, optional) Unique payment identifier. - `payments[].status` (string, optional) Current status of the payment. Possible enum values: - `approved` The payment was approved. - `in_process` The payment is being processed. - `rejected` The payment was rejected. - `payments[].status_detail` (string, optional) Detailed reason for the payment status. - `payments[].payment_type_id` (string, optional) Payer's preferred payment type. Possible enum values: - `credit_card` Credit card. - `debit_card` Debit card. - `account_money` Account balance. - `payments[].payment_method_id` (string, optional) Payment method used. - `payments[].transaction_amount` (number, optional) Payment amount. - `payments[].installments` (number, optional) Number of installments. - `payments[].description` (string, optional) Description of the product or service purchased. - `payments[].capture` (boolean, optional) Indicates whether the payment amount was captured. In two-step payments, the purchase value is first reserved ("capture" = "false") and then captured ("capture" = "true") when the funds are transferred to the collector. - `payments[].external_reference` (string, optional) Custom seller reference used to correlate a Mercado Pago payment with an internal order. - `wallet_payment` (object, optional) Wallet payment data from a seller with a prior Wallet Connect agreement. - `wallet_payment.transaction_amount` (number, optional) Payment amount. - `wallet_payment.description` (string, optional) Brief description of the payment. - `wallet_payment.external_reference` (string, optional) Custom seller reference used to correlate a Mercado Pago payment with an internal order. - `wallet_payment.discount` (object, optional) Discount applied to the payment, when applicable. - `wallet_payment.discount.amount` (number, optional) Amount deducted from the total payment. - `wallet_payment.discount.code` (number, optional) Unique identifier of the coupon used for the discount. - `disbursements` (array, optional) List of disbursements distributed among the sellers. - `disbursements[].collector_id` (string, optional) Mercado Pago account ID of the seller receiving the disbursement. - `payer` (object, optional) - `payer.id` (number, optional) Buyer's Mercado Pago user ID. - `site_id` (string, optional) Country of origin of the Mercado Pago account. - `binary_mode` (boolean, optional) When enabled, the payment can only be approved or rejected. Otherwise, the payment may remain pending. - `date_created` (string, optional) Date and time the payment was created, in ISO 8601 format. - `date_last_updated` (string, optional) Date and time of the last update to the payment, in ISO 8601 format. ## Errors | Status | Error | Description | | ------- | ------- | ----------- | | 400 | 400 | Bad Request. | | 400 | 404 | Not Found. | | 500 | internal_error | Some error occurred on our side while attempting to process the request. Please try again later. | ## Request example ### cURL ```bash curl -X PUT \ 'https://api.mercadopago.com/v1/advanced_payments/{advanced_payment_id}' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "capture": true, "wallet_payment": { "transaction_amount": "24.50", "description": "Payment for the purchase of furniture", "external_reference": "Payment_seller_123" }, "status": "canceled" }' ``` ## Response example ```json { "id": 10234567, "payments": [ { "id": 3870106238, "status": "approved", "status_detail": "accredited", "payment_type_id": "credit_card", "payment_method_id": "credit_card", "transaction_amount": "24.50", "installments": 1, "description": "Payment for the purchase of furniture", "capture": true, "external_reference": "payment_123" } ], "wallet_payment": { "transaction_amount": "24.50", "description": "Payment for the purchase of furniture", "external_reference": "Payment_seller_123", "discount": { "amount": 10, "code": "WALLET10" } }, "disbursements": [ { "collector_id": "collectorId" } ], "payer": { "id": 8879 }, "site_id": "MLM", "binary_mode": true, "date_created": "2018-10-20T09:34:20.518-04:00", "date_last_updated": "2018-10-20T09:34:20.518-04:00" } ```