Busca inteligente powered by OpenAI
PUT
OBRIGATÓRIO
OBRIGATÓRIO
400Erro
2018
The action requested is not valid for the current payment state - Este erro ocorre quando se tenta alterar o status de um pagamento para cancelado quando o status inicial não é 'in_process', 'pending' ou 'authorized'.
2016
The action requested is not valid for the current payment state - Este erro ocorre quando, por exemplo, se tenta alterar o status de um pagamento de `in_process` para `approved`. Esta requisição só aceita o status `cancelled`. Revise o parâmetro enviado e submeta uma nova solicitação com o valor correto.
4017
Status attribute can't be null - Caso este erro apareça, revise o parâmetro `status` para garantir que ele esteja definido como `cancelled` e que não esteja vazio. Confirme que o status esteja corretamente preenchido antes de enviar uma nova solicitação.
401Erro
5
Must provide your access token - Este erro é exibido quando ocorre a tentativa de requisição sem o envio do Access Token. Verifique os parâmetros de requisição e garanta o envio da informação necessária.
Unauthorized
Invalid access token - Caso este erro apareça, revise o Access Token fornecido na sua requisição para garantir que ele esteja correto. Após verificar o token, envie uma nova solicitação.
403Erro
4
Forbidden - The caller is not authorized to access this resource. Este erro ocorre ao tentar alterar o status de um pagamento de `authorized` para `approved`. O mesmo problema surge ao tentar mudar o status de um pagamento de `in_process` para `rejected` ou `approved`, ou de `authorized` para `approved`. Neste caso, certifique-se de que o status definido seja estritamente `cancelled` e envie uma nova solicitação.
404Erro
2000
Payment not found - Este erro retorna quando o ID de pagamento inserido está incorreto ou não existe. Revise o parâmetro `payment_id` e garanta que o número inserido está correto.
curl -X PUT \
'https://api.mercadopago.com/v1/payments/{payment_id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TEST-4599*********755-11221*********d497ae962*********ecf8d85-1*********' \
-d '{
"status": "cancelled"
}'
curl -X PUT \
'https://api.mercadopago.com/v1/payments/{payment_id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TEST-4599*********755-11221*********d497ae962*********ecf8d85-1*********' \
-d '{
"status": "cancelled"
}'
curl -X PUT \
'https://api.mercadopago.com/v1/payments/{payment_id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TEST-4599*********755-11221*********d497ae962*********ecf8d85-1*********' \
-d '{
"status": "cancelled"
}'
curl -X PUT \
'https://api.mercadopago.com/v1/payments/{payment_id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TEST-4599*********755-11221*********d497ae962*********ecf8d85-1*********' \
-d '{
"status": "cancelled"
}'
curl -X PUT \
'https://api.mercadopago.com/v1/payments/{payment_id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TEST-4599*********755-11221*********d497ae962*********ecf8d85-1*********' \
-d '{
"status": "cancelled"
}'
curl -X PUT \
'https://api.mercadopago.com/v1/payments/{payment_id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TEST-4599*********755-11221*********d497ae962*********ecf8d85-1*********' \
-d '{
"status": "cancelled"
}'
curl -X PUT \
'https://api.mercadopago.com/v1/payments/{payment_id}'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TEST-4599*********755-11221*********d497ae962*********ecf8d85-1*********' \
-d '{
"status": "cancelled"
}'
{
"id": 18746874919,
"date_created": "2021-12-10T17:13:23.000-04:00",
"date_approved": null,
"date_last_updated": "2021-12-10T17:31:34.000-04:00",
"date_of_expiration": "2021-12-13T22:59:59.000-04:00",
"money_release_date": null,
"operation_type": "regular_payment",
"issuer_id": null,
"payment_method_id": "bolbradesco",
"payment_type_id": "ticket",
"status": "cancelled",
"status_detail": "by_collector",
"currency_id": "BRL",
"description": "Meu produto",
"live_mode": null,
"sponsor_id": null,
"authorization_code": null,
"money_release_schema": null,
"taxes_amount": 0,
"counter_currency": null,
"brand_id": null,
"shipping_amount": 0,
"pos_id": null,
"store_id": null,
"integrator_id": null,
"platform_id": null,
"corporation_id": null,
"collector_id": null,
"payers": [
{
"first_name": null,
"last_name": null,
"email": "test_user_80507629@testuser.com",
"type": "collector",
"identification": [
{
"number": "32659430",
"type": "DNI"
}
],
"phone": [
{
"area_code": null,
"number": null,
"extension": null
}
],
"entity_type": null,
"id": "1003743392",
"operator_id": null
}
],
"marketplace_owner": null,
"metadata": [
{}
],
"additional_info": [
{
"items": [
{
"id": "234",
"title": {
"en": "My product.",
"pt": "Meu produto.",
"es": "Mi producto."
},
"description": {
"en": "E-commerce store cellphone.",
"pt": "Celular da loja online.",
"es": "Celular de la tienda online."
},
"picture_url": "https://www.mercadopago.com/org-img/MP3/home/logomp3.gif",
"category_id": "art",
"quantity": "1",
"unit_price": "75.76"
}
]
}
],
"order": [
{
"type": "mercadopago",
"id": "3754501423"
}
],
"external_reference": "firstname@gmail.com",
"transaction_amount": 75.76,
"transaction_amount_refunded": 0,
"coupon_amount": 0,
"differential_pricing_id": null,
"deduction_schema": null,
"barcode": [
{
"content": "23791883300000075763380250600221946300633330"
}
],
"installments": 1,
"transaction_details": [
{
"payment_method_reference_id": "6002219463",
"verification_code": "6002219463",
"net_received_amount": 0,
"total_paid_amount": 75.76,
"overpaid_amount": 0,
"external_resource_url": "https://www.mercadopago.com/mlb/payments/beta/ticket/helper?payment_id=18746874919&payment_method_reference_id=6002219463&caller_id=1003743392&hash=6a8c570f-9c39-4a5c-9b55-85ae1b724bf",
"installment_amount": 0,
"financial_institution": null,
"payable_deferral_period": null,
"acquirer_reference": null
}
],
"fee_details": [
{}
],
"charges_details": [
{}
],
"captured": true,
"binary_mode": true,
"call_for_authorize_id": null,
"statement_descriptor": null,
"card": [
{}
],
"notification_url": "https://webhook.site/17a3a5ce-28d4-4b4f-ba3f-a7595c17c6d8",
"refunds": [
{}
],
"processing_mode": "aggregator",
"merchant_account_id": null,
"merchant_number": null,
"acquirer_reconciliation": [
{}
],
"point_of_interaction": [
{
"type": "Unspecified",
"business_info": [
{
"unit": "online_payments",
"sub_unit": "checkout_pro"
}
]
}
]
}