Implement payments in your AI agent’s checkout

Mercado Pago Commerce Agents Checkout is an open-source Python library, available in beta, that implements a secure checkout_handoff in your integration. It lets you trigger Checkout Pro directly in the agent flow without giving the model control over prices, credentials, or payment creation.

If you are already exploring shopping agents with Anthropic's open-source commerce-agents stack, the library adds Mercado Pago checkout to the existing flow. It can also integrate with other Python-based agent backends through adapters for the cart, catalog, and checkout-attempt persistence.

How does Commerce Agents Checkout work?

The library uses the official Mercado Pago SDK and the Orders API to prepare checkout in your integration backend. Before creating an order, it queries your application's trusted catalog and validates the data required for payment.

  1. Validates the cart against your catalog: before creating an order, it verifies items, prices, availability, and currency against your application's trusted information.
  2. Creates an order for Checkout Pro: after validation, it creates the order that prepares payment in Mercado Pago's hosted checkout.
  3. Returns a validated payment URL: it sends the host the Checkout Pro URL only after confirming that it belongs to Mercado Pago's allowed domains.
  4. Keeps credentials and values in the backend: the Access Token, prices, and payment URL never enter the model context.

Triggering checkout_handoff does not confirm payment. You remain responsible for persisting idempotency_key and external_reference, handling indeterminate states, processing webhooks, and reconciling Orders before releasing the purchase.

Start exploring the beta release

Beta version 0.1.0 is available on PyPI and requires Python 3.11 or later, as well as the mercadopago SDK 3.5.0 or later.

If you prefer a manual integration, install the package:

bash

pip install mercadopago-commerce-agents-checkout==0.1.0

Visit the official Commerce Agents Checkout repository to learn about its requirements, review implementation examples, and send feedback.

Integrate checkout with help from Claude Code

The mercadopago-commerce plugin analyzes your project and guides you through adding Commerce Agents Checkout in the right place. It does not depend on a specific framework, repository structure, or commercial vertical.

The analysis starts in read-only mode and presents a plan before modifying your project.

  1. Discovers the integration's actual boundaries: identifies the cart, trusted catalog, checkout entry point, and the channel used to deliver the URL outside the model context.
  2. Detects how your project manages dependencies: recognizes configurations based on uv, Poetry, Pipenv, pyproject.toml, or requirements.txt.
  3. Uses a validated library version: adds the exact compatible version and generates a small adapter over the existing architecture.
  4. Detects pending requirements: if it cannot find durable persistence, webhooks, reconciliation, or a secure boundary for delivering the URL, it reports them as blockers instead of inventing an implementation.

Automated integration is available for agent backends developed in Python 3.11 or later. If your project uses another technology, the plugin does not modify the code: it presents the official Orders API contract and the security considerations required for a manual integration.

To install the public plugin with Claude Code:

bash

claude plugin marketplace add \
  https://github.com/mercadopago/mercadopago-claude-marketplace.git \
  --scope project

claude plugin install \
  mercadopago-commerce@mercadopago-claude-marketplace \
  --scope project

From the root of the project you want to analyze, run:

text

/mercadopago-commerce:mp-commerce analyze

The plugin will show the diagnosis and integration plan. It will not make changes until you explicitly confirm the proposed plan.

You can also explore the mercadopago-commerce plugin for Claude Code and Anthropic's open-source commerce-agents project.