AI resources
Cancel order

This endpoint cancels a Wallet Connect order that has not yet been captured. It is typically used when the merchant decides not to capture the payment for orders created with capture_mode=manual and that are in status=action_required and status_detail=waiting_capture. Cancelling releases the authorization on the payer's payment method without moving any funds. In case of success, the request will return a response with status 200.

POST

https://api.mercadopago.com/v1/orders/{order_id}/cancel
Request parameters
Header
Authorization
string

REQUIRED

Access Token obtained through the developer panel. Must be sent in all requests.
X-Idempotency-Key
string

REQUIRED

Unique key per request to safely retry without duplicating actions. Use a UUID V4 or random string. Accepts values between 1 and 64 characters.
Path
order_id
string

REQUIRED

ID of the order to cancel, returned in the response from the endpoint POST /v1/orders.
Response parameters
id
string
Identifier of the order, automatically generated by Mercado Pago when the order is created through the endpoint POST /v1/orders.
type
string
Order type.
online: Value associated with the creation of orders for Wallet Connect payments.
processing_mode
string
Indicates how the order will be processed. For Wallet Connect orders, the only allowed value is automatic.
automatic: The order is processed automatically in a single step.
external_reference
string
It is the external reference of the order, assigned when creating it. This field must have a maximum of 64 characters and can only be numbers, letters, hyphens (-) and underscores (_). Special characters such as ([ ], ()
Errors

400Request error.

empty_required_header

The X-Idempotency-Key header is required and was not sent. Make the request again including it.

invalid_idempotency_key_length

The X-Idempotency-Key must be between 1 and 64 characters.

invalid_path_param

The order_id provided in the path is not valid. Please confirm it and provide a valid order_id to try again.

401Error. Access Token not authorized.

unauthorized

The value sent as Access Token is incorrect. Please check and try again with the correct value.

invalid_credentials

There is no support for test credentials. Use test users with production credentials for the sandbox environment and your production credentials for the production environment.

404Resource not found.

order_not_found

Order not found. Please check if you provided the correct order_id.

409Some specific system rule does not allow the action.

cannot_cancel_order

The order cannot be canceled because it is not in a status that allows cancellation. Only orders in action_required status can be canceled.

order_already_canceled

The order has already been canceled.

idempotency_key_already_used

The value sent as the idempotency header (X-Idempotency-Key) has already been used. Please try the request again sending a new value.

500Generic error.

internal_error

Generic error. Please try submitting the request again.

Request
curl -X POST \
    'https://api.mercadopago.com/v1/orders/{order_id}/cancel'\
    -H 'Content-Type: application/json' \
       -H 'Authorization: Bearer APP_USR-8*********88776-122*********fc20dede6*********a497d7225*********64' \
       -H 'X-Idempotency-Key: 2e9e284e-6dfe-4d3c-bdf4-bf1d077f3d17' \
    
Response
{
  "id": "ORDBTA01KHY4WFPYXJ9Z7S5CGED7WCTP",
  "type": "online",
  "processing_mode": "automatic",
  "external_reference": "ext_ref_1234",
  "description": "Smartphone",
  "total_amount": "50.00",
  "total_paid_amount": "50.00",
  "country_code": "BR",
  "user_id": "1090806071",
  "status": "processed",
  "status_detail": "accredited",
  "capture_mode": "automatic",
  "currency": "BRL",
  "created_date": "2026-02-20T18:27:08.639Z",
  "last_updated_date": "2026-02-20T18:27:09.797Z",
  "integration_data": {
    "application_id": "6953384195632068",
    "platform_id": "123abc"
  },
  "transactions": {
    "payments": [
      {
        "id": "PAY01KSTHTYV2K2F86CPF6VF5SZ7R",
        "amount": "0.50",
        "reference_id": "e8eed39ee75a4371b64d98a074cf472f",
        "status": "canceled",
        "status_detail": "canceled_transaction",
        "attempts": [
          {
            "id": "b66b7198286e416fb554be03430e4c46",
            "status": "canceled",
            "status_detail": "canceled_transaction"
          }
        ],
        "payment_method": {
          "id": "wallet",
          "type": "wallet",
          "statement_descriptor": "Descriptor",
          "installments": 1
        },
        "stored_credential": {
          "payment_initiator": "merchant",
          "reason": "recurring"
        }
      }
    ]
  }
}