Captura payment - Payment flow - Mercado Pago Developers
What are you looking for?

Do not know how to start integrating? 

Check the first steps

Capture payment

The payment capture is a confirmation of the amount you want to charge from the buyer. At this point in the payment flow, the seller needs a certain payment to be withdrawn from the customer's wallet at the time of its creation.

See the diagram below that illustrates the payment capture process via the Wallet Connect API Payments endpoint.

Capture-payment-flow

Send request

When sending the request to the Payments endpoint, ensure that the following attributes are included as shown below.

ParameterDescription
X-Idempotency-KeyThis parameter must be inserted in the header of all requests. For more information, see the Idempotency section.
wallet_paymentIndicates that it is a payment from a previously linked Wallet Connect seller.
transaction_amountTotal amount to be charged to the buyer.
descriptionPayment description.
external_referencePayment reference assigned by seller
payerPayer information required to create a payment
tokenpayer_token obtained after completion of the agreement flow.
type_tokenType of payment, to use it in the Wallet Connect flow, the “wallet-token” value must be defined.
binary_modeThe value of this field is mandatory "true".

With these parameters in hands, send a POST to the endpoint /v1/advanced_payments and execute the request or, if you prefer, use the curl below .

          
curl -X POST \
    'https://api.mercadopago.com/v1/advanced_payments' \
    -H 'X-Idempotency-Key: IDEMPOTENCY_KEY' \
    -H 'Authorization: Bearer ACCESS_TOKEN' \
    -H 'accept: application/json' \
    -H 'content-type: application/json' \
    -d '{
           "wallet_payment":{
              "transaction_amount":700.50,
              "description":"Payment Description",
              "external_reference":"Pago_123"     
           },
           "payer":{
              "token":"PAYER_TOKEN",
              "type_token": "wallet-token"
            },
           "binary_mode": true
        }'



        

When running the request you may receive different types of responses originating from specific reasons. See the Responses section for more information.