AI resources
Capture paymenthttps://api.mercadopago.com/v1/advanced_payments/{advanced_payment_id}
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
Request parameters
Header
Authorization
Access Token obtained through the developer panel. Must be sent in all requests.string
REQUIRED
Path
advanced_payment_id
Unique identifier of the advanced payment.number
REQUIRED
Body
capture
Send this field set to "true" to confirm and capture the payment. Omit it when canceling.boolean
wallet_payment
Payment data from a seller with a prior Wallet Connect agreement.object
REQUIRED
status
Send this field with the value "canceled" to cancel the payment. Omit it when capturing.string
Response parameters
id
Unique identifier of the advanced payment.number
payments
List of payments generated within the advanced payment.array
wallet_payment
Wallet payment data from a seller with a prior Wallet Connect agreement.object
disbursements
List of disbursements distributed among the sellers.array
Errors
400Request error.
400
Bad Request.
404
Not Found.
500Processing error.
internal_error
Some error occurred on our side while attempting to process the request. Please try again later.
Request
curl -X PUT \
'https://api.mercadopago.com/v1/advanced_payments/{advanced_payment_id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer APP_USR-4*********994754-12*********c73b4e1ac*********cef36b27c*********840' \
-d '{
"capture": false,
"wallet_payment": {
"transaction_amount": 24.5,
"description": "Payment for the purchase of furniture",
"external_reference": "Payment_seller_123"
},
"status": "canceled"
}'Response
{
"id": 10234567,
"payments": [
{
"id": 3870106238,
"status_detail": "accredited",
"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"
}