This endpoint captures or cancels a payment ("advanced_payment"). To capture, send the payment data with the "capture=true" field. To cancel, send the payment data with the "status=canceled" field. In case of success, the request will return a response with status 200.
PUT
REQUIRED
REQUIRED
REQUIRED
400Request error.
invalid_path_param
The "advanced_payment_id" provided in the path is not valid. Please confirm it and provide a valid id to try again.
404Resource not found.
payment_not_found
Payment not found. Please check if you provided the correct "advanced_payment_id".
500Generic error.
internal_error
An internal server error occurred. Please try again later. If the problem persists, contact support and provide the x-request-id and details about the operation performed.
curl -X PUT \
'https://api.mercadopago.com/v1/advanced_payments/{advanced_payment_id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer APP_USR-8*********88776-122*********fc20dede6*********a497d7225*********64' \
-d '{
"capture": false,
"wallet_payment": {
"transaction_amount": 24.5,
"description": "Payment for the purchase of furniture",
"external_reference": "Payment_seller_123"
},
"status": "canceled"
}'{
"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": "987654"
}
],
"payer": {
"id": 8879
},
"site_id": "MLB",
"binary_mode": true,
"date_created": "2018-10-20T09:34:20.518-04:00",
"date_last_updated": "2018-10-20T09:34:20.518-04:00"
}