AI resources

How to migrate from the Payment Intent API to the Orders API

The Orders API unifies in-person payment processing for Mercado Pago Point, providing standardized endpoints, a more complete status model, and new native capabilities that did not exist in the Payment Intent API. In addition, all new Mercado Pago features will be developed on the Orders API.

Migrating your Mercado Pago Point integration from the Payment Intent API to the Orders API involves updating endpoints and request fields, adapting the status model, and leveraging new native resources, such as the dedicated refund endpoint. The migration does not change the business flow: the terminal continues receiving orders created by the backend and processing payments autonomously.

Read on to learn how to complete this migration.

Map the endpoint changes

Before starting the migration steps, see the table below for an overview of all endpoint changes. In the Payment Intent API, each operation had its own URL structure with the device identifier in the path. The Orders API consolidates these operations into standardized endpoints and removes the {deviceid} from the path in all operations.

Adapt the headers

The Orders API introduces two mandatory header changes that affect all endpoints: the sandbox mechanism was removed and a new idempotency control was introduced. Apply the following changes before testing any other resource.

Update terminal listing and configuration

The terminal endpoints changed URL: listing moves from GET /point/integration-api/devices to GET /terminals/v1/list and mode update moves from PATCH /point/integration-api/devices/{device_id} to PATCH /terminals/v1/setup. In the mode update, the terminal identifier also moves from the path to the body, allowing multiple terminals to be updated in a single call.

Migrate payment intent creation to order creation

The creation endpoint changes from POST /point/integration-api/devices/{deviceid}/payment-intents to POST /v1/orders. Beyond the URL change, the request structure was significantly reorganized: the terminal identifier moves from the path to the body, new required fields were introduced, and the Orders API has a distinct structure. Follow the steps below to adapt the request, response, and error handling.

curl

curl -X POST \
  'https://api.mercadopago.com/v1/orders' \
  -H 'Content-Type: application/json' \
  -H 'X-Idempotency-Key: {{IDEMPOTENCY_KEY}}' \
  -H 'Authorization: Bearer {{ACCESS_TOKEN}}' \
  -d '{
    "type": "point",
    "external_reference": "ext_ref_1234",
    "transactions": {
      "payments": [
        {
          "amount": "24.00"
        }
      ]
    },
    "config": {
      "point": {
        "terminal_id": "{{TERMINAL_ID}}",
        "print_on_terminal": "no_ticket"
      }
    },
    "description": "Point Smart 2"
  }'

Update the query mechanism from Payment Intent to Orders

The query endpoint changes from GET /point/integration-api/payment-intents/{paymentintentid}API to GET /v1/orders/{orderid}API. The order identifier in the path also changes from UUID to alphanumeric format. The response includes new fields with information about the payment result, refunds, and card data.

curl

curl -X GET \
  'https://api.mercadopago.com/v1/orders/{{ORDER_ID}}' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {{ACCESS_TOKEN}}'

Update status handling

One of the most significant changes between the Payment Intent API and the Orders API is the state field, which is renamed to status in the new API and receives new values. In the Payment Intent API, the FINISHED status required additional calls to determine the actual payment result. In the Orders API, the processed and failed statuses are self-contained and eliminate that need. Update all status checks in your integration according to the table below.

Update order cancellation

The new endpoint to cancel an order is POST /v1/orders/{orderid}/cancel, replacing the DELETE from the Payment Intent API. The {deviceid} is removed from the path and the cancellation is now identified solely by the {orderid}.

In the Payment Intent API, it was only possible to cancel payment intents that had not yet reached the terminal. In the Orders API, it is possible to cancel an order even after it has reached the terminal, using a new specific header.

curl

curl -X POST \
  'https://api.mercadopago.com/v1/orders/{{ORDER_ID}}/cancel' \
  -H 'Content-Type: application/json' \
  -H 'X-Idempotency-Key: {{IDEMPOTENCY_KEY}}' \
  -H 'Authorization: Bearer {{ACCESS_TOKEN}}'

Implement refunds with the dedicated endpoint

The Orders API introduces the dedicated endpoint POST /v1/orders/{orderid}/refund for refunds, which did not exist in the Payment Intent API. Previously, it was necessary to receive the payment webhook, obtain the payment_id, and execute the refund through the Payments API separately. Now, the refund is performed directly on the order.

Validate the migration

After applying the changes, verify that the integration works correctly across all flows before going to production.

The x-test-scope header was removed from all integration requests.

The X-Idempotency-Key header must be present in all creation, cancellation, and refund operations.

Terminals listed with the GET /terminals/v1/listAPI endpoint and operating mode updated with PATCH /terminals/v1/setupAPI.

Orders successfully created with the new payload at the POST /v1/ordersAPI endpoint and received by the terminal.

Orders successfully retrieved via the GET /v1/orders/{orderid}API endpoint.

Order statuses monitored via webhook with the new values: created, at_terminal, processed, failed, canceled, and refunded.

Orders successfully canceled via the POST /v1/orders/{orderid}/cancelAPI endpoint.

Refunds processed via the dedicated POST /v1/orders/{orderid}/refundAPI endpoint.

See the documentation to learn how to test the integration.