Atualizar pagamentohttps://api.mercadopago.com/v1/payments/{id}
Altera os dados de um pagamento quando necessário. Indique a identificação do pagamento e envie os parâmetros com as informações que você deseja atualizar.
PUT
Request parameters
Header
Authorization
Access Token obtido através do painel de desenvolvedores. Obrigatório ser enviado em todas as requisições.string
OBRIGATÓRIO
Path
id
Identificador único de pagamento, gerado automaticamente pelo Mercado Pago.number
OBRIGATÓRIO
Body
date_of_expiration
Data de expiração do pagamento. O formato válido do atributo é o seguinte - "yyyy-MM-dd'T'HH:mm:ssz". Por exemplo - 2022-11-17T09:37:52.000-04:00.string
status
É o estado atual do pagamento. Podem ser ser dos seguintes tiposstring
pending: The user has not concluded the payment process (for example, to generate a payment by boleto, this payment will be concluded at the moment in which the user makes the non-corresponding payment selected);
approved: The payment was approved and credited;
authorized: The payment was authorized, but still was not captured;
Ver maistransaction_amount
Custo do produto. Pode conter duas casas decimais ou nenhuma.number
Response parameters
id
Identificador único de pagamento, gerado automaticamente pelo Mercado Pago.number
date_created
Data de criação do pagamento.string
date_approved
Data de aprovação do pagamento. Um pagamento pode ser gerado em um estado intermediário e depois aprovado, portanto, a data de criação nem sempre coincidirá com a Data de Aprovação.string
date_last_updated
Data em que o último evento de pagamento foi registrado.string
Erros
400Erro
8
The name of the parameters is wrong
1004
Invalid parameters for payment_method API
2018
The action requested is not valid for the current payment state.
2078
Capture attribute must be boolean.
2079
Invalid value for capture attribute.
403Erro
4
The caller is not authorized to access this resource.
3002
The caller is not authorized to perform this action.
404Erro
2000
Payment not found.
Informe dados válidos nos request parameters antes de executar.
Request
curl -X PUT \
'https://api.mercadopago.com/v1/payments/{id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer APP_USR-5*********956537-12*********ff1a3d36d*********47e7b9985*********770' \
-d '{
"status": "canceled",
"transaction_amount": 24.5
}'curl -X PUT \
'https://api.mercadopago.com/v1/payments/{id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer APP_USR-5*********956537-12*********ff1a3d36d*********47e7b9985*********770' \
-d '{
"status": "canceled",
"transaction_amount": 24.5
}'curl -X PUT \
'https://api.mercadopago.com/v1/payments/{id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer APP_USR-5*********956537-12*********ff1a3d36d*********47e7b9985*********770' \
-d '{
"status": "canceled",
"transaction_amount": 24.5
}'curl -X PUT \
'https://api.mercadopago.com/v1/payments/{id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer APP_USR-5*********956537-12*********ff1a3d36d*********47e7b9985*********770' \
-d '{
"status": "canceled",
"transaction_amount": 24.5
}'curl -X PUT \
'https://api.mercadopago.com/v1/payments/{id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer APP_USR-5*********956537-12*********ff1a3d36d*********47e7b9985*********770' \
-d '{
"status": "canceled",
"transaction_amount": 24.5
}'curl -X PUT \
'https://api.mercadopago.com/v1/payments/{id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer APP_USR-5*********956537-12*********ff1a3d36d*********47e7b9985*********770' \
-d '{
"status": "canceled",
"transaction_amount": 24.5
}'curl -X PUT \
'https://api.mercadopago.com/v1/payments/{id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer APP_USR-5*********956537-12*********ff1a3d36d*********47e7b9985*********770' \
-d '{
"status": "canceled",
"transaction_amount": 24.5
}'Response
{
"id": 20359978,
"date_created": "2019-07-10T14:47:58.000Z",
"date_approved": "2019-07-10T14:47:58.000Z",
"date_last_updated": "2019-07-10T14:47:58.000Z",
"money_release_date": "2019-07-24T14:47:58.000Z",
"issuer_id": 25,
"payment_method_id": "visa",
"payment_type_id": "credit_card",
"status": "approved",
"status_detail": "accredited",
"currency_id": "UYU",
"description": "Pago Pizza",
"taxes_amount": 0,
"shipping_amount": 0,
"collector_id": 448876418,
"payer": {
"id": 123,
"email": "test_user_uy@testuser.com",
"identification": {
"number": "12345678",
"type": "CI"
},
"type": "customer"
},
"metadata": {},
"additional_info": {
"items": [
{
"id": "PR0001",
"title": "Point Mini",
"description": "Producto Point para cobros con tarjetas mediante bluetooth",
"picture_url": "https://http2.mlstatic.com/resources/frontend/statics/growth-sellers-landings/device-mlb-point-i_medium2x.png",
"category_id": "electronics",
"quantity": 1,
"unit_price": "24.50"
}
],
"payer": {
"registration_date": "2019-01-01T15:01:01.000Z"
},
"shipments": {
"receiver_address": {
"street_name": "Av das Nacoes Unidas",
"street_number": "1294",
"zip_code": "11300",
"city_name": "Montevideo",
"state_name": "Montevideo"
}
}
},
"external_reference": "MP0001",
"transaction_amount": "24.50",
"transaction_amount_refunded": 0,
"coupon_amount": 0,
"transaction_details": {
"net_received_amount": 56,
"total_paid_amount": "50.00",
"overpaid_amount": 0,
"installment_amount": 58
},
"fee_details": [
{
"type": "coupon_fee",
"amount": 2,
"fee_payer": "payer"
}
],
"statement_descriptor": "MercadoPago",
"installments": 1,
"card": {
"id": null,
"first_six_digits": null,
"last_four_digits": null,
"expiration_month": null,
"expiration_year": null,
"date_created": "2019-07-10T14:47:58.000Z",
"date_last_updated": "2019-07-10T14:47:58.000Z",
"cardholder": {
"name": null,
"identification": {
"number": "12345678",
"type": "CI"
}
}
},
"notification_url": "https://www.suaurl.com/notificacoes/",
"processing_mode": "aggregator",
"point_of_interaction": {
"type": "visa",
"application_data": {
"name": "NAME_SDK",
"version": "VERSION_NUMBER"
}
}
}