Skip to main content

langchain-mercadopago

LangChain tools for Mercado Pago payments. Wraps 5 core Mercado Pago API operations as LangChain StructuredTool instances, ready to use with any LangChain or LangGraph agent.

Installation

pip install langchain-mercadopago

Usage

from langchain_mercadopago import create_mercadopago_tools
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_openai import ChatOpenAI

# Create the 5 Mercado Pago tools
tools = create_mercadopago_tools("YOUR_MERCADO_PAGO_ACCESS_TOKEN")

# Use with any LangChain agent
llm = ChatOpenAI(model="gpt-4o")
agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools)

result = executor.invoke({"input": "Create a payment link for 2 shirts at $50 ARS each"})

Available Tools

Tool Description
create_payment_preference Creates a Mercado Pago checkout payment preference (payment link). Returns init_point URL for redirecting buyers.
get_payment Retrieve a payment by its ID. Returns full payment details including status, amount, payer info.
create_refund Refund a payment fully or partially. Omit amount for full refund.
search_payments Search recent payments for the authenticated merchant. Supports filtering by status.
get_merchant_info Retrieve the authenticated merchant's user profile including ID, nickname, and site.

Security

  • payment_id parameters are validated to be strictly numeric before URL interpolation to prevent path traversal attacks.
  • All API calls use Bearer token authentication via the Authorization header.

Development

pip install -e ".[dev]"
pytest

Metadata

Release files for langchain-mercadopago 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-mercadopago 0.1.0
File Size Uploaded Provenance
langchain_mercadopago-0.1.0.tar.gz 5.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-mercadopago 0.1.0
File Interpreter ABI Platform
langchain_mercadopago-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 kB

Release files / langchain_mercadopago-0.1.0.tar.gz

Download URL langchain_mercadopago-0.1.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0e0e26a5d2f7b3d6397548e3d6693e943070513fe606c8a80e05dbcb44147ed9
BLAKE2b-256 checksum
How to use checksums
a3763194a768f3fdc7b01eb808e265b46961a1cb6b86c690bebfbed87b77b79d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.21

Release files / langchain_mercadopago-0.1.0-py3-none-any.whl

Download URL langchain_mercadopago-0.1.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
322afadd0e7fa4d28b72ea9f019350abdee340614a17948b5908f9ebeda496a9
BLAKE2b-256 checksum
How to use checksums
cf518de5f0eebf5a4c0d255cfd0904f5e55d91e6ca6093e996cd6de327e55155
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.21

Security for langchain-mercadopago 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page