@ar-agents/mercadopago 0.18.1 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs +99 -99
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +99 -99
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/tools.manifest.json +53 -53
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.18.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Frontier release: new packages x402 (HTTP 402 agent payments), bind (BIND APIBANK), fecred (AFIP WSFECred FCE MiPyME). BiasBusters description audit across the toolkit (EN+ES task phrasing). MCP SDK 1.29.
|
|
8
|
+
|
|
3
9
|
## 0.18.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -3049,126 +3049,126 @@ async function deterministicIdempotencyKey(...parts) {
|
|
|
3049
3049
|
}
|
|
3050
3050
|
var DEFAULT_DESCRIPTIONS = {
|
|
3051
3051
|
// ── Subscriptions ────────────────────────────────────────────────────────
|
|
3052
|
-
create_subscription: "Create a Mercado Pago recurring subscription. Returns an init_point URL where the customer must complete the FIRST payment with their card and CVV (this is a hard MP requirement; agents cannot bypass it). After they pay, MP will auto-charge at the configured frequency without further intervention.",
|
|
3053
|
-
get_subscription_status: "Check the
|
|
3054
|
-
cancel_subscription: "Cancel an active Mercado Pago subscription. After cancellation, MP will not charge the customer again. This action is irreversible
|
|
3055
|
-
pause_subscription: "Pause an authorized Mercado Pago subscription. Charges stop until resumed. Only works on subscriptions in 'authorized' status.",
|
|
3056
|
-
resume_subscription: "Resume a paused Mercado Pago subscription. Charges resume on the next scheduled date. Only works on subscriptions in 'paused' status.",
|
|
3052
|
+
create_subscription: "Create a Mercado Pago recurring subscription (crear suscripci\xF3n, cobro recurrente con Mercado Pago). Returns an init_point URL where the customer must complete the FIRST payment with their card and CVV (this is a hard MP requirement; agents cannot bypass it). After they pay, MP will auto-charge at the configured frequency without further intervention.",
|
|
3053
|
+
get_subscription_status: "Check the status of a Mercado Pago subscription (consultar estado de una suscripci\xF3n). Use this to confirm the customer completed the first payment (status becomes 'authorized') or to inspect the next charge date.",
|
|
3054
|
+
cancel_subscription: "Cancel an active Mercado Pago subscription (cancelar suscripci\xF3n, dar de baja). After cancellation, MP will not charge the customer again. This action is irreversible, confirm with the user before calling.",
|
|
3055
|
+
pause_subscription: "Pause an authorized Mercado Pago subscription (pausar suscripci\xF3n). Charges stop until resumed. Only works on subscriptions in 'authorized' status.",
|
|
3056
|
+
resume_subscription: "Resume a paused Mercado Pago subscription (reactivar suscripci\xF3n). Charges resume on the next scheduled date. Only works on subscriptions in 'paused' status.",
|
|
3057
3057
|
// ── Payments ─────────────────────────────────────────────────────────────
|
|
3058
|
-
create_payment: "Create a one-time payment. Two flows: (a) with a card token from MP frontend Cardform
|
|
3059
|
-
get_payment: "Fetch a
|
|
3060
|
-
search_payments: "Search payments with filters. Most common: by external_reference (your-system identifier) to find all payments for an order, or by status='approved' to list successful charges in a date range. Returns paginated results.",
|
|
3061
|
-
cancel_payment: "Cancel a pending or in_process payment (only works before approval
|
|
3062
|
-
capture_payment: "Capture an authorized credit-card payment that was created with capture=false. Use for hold-then-capture flows (e.g., authorize on order, capture on shipment). Optional partial amount. **MOVES MONEY
|
|
3058
|
+
create_payment: "Create a one-time Mercado Pago payment (crear un pago, cobrar con Mercado Pago). Two flows: (a) with a card token from MP frontend Cardform, for transparent checkout; (b) without token, for non-card methods like 'account_money', 'rapipago', 'pagofacil'. For most agent flows where you only have a payer email and want to send them a payment link, use create_payment_preference instead (Checkout Pro hosted form). Returns the Payment object with status, typically 'approved' for account_money and 'pending' for tickets.",
|
|
3059
|
+
get_payment: "Fetch a Mercado Pago payment by ID (consultar un pago). Use to confirm status after webhook arrives, or to inspect details (status_detail explains rejections).",
|
|
3060
|
+
search_payments: "Search Mercado Pago payments with filters (buscar pagos). Most common: by external_reference (your-system identifier) to find all payments for an order, or by status='approved' to list successful charges in a date range. Returns paginated results.",
|
|
3061
|
+
cancel_payment: "Cancel a pending or in_process Mercado Pago payment (cancelar un pago pendiente); only works before approval. Once approved, use refund_payment instead. Common use: cancel an unpaid ticket payment that's still pending. **IRREVERSIBLE, confirm with the user before calling. Surface the payment_id, amount, payer_email, and current status, ask 's\xED, cancel\xE1' (or equivalent), then proceed.**",
|
|
3062
|
+
capture_payment: "Capture an authorized credit-card payment (capturar un pago autorizado) that was created with capture=false. Use for hold-then-capture flows (e.g., authorize on order, capture on shipment). Optional partial amount. **MOVES MONEY, confirm the amount with the user before calling.**",
|
|
3063
3063
|
// ── Refunds ──────────────────────────────────────────────────────────────
|
|
3064
|
-
refund_payment: "Refund an approved payment. Pass amount for partial refund; omit for full refund. Idempotency key is auto-generated based on paymentId+amount to prevent double-refunds on retries. **IRREVERSIBLE AND MOVES MONEY
|
|
3065
|
-
list_refunds: "List all refunds for a
|
|
3064
|
+
refund_payment: "Refund an approved Mercado Pago payment (reembolsar un pago, hacer una devoluci\xF3n). Pass amount for partial refund; omit for full refund. Idempotency key is auto-generated based on paymentId+amount to prevent double-refunds on retries. **IRREVERSIBLE AND MOVES MONEY, confirm with the user before calling. Restate the payment_id, the refund amount (full vs partial), and ask explicit confirmation. Mercado Pago does not support 'undo refund', once issued, the buyer's bank releases the funds.**",
|
|
3065
|
+
list_refunds: "List all refunds for a payment (listar reembolsos de un pago). Returns array of Refund objects. Useful to confirm a refund was processed or to inspect partial-refund history.",
|
|
3066
3066
|
// ── Checkout Pro ─────────────────────────────────────────────────────────
|
|
3067
|
-
create_payment_preference: "Create a Mercado Pago Checkout Pro
|
|
3068
|
-
get_payment_preference: "Fetch a Checkout Pro preference by ID. Returns the preference config and current init_point URLs. Use to inspect a previously-created link.",
|
|
3067
|
+
create_payment_preference: "Create a Mercado Pago Checkout Pro payment link (crear link de pago, cobrar por Mercado Pago) and get back a payment URL (init_point) to send to the customer. THIS is the recommended way for an agent to take a payment when you only have a payer email, the buyer enters card data on MP's hosted form (no PCI scope needed). Supports cuotas configuration, payment method exclusions, back URLs after success/failure/pending. In sandbox, use sandbox_init_point from the response.",
|
|
3068
|
+
get_payment_preference: "Fetch a Checkout Pro preference / payment link by ID (consultar un link de pago). Returns the preference config and current init_point URLs. Use to inspect a previously-created link.",
|
|
3069
3069
|
// ── Customers + Cards ────────────────────────────────────────────────────
|
|
3070
|
-
create_customer: "Create a Mercado Pago customer record so the buyer can save cards for future charges. Idempotent on email
|
|
3071
|
-
find_customer_by_email: "Find an existing customer by email
|
|
3072
|
-
list_customer_cards: "List
|
|
3073
|
-
delete_customer_card: "Delete a saved card from a customer. Common use: customer requests removal, or expired card cleanup. **IRREVERSIBLE
|
|
3070
|
+
create_customer: "Create a Mercado Pago customer record (crear cliente en Mercado Pago) so the buyer can save cards for future charges. Idempotent on email, if a customer with that email exists, MP returns it instead of creating a duplicate. Use find_customer_by_email first if you're unsure.",
|
|
3071
|
+
find_customer_by_email: "Find an existing Mercado Pago customer by email (buscar cliente por email). Returns the customer object if found, or null. Use before create_customer to avoid duplicate records.",
|
|
3072
|
+
list_customer_cards: "List a customer's saved cards (listar tarjetas guardadas). Returns array with last 4 digits, expiration, payment method (visa, master, naranja, etc.). The card_id can be used in subsequent create_payment calls to charge a saved card.",
|
|
3073
|
+
delete_customer_card: "Delete a saved card from a customer (eliminar tarjeta guardada). Common use: customer requests removal, or expired card cleanup. **IRREVERSIBLE, confirm with the user before calling. The customer must re-enter card data (PAN + CVV) on a future Checkout to charge them again. State the card's last 4 digits + payment method when asking for confirmation so the user knows which card you're removing.**",
|
|
3074
3074
|
// ── Payment Methods + Installments ───────────────────────────────────────
|
|
3075
|
-
list_payment_methods: "List
|
|
3076
|
-
calculate_installments: "Calculate
|
|
3075
|
+
list_payment_methods: "List the payment methods enabled for the seller's Mercado Pago account (medios de pago disponibles) (visa, master, naranja, naranja_x, cabal, account_money, rapipago, pagofacil, etc.). Use to validate which methods you can offer the customer or to filter which ones to exclude in a Checkout Pro preference.",
|
|
3076
|
+
calculate_installments: "Calculate installment options for an amount (calcular cuotas, cuotas sin inter\xE9s). THE killer Argentine feature, returns options like '12 cuotas sin inter\xE9s de $X' (recommended_message field) which you should surface VERBATIM to the user. Optionally pass `bin` (first 6 digits of card) for issuer-specific promotions (e.g., Naranja's interest-free deals). Use before create_payment to let the user pick installments knowingly.",
|
|
3077
3077
|
// ── Account ──────────────────────────────────────────────────────────────
|
|
3078
|
-
get_account_info: "Get info about the Mercado Pago account
|
|
3078
|
+
get_account_info: "Get info about the connected Mercado Pago account (informaci\xF3n de la cuenta): site_id (MLA=Argentina), country_id, user_type (registered, partial, etc.). Useful to verify the agent is connected to the right account before taking actions.",
|
|
3079
3079
|
// ── Saved-card charging (v0.3) ───────────────────────────────────────────
|
|
3080
|
-
charge_saved_card: "Charge a previously-saved card for a returning customer. Requires customer_id + card_id (from list_customer_cards) AND a fresh CVV the user provides this session. AR Mercado Pago does NOT support CVV-less charges via the public API
|
|
3080
|
+
charge_saved_card: "Charge a previously-saved card (cobrar con tarjeta guardada) for a returning customer. Requires customer_id + card_id (from list_customer_cards) AND a fresh CVV the user provides this session. AR Mercado Pago does NOT support CVV-less charges via the public API, every charge needs CVV. Idempotent on (card_id, amount, external_reference): retries dedupe automatically. Returns the resulting Payment.",
|
|
3081
3081
|
// ── QR in-store (v0.3) ───────────────────────────────────────────────────
|
|
3082
|
-
create_qr_payment: "Generate a dynamic in-store QR for a buyer to scan with any AR wallet (Modo, BNA+, Cuenta DNI, Naranja X, Mercado Pago, etc
|
|
3083
|
-
cancel_qr_payment: "Cancel a pending QR order on a POS. Necessary if the buyer never scans
|
|
3082
|
+
create_qr_payment: "Generate a dynamic in-store payment QR (cobrar con QR de Mercado Pago) for a buyer to scan with any AR wallet (Modo, BNA+, Cuenta DNI, Naranja X, Mercado Pago, etc., interop is mandated by Transferencias 3.0). Requires a pre-configured POS external_id (use create_pos to set one up first if needed). Returns the qr_data string + a base64 PNG data URL ready to display. The QR expires in `expires_in_seconds` (default 600). MP fires `point_integration_wh` then `payment` webhooks when scanned.",
|
|
3083
|
+
cancel_qr_payment: "Cancel a pending QR order on a POS (cancelar un QR pendiente). Necessary if the buyer never scans, otherwise the next create_qr_payment on the same POS returns 409. **IRREVERSIBLE, but low-stakes since the QR has not been paid yet. Confirm before calling if the user is mid-flow.**",
|
|
3084
3084
|
// ── Subscription Plans (v0.4) ────────────────────────────────────────────
|
|
3085
|
-
create_subscription_plan: "Create a
|
|
3085
|
+
create_subscription_plan: "Create a reusable subscription plan (crear plan de suscripci\xF3n; preapproval_plan). Different from create_subscription: a plan defines price + frequency once, then customers subscribe to it via subscribe_to_plan. Use plans for SaaS-style billing (B\xE1sico/Pro/Enterprise tiers). For per-customer custom amounts, use create_subscription directly.",
|
|
3086
3086
|
list_subscription_plans: "List all subscription plans defined for this MP account. Useful before create_subscription_plan to check if one already exists, or for surfacing options to a customer.",
|
|
3087
|
-
update_subscription_plan: "Update a subscription plan's reason / amount / status / back_url. Existing customer subscriptions to the plan are NOT automatically updated
|
|
3088
|
-
subscribe_to_plan: "Subscribe a customer to an existing
|
|
3089
|
-
list_subscription_payments: "List the auto-
|
|
3087
|
+
update_subscription_plan: "Update a subscription plan's reason / amount / status / back_url. Existing customer subscriptions to the plan are NOT automatically updated, only NEW subscribers get the new pricing.",
|
|
3088
|
+
subscribe_to_plan: "Subscribe a customer to an existing plan (suscribir un cliente a un plan). Returns a Preapproval with init_point URL where the customer completes first payment. Cleaner than create_subscription when you have fixed tiers.",
|
|
3089
|
+
list_subscription_payments: "List the auto-charges under a subscription (cobros de una suscripci\xF3n; authorized_payments). Useful for 'show me the cobros del \xFAltimo mes for this client' or to debug a failing recurring charge.",
|
|
3090
3090
|
// ── Stores + POS (v0.4) ──────────────────────────────────────────────────
|
|
3091
3091
|
create_store: "Create a store under the seller's MP account. Stores are the parent entity for POSes (which generate QR payments). Required ONE-TIME setup before create_pos. Pass a unique external_id and a display name.",
|
|
3092
3092
|
list_stores: "List all stores configured for this MP account. Use this to find an existing store_id before create_pos, or to surface store options to the agent.",
|
|
3093
3093
|
create_pos: "Create a POS (Point of Sale) under a store. The POS's external_id is what create_qr_payment uses. Each physical checkout / counter / agent typically has its own POS. Categories are MP-defined (default 621102 = Other Food and Beverage Services).",
|
|
3094
3094
|
list_pos: "List all POSes for the seller (or filtered by store_id). Use to find an existing POS before create_qr_payment, or to surface options.",
|
|
3095
|
-
// ── Disputes (v0.4
|
|
3096
|
-
list_payment_disputes: "List all disputes / chargebacks raised against a payment. Read-only
|
|
3095
|
+
// ── Disputes (v0.4, read-only) ──────────────────────────────────────────
|
|
3096
|
+
list_payment_disputes: "List all disputes / chargebacks raised against a payment. Read-only, resolution is dashboard-only. Surface the dashboard URL `https://www.mercadopago.com.ar/disputes/{dispute_id}` to the user when they need to respond.",
|
|
3097
3097
|
get_dispute: "Get details of a specific dispute including reason, amount, resolution status. Read-only.",
|
|
3098
3098
|
// ── Lookup helpers (v0.4) ────────────────────────────────────────────────
|
|
3099
3099
|
list_identification_types: "List valid identification types for the seller's site. AR returns: DNI, CI, LE, LC, Otro, Pasaporte, CUIT, CUIL with their min/max length. Useful to validate an identification before passing to create_payment.",
|
|
3100
|
-
list_issuers: "List card issuers (banks) that support a payment_method_id. Optionally filter by `bin` (first 6 digits of the card) for accurate issuer detection. Useful with calculate_installments
|
|
3100
|
+
list_issuers: "List card issuers (banks) that support a payment_method_id. Optionally filter by `bin` (first 6 digits of the card) for accurate issuer detection. Useful with calculate_installments, issuer-specific promos (e.g., Naranja Galicia 6 cuotas sin inter\xE9s) only appear when the issuer is identified.",
|
|
3101
3101
|
// ── Webhooks management (v0.4) ───────────────────────────────────────────
|
|
3102
3102
|
list_webhooks: "List all webhook subscriptions configured for this MP application. Use to see what topics + URLs are wired before adding new ones.",
|
|
3103
3103
|
create_webhook: "Subscribe a webhook URL to a MP topic (payment, subscription_authorized_payment, subscription_preapproval, merchant_order, point_integration_wh). MP will POST to this URL when events of that topic fire.",
|
|
3104
3104
|
update_webhook: "Update a webhook's URL or topic. Useful when you change deployment URLs without resubscribing from scratch.",
|
|
3105
|
-
delete_webhook: "Delete a webhook subscription. MP stops POSTing to it immediately. **IRREVERSIBLE
|
|
3105
|
+
delete_webhook: "Delete a webhook subscription. MP stops POSTing to it immediately. **IRREVERSIBLE, confirm before calling. State the webhook URL + topic so the user knows which subscription is being removed. Re-subscribing requires a new create_webhook call.**",
|
|
3106
3106
|
// ── Webhook handler combo (v0.5) ─────────────────────────────────────────
|
|
3107
|
-
handle_webhook: "Process an incoming MP webhook in ONE call: verify the HMAC-SHA256 signature, parse the event, and (optionally) auto-fetch the underlying resource (Payment, Subscription, Order). Returns the structured event PLUS the full resource. USE THIS in your webhook endpoint INSTEAD of chaining verify_webhook_signature + parse_webhook_event + get_payment manually. Pass the raw request body, x-signature header, x-request-id header, and your MP webhook secret. SAFE: returns { verified: false } when signature mismatches
|
|
3107
|
+
handle_webhook: "Process an incoming MP webhook in ONE call: verify the HMAC-SHA256 signature, parse the event, and (optionally) auto-fetch the underlying resource (Payment, Subscription, Order). Returns the structured event PLUS the full resource. USE THIS in your webhook endpoint INSTEAD of chaining verify_webhook_signature + parse_webhook_event + get_payment manually. Pass the raw request body, x-signature header, x-request-id header, and your MP webhook secret. SAFE: returns { verified: false } when signature mismatches, caller should respond 401 and stop processing. WHEN auto_fetch is true (default), the resource is fetched as the SAME MP user the client is configured for (so for marketplace integrations, instantiate a per-seller client).",
|
|
3108
3108
|
// ── OAuth Marketplace (v0.5) ─────────────────────────────────────────────
|
|
3109
|
-
oauth_authorize_url: "Build the URL the SELLER (third-party MP account) visits to authorize your marketplace app. Pass the seller's redirect uri (must be whitelisted in MP dev panel) and an opaque state token (CSRF protection
|
|
3110
|
-
oauth_exchange_code: "Exchange the authorization code (from the OAuth redirect) for an `OAuthToken`. Returns access_token, refresh_token, user_id, and expires_in. **PERSIST the entire response
|
|
3111
|
-
oauth_refresh_token: "Refresh a per-seller access_token using the saved refresh_token. Call PROACTIVELY before expires_in elapses, or REACTIVELY on a 401 from a per-seller MercadoPagoClient. Returns a fresh OAuthToken
|
|
3112
|
-
// ── Order Management API (v0.5
|
|
3113
|
-
create_order: "Create a new Order via MP's modern Order Management API. DIFFERENT from create_payment_preference: Order is a transactional entity with explicit lifecycle (created \u2192 processed \u2192 captured/canceled), supports MANUAL CAPTURE (auth-only, capture later
|
|
3109
|
+
oauth_authorize_url: "Build the URL the SELLER (third-party MP account) visits to authorize your marketplace app. Pass the seller's redirect uri (must be whitelisted in MP dev panel) and an opaque state token (CSRF protection, bind it to the user's session). PURE FUNCTION: no network. The seller approves, MP redirects them to your `redirect_uri?code=...&state=...`. Then call oauth_exchange_code with the code.",
|
|
3110
|
+
oauth_exchange_code: "Exchange the authorization code (from the OAuth redirect) for an `OAuthToken`. Returns access_token, refresh_token, user_id, and expires_in. **PERSIST the entire response**, refresh_token is long-lived and the only way to keep the integration alive past 6h. Use the access_token to instantiate a per-seller MercadoPagoClient for marketplace flows.",
|
|
3111
|
+
oauth_refresh_token: "Refresh a per-seller access_token using the saved refresh_token. Call PROACTIVELY before expires_in elapses, or REACTIVELY on a 401 from a per-seller MercadoPagoClient. Returns a fresh OAuthToken, persist the new refresh_token (MP often returns the same value, but always replace).",
|
|
3112
|
+
// ── Order Management API (v0.5, modern Order API) ───────────────────────
|
|
3113
|
+
create_order: "Create a new Order via MP's modern Order Management API. DIFFERENT from create_payment_preference: Order is a transactional entity with explicit lifecycle (created \u2192 processed \u2192 captured/canceled), supports MANUAL CAPTURE (auth-only, capture later, for ride-share, hotels, marketplaces) and aggregates multiple payments into one Order. Use Preference (Checkout Pro) for simple hosted pay-links; use Order when you need auth-only or multi-payment-per-order semantics. For marketplace splits, set marketplace + marketplace_fee + collector_id (the SELLER's MP user_id from oauth_exchange_code).",
|
|
3114
3114
|
get_order: "Fetch an Order by ID. Returns the Order with its lifecycle status and any attached payments/refunds.",
|
|
3115
3115
|
update_order: "Patch an existing Order before it's captured/canceled. Common use: update items or external_reference.",
|
|
3116
3116
|
capture_order: "Capture a previously-authorized Order (only for orders created with capture_mode='manual'). Captures up to the originally-authorized amount; pass amount for partial capture. Common use: ride-share marks ride complete \u2192 capture; hotel checks-out guest \u2192 capture.",
|
|
3117
|
-
cancel_order: "Cancel an Order. Releases any auth-holds and marks the Order as canceled. For orders that have already been CAPTURED, use refund_payment instead
|
|
3117
|
+
cancel_order: "Cancel an Order. Releases any auth-holds and marks the Order as canceled. For orders that have already been CAPTURED, use refund_payment instead, cancel only works pre-capture. **IRREVERSIBLE, confirm with the user. State the order_id, total_amount, and current status before asking 's\xED, cancel\xE1'. The buyer's hold is released to their bank within 24-72h depending on issuer.**",
|
|
3118
3118
|
// ── Account / Balance / Movements / Settlements (v0.6) ───────────────────
|
|
3119
3119
|
get_account_balance: "Get the seller's current MP wallet balance. Returns { available_balance, unavailable_balance, total_amount, currency_id }. The available balance is what the seller can withdraw or pay with right now; unavailable is in retention (typically 14-21 days for new sellers or risk-flagged transactions). For per-seller marketplace setups, instantiate the client AS THE SELLER first.",
|
|
3120
3120
|
list_account_movements: "List wallet movements (incoming payments, transfers, refunds, holdings) for the active MP account. Filter by date range with `from`/`to` (ISO 8601). Useful for monthly conciliation or 'show me what came in this month' workflows.",
|
|
3121
|
-
list_settlements: "List settlements (release_money)
|
|
3121
|
+
list_settlements: "List settlements (release_money), i.e. transfers from the MP wallet to the seller's registered bank account (CBU). USE WHEN the user asks 'cu\xE1ndo me deposita MP' or for monthly bank-conciliation reports. Filter by date range and status.",
|
|
3122
3122
|
get_settlement: "Get details of a single settlement: amount, date_scheduled, date_processed, bank_account info (CBU + bank name).",
|
|
3123
|
-
// ── 3DS analyzer (v0.6
|
|
3123
|
+
// ── 3DS analyzer (v0.6, pure) ───────────────────────────────────────────
|
|
3124
3124
|
analyze_payment_3ds: "Pure local analyzer for a Payment's 3DS (Strong Customer Authentication) state. Pass a payment_id (string) and the tool fetches the Payment then derives { status: 'not_required'|'frictionless'|'challenge_required'|'rejected'|'unknown', mode, challengeUrl, description }. USE THIS after every create_payment for credit cards: when challengeUrl !== null, you MUST redirect the buyer there before the payment can complete. Without 3DS, payments stay in 'pending' indefinitely if the issuer demanded a challenge.",
|
|
3125
|
-
// ── Test cards (v0.6
|
|
3126
|
-
get_test_cards: "Pure helper that returns the official MP test cards for AR (MLA): VISA/Mastercard/Amex credit + debit, with the 'magic' holder names that route the payment to specific status_detail values (APRO=approved, OTHE=rejected, CONT=pending, FUND=insufficient_amount, etc.). USE WHEN you need to demo a payment flow without a real card, or to script integration tests. Pure data
|
|
3125
|
+
// ── Test cards (v0.6, pure) ─────────────────────────────────────────────
|
|
3126
|
+
get_test_cards: "Pure helper that returns the official MP test cards for AR (MLA): VISA/Mastercard/Amex credit + debit, with the 'magic' holder names that route the payment to specific status_detail values (APRO=approved, OTHE=rejected, CONT=pending, FUND=insufficient_amount, etc.). USE WHEN you need to demo a payment flow without a real card, or to script integration tests. Pure data, no network call.",
|
|
3127
3127
|
// ── Customer + Card extensions (v0.7) ────────────────────────────────────
|
|
3128
3128
|
get_customer: "Get a customer by id. Returns full Customer object: email, first_name, last_name, identification, address, default_card, registered cards. PURE READ. USE WHEN you have the customer_id from a previous create_customer / find_customer_by_email / payment.payer.id and want the full record.",
|
|
3129
|
-
update_customer: "Update a customer's profile (first_name, last_name, phone, identification, address, default_card). MP merges the patch
|
|
3130
|
-
create_customer_card: "Add a saved card to an existing customer using a card_token (one-time token from MP frontend Cardform
|
|
3131
|
-
get_customer_card: "Get details of a single saved card by (customer_id, card_id). Returns last 4 digits, expiration, brand, issuer. PURE READ
|
|
3129
|
+
update_customer: "Update a customer's profile (first_name, last_name, phone, identification, address, default_card). MP merges the patch, fields you don't send remain unchanged. Use to keep customer records in sync (e.g., shipping address changes) or to set a default card for charge_saved_card.",
|
|
3130
|
+
create_customer_card: "Add a saved card to an existing customer using a card_token (one-time token from MP frontend Cardform, agents should NEVER take raw card data, that's a PCI violation). Returns the saved CustomerCard with id usable in charge_saved_card. Persists across charges (no need to re-tokenize each time).",
|
|
3131
|
+
get_customer_card: "Get details of a single saved card by (customer_id, card_id). Returns last 4 digits, expiration, brand, issuer. PURE READ, useful before charge_saved_card to confirm the card is still valid.",
|
|
3132
3132
|
// ── Subscription / Plan / Refund / Preference extensions (v0.7) ─────────
|
|
3133
3133
|
get_subscription_plan: "Fetch a subscription plan by id. Returns plan config: amount, frequency, status, init_point. Use to inspect a plan before subscribing customers, or to display plan details to the user.",
|
|
3134
3134
|
update_subscription: "Update a subscription's amount, status, reason, external_reference, OR card_token_id (to switch payment method when the buyer's card is expired/declined). For card swap: pass card_token_id from a fresh tokenization. CONSTRAINTS: status changes only support 'paused' | 'cancelled' (use authorize via init_point flow to re-activate).",
|
|
3135
3135
|
search_subscriptions: "Search subscriptions across the seller's account. Filter by status (pending/authorized/paused/cancelled), payer_email, external_reference, or preapproval_plan_id (to find all subscribers of a plan). Paginated. USE WHEN you need to enumerate active subscribers, audit cancellations, or find a subscription by external reference.",
|
|
3136
|
-
get_refund: "Fetch a single refund by (payment_id, refund_id). Returns the Refund object with amount, status, date_created. PURE READ
|
|
3136
|
+
get_refund: "Fetch a single refund by (payment_id, refund_id). Returns the Refund object with amount, status, date_created. PURE READ, useful to verify a refund processed or to reconcile partial-refund history.",
|
|
3137
3137
|
update_payment_preference: "Update a Checkout Pro preference (notification_url, back_urls, items, payer info, payment_methods exclusion list). Only works on preferences NOT yet paid. Common use: regenerate the link with a new notification_url after deployment, or change items if the buyer requested adjustments before paying.",
|
|
3138
3138
|
// ── Merchant Orders (v0.7) ────────────────────────────────────────────────
|
|
3139
|
-
get_merchant_order: "Get a merchant_order with all its associated payments + shipments. MerchantOrder is the parent entity for Payments associated with a single Preference
|
|
3139
|
+
get_merchant_order: "Get a merchant_order with all its associated payments + shipments. MerchantOrder is the parent entity for Payments associated with a single Preference, one Order can have multiple partial Payments (retries, installments). USE THIS in webhooks with topic='merchant_order' to get the aggregate paid_amount, refunded_amount, and shipping status in one call.",
|
|
3140
3140
|
search_merchant_orders: "Search merchant_orders by preference_id, external_reference, or status. Paginated. Returns up to 50 per page. USE WHEN you have a preference_id and want all its derived merchant_orders, or when reconciling 'which payments belong to which preference'.",
|
|
3141
|
-
update_merchant_order: "Update a merchant_order
|
|
3141
|
+
update_merchant_order: "Update a merchant_order, typically to add items or shipping info. Most agent flows don't need this; use only when integrating with a custom shipping flow that requires updating the MO mid-lifecycle.",
|
|
3142
3142
|
// ── Stores + POS CRUD completion (v0.7) ──────────────────────────────────
|
|
3143
3143
|
get_store: "Fetch a single store by (user_id, store_id). Returns store details: name, location, business_hours, external_id. PURE READ.",
|
|
3144
3144
|
update_store: "Update a store's properties (name, location, business_hours, external_id). MP merges the patch.",
|
|
3145
|
-
delete_store: "Delete a store. IRREVERSIBLE. Confirm with user before calling. Will fail if the store has associated POSes
|
|
3145
|
+
delete_store: "Delete a store. IRREVERSIBLE. Confirm with user before calling. Will fail if the store has associated POSes, delete those first.",
|
|
3146
3146
|
get_pos: "Fetch a POS by id. Returns: name, store_id, category, external_id, qr_template (if configured). PURE READ. Use when you need to find the external_id for create_qr_payment.",
|
|
3147
3147
|
update_pos: "Update a POS's properties (name, category, external_id). MP merges the patch.",
|
|
3148
3148
|
delete_pos: "Delete a POS. IRREVERSIBLE. Cancels any pending QR orders attached to it. Confirm with user before calling.",
|
|
3149
3149
|
// ── Bank Accounts (v0.7) ─────────────────────────────────────────────────
|
|
3150
|
-
list_bank_accounts: "List the bank accounts (CBUs) the seller has registered with MP for receiving payouts. Returns an array
|
|
3151
|
-
register_bank_account: "Register a new bank account (CBU) for the seller. NOTE: MP usually requires this through the dashboard for compliance
|
|
3150
|
+
list_bank_accounts: "List the bank accounts (CBUs) the seller has registered with MP for receiving payouts. Returns an array, the one with `is_default: true` is where settlements (release_money) go. USE BEFORE list_settlements when the user asks 'a qu\xE9 cuenta me deposita MP'.",
|
|
3151
|
+
register_bank_account: "Register a new bank account (CBU) for the seller. NOTE: MP usually requires this through the dashboard for compliance, this endpoint may not work for all accounts. If it fails with 403, redirect the user to https://www.mercadopago.com.ar/banking/dashboard.",
|
|
3152
3152
|
// ── Point Devices físicos (v0.7) ─────────────────────────────────────────
|
|
3153
|
-
list_point_devices: "List the physical Point devices (Smart, Tap to Pay, etc.) linked to the seller's MP account. Distinct from logical POS
|
|
3153
|
+
list_point_devices: "List the physical Point devices (Smart, Tap to Pay, etc.) linked to the seller's MP account. Distinct from logical POS, these are actual terminals at brick-and-mortar shops. Returns each device's id (serial), operating_mode (PDV vs STANDALONE), and pos_id (when bound to a logical POS). Filter by pos_id to find devices for a specific cash register.",
|
|
3154
3154
|
update_point_device_mode: "Switch a Point device's operating_mode between 'PDV' (bound to a logical POS, takes payments triggered through that POS) and 'STANDALONE' (works independently, accepts any payment). PDV is for cash-register integrations; STANDALONE is for free-form retail. Affects how payments hit the device.",
|
|
3155
|
-
create_point_payment_intent: "Create a payment intent on a physical Point device
|
|
3155
|
+
create_point_payment_intent: "Create a payment intent on a physical Point device, the device prompts the buyer to tap/insert/swipe their card. Returns immediately with intent_id; query state via get_point_payment_intent or wait for point_integration_wh webhook. **AMOUNT IS IN CENTAVOS**, NOT pesos (Point API differs from Payments API): 100 = $1, 1000 = $10, 10000 = $100.",
|
|
3156
3156
|
get_point_payment_intent: "Get the current state of a Point payment intent (OPEN, PROCESSING, FINISHED, CANCELED, ERROR). USE in polling loops if you can't wait for the webhook. When state=FINISHED, the intent.payment.id is the resulting Payment id usable with get_payment.",
|
|
3157
|
-
cancel_point_payment_intent: "Cancel an OPEN point payment intent before the buyer interacts with the device. ONLY WORKS while state='OPEN'
|
|
3157
|
+
cancel_point_payment_intent: "Cancel an OPEN point payment intent before the buyer interacts with the device. ONLY WORKS while state='OPEN', once the buyer taps, you can't cancel; refund_payment after the fact instead. **IRREVERSIBLE, confirm with the cashier/operator before calling. State the device_id and amount.**",
|
|
3158
3158
|
// ── Pure helpers (v0.7) ──────────────────────────────────────────────────
|
|
3159
|
-
compute_marketplace_fee: "PURE HELPER (no network)
|
|
3160
|
-
explain_payment_status: "PURE HELPER (no network)
|
|
3161
|
-
// ── v0.9
|
|
3162
|
-
mp_health_check: "Liveness probe against MP. Returns { ok, latencyMs, userId, circuit }. USE THIS as the first call in long-running agent workflows to verify (a) network path to MP is up, (b) accessToken is valid, (c) MP is responding. Circuit-breaker state included when configured
|
|
3163
|
-
// ── v0.10
|
|
3164
|
-
find_applicable_promos: "PURE HELPER (no network, sub-ms)
|
|
3165
|
-
// ── v0.10
|
|
3159
|
+
compute_marketplace_fee: "PURE HELPER (no network), given a transaction amount + fee rule (% or flat ARS, with optional min/max floors), returns the exact `marketplace_fee` value in ARS to pass to create_order or create_payment_preference. USE WHEN your platform takes a commission and you need to compute the exact fee per transaction. Examples: { percent: 5, minArs: 50, maxArs: 5000 } for percentage with floor + cap; { flatArs: 200, percent: 2 } for fixed + percentage.",
|
|
3160
|
+
explain_payment_status: "PURE HELPER (no network), given a Payment object (from get_payment / create_payment / handle_webhook), returns { summary, recommendedAction, final, paid, retryable } in Spanish. Translates MP's cryptic status_detail codes to plain Spanish + actionable guidance ('reintentar con otra tarjeta' vs 'esperar webhook' vs 'estado final'). USE THIS instead of having to memorize 30+ status_detail codes, surface summary + recommendedAction directly to the user.",
|
|
3161
|
+
// ── v0.9, Health check + observability ──────────────────────────────────
|
|
3162
|
+
mp_health_check: "Liveness probe against MP. Returns { ok, latencyMs, userId, circuit }. USE THIS as the first call in long-running agent workflows to verify (a) network path to MP is up, (b) accessToken is valid, (c) MP is responding. Circuit-breaker state included when configured, surface to ops dashboards. Returns ok=false instead of throwing, safe to call in monitoring loops without try/catch.",
|
|
3163
|
+
// ── v0.10, AR issuer cuotas promos (pure) ───────────────────────────────
|
|
3164
|
+
find_applicable_promos: "PURE HELPER (no network, sub-ms), returns the 'cuotas sin inter\xE9s' promotions applicable to a given (issuer, paymentMethodId, amount, category, date) tuple. Includes the federal Ahora 3/6/12/18/24/30 program AND issuer-specific deals (Naranja con Galicia los jueves, Santander Amex en supermercados los martes, etc.). USE THIS BEFORE checkout to surface 'pag\xE1 en 12 cuotas sin inter\xE9s con tu Galicia' hints to the buyer, drives conversion. Returns an array of CuotasPromo objects; the `description` field is in Spanish and ALWAYS surface verbatim. Catalog updated quarterly.",
|
|
3165
|
+
// ── v0.10, 3DS challenge resolution ────────────────────────────────────
|
|
3166
3166
|
confirm_3ds_challenge: "After the buyer completes a 3DS challenge (redirected back from challengeUrl), call this to poll MP and confirm whether the payment is now resolved. Polls get_payment up to N times with exponential backoff. Returns { payment, threeDs, resolved, attempts }. USE THIS as the FINAL step in the 3DS flow (after analyze_payment_3ds detected a challenge_required). Without confirming, the payment stays in 'pending' indefinitely from the buyer's perspective.",
|
|
3167
|
-
// ── v0.10
|
|
3168
|
-
search_payments_all: "Collect ALL payments matching a filter
|
|
3169
|
-
list_settlements_all: "Collect ALL settlements matching a filter
|
|
3170
|
-
// ── v0.11
|
|
3171
|
-
validate_tax_id: "PURE HELPER (no network, sub-ms)
|
|
3167
|
+
// ── v0.10, Auto-paginate variants ──────────────────────────────────────
|
|
3168
|
+
search_payments_all: "Collect ALL payments matching a filter, auto-paginates under the hood. Returns an array (NOT paginated) so the agent doesn't have to manage offset/limit loops manually. SAFETY: pass `max_items` to cap; without it, MP traversal is bounded by the toolkit's internal max (10,000 items) to prevent runaway iterations. USE WHEN the agent needs to enumerate everything (e.g., monthly reconciliation 'all approved payments in March'). For agent flows that only need 'first N matches', pass `max_items` directly.",
|
|
3169
|
+
list_settlements_all: "Collect ALL settlements matching a filter, auto-paginates. Pass `max_items` to cap. Use for monthly bank-conciliation reports.",
|
|
3170
|
+
// ── v0.11, TaxID validation cross-LATAM (pure) ──────────────────────────
|
|
3171
|
+
validate_tax_id: "PURE HELPER (no network, sub-ms), validates a tax ID against the appropriate country algorithm. Supports AR (DNI/CUIT/CUIL with modulo-11), BR (CPF/CNPJ with two-step weighted modulo), MX (RFC structure), CL (RUT with K digit), CO (NIT modulo-11), UY (RUT 12-digit checksum), PE (RUC 11-digit + prefix validation). Returns { valid, normalized, formatted, type, country, error }. USE THIS BEFORE submitting buyer identification to MP, invalid tax IDs cause 4xx rejections. Surface the Spanish error verbatim."
|
|
3172
3172
|
};
|
|
3173
3173
|
function mercadoPagoTools(client, options) {
|
|
3174
3174
|
const desc = (name) => options.descriptions?.[name] ?? DEFAULT_DESCRIPTIONS[name];
|
|
@@ -3178,7 +3178,7 @@ function mercadoPagoTools(client, options) {
|
|
|
3178
3178
|
function buildAllTools(client, options, desc) {
|
|
3179
3179
|
return {
|
|
3180
3180
|
// ─────────────────────────────────────────────────────────────────────────
|
|
3181
|
-
// Subscriptions (v0.1
|
|
3181
|
+
// Subscriptions (v0.1, kept identical for backward compatibility)
|
|
3182
3182
|
// ─────────────────────────────────────────────────────────────────────────
|
|
3183
3183
|
create_subscription: ai.tool({
|
|
3184
3184
|
description: desc("create_subscription"),
|
|
@@ -3200,7 +3200,7 @@ function buildAllTools(client, options, desc) {
|
|
|
3200
3200
|
frequencyType: "months",
|
|
3201
3201
|
backUrl: options.backUrl,
|
|
3202
3202
|
...external_reference !== void 0 ? { externalReference: external_reference } : {},
|
|
3203
|
-
// Deterministic idempotency
|
|
3203
|
+
// Deterministic idempotency, if the LLM retries this tool call
|
|
3204
3204
|
// with the same inputs (e.g., timeout + retry), MP returns the
|
|
3205
3205
|
// EXISTING subscription instead of creating a duplicate.
|
|
3206
3206
|
idempotencyKey: await deterministicIdempotencyKey(
|
|
@@ -3311,12 +3311,12 @@ function buildAllTools(client, options, desc) {
|
|
|
3311
3311
|
identification: zod.z.object({
|
|
3312
3312
|
type: zod.z.enum(["DNI", "CUIT", "CUIL"]),
|
|
3313
3313
|
number: zod.z.string()
|
|
3314
|
-
}).optional().describe("Payer identification
|
|
3314
|
+
}).optional().describe("Payer identification, required for some payment types in AR"),
|
|
3315
3315
|
statement_descriptor: zod.z.string().max(13).optional().describe("Shows on buyer's card statement (max 13 chars)"),
|
|
3316
|
-
// v0.11
|
|
3316
|
+
// v0.11, fraud scoring enrichment fields
|
|
3317
3317
|
additional_info: zod.z.object({
|
|
3318
3318
|
ip_address: zod.z.string().optional().describe(
|
|
3319
|
-
"Buyer's IP address (from req.headers X-Forwarded-For). STRONGLY RECOMMENDED for card payments
|
|
3319
|
+
"Buyer's IP address (from req.headers X-Forwarded-For). STRONGLY RECOMMENDED for card payments, improves MP fraud scoring confidence and reduces false-positive rejections (3-5x lower per RG 5286/2023)."
|
|
3320
3320
|
),
|
|
3321
3321
|
referral_url: zod.z.string().url().optional().describe("Page the buyer came from"),
|
|
3322
3322
|
payer: zod.z.object({
|
|
@@ -3328,7 +3328,7 @@ function buildAllTools(client, options, desc) {
|
|
|
3328
3328
|
street_name: zod.z.string().optional(),
|
|
3329
3329
|
street_number: zod.z.number().optional()
|
|
3330
3330
|
}).optional(),
|
|
3331
|
-
registration_date: zod.z.string().optional().describe("ISO 8601
|
|
3331
|
+
registration_date: zod.z.string().optional().describe("ISO 8601, when the buyer registered on YOUR platform"),
|
|
3332
3332
|
authentication_type: zod.z.string().optional(),
|
|
3333
3333
|
is_prime_user: zod.z.boolean().optional(),
|
|
3334
3334
|
is_first_purchase_online: zod.z.boolean().optional(),
|
|
@@ -3365,7 +3365,7 @@ function buildAllTools(client, options, desc) {
|
|
|
3365
3365
|
...input.statement_descriptor !== void 0 ? { statementDescriptor: input.statement_descriptor } : {},
|
|
3366
3366
|
...input.additional_info !== void 0 ? { additionalInfo: input.additional_info } : {},
|
|
3367
3367
|
...options.notificationUrl !== void 0 ? { notificationUrl: options.notificationUrl } : {},
|
|
3368
|
-
// Deterministic idempotency key
|
|
3368
|
+
// Deterministic idempotency key, safe to retry, same inputs always
|
|
3369
3369
|
// produce the same key (MP dedupes on its side).
|
|
3370
3370
|
idempotencyKey: await deterministicIdempotencyKey(
|
|
3371
3371
|
"create_payment",
|
|
@@ -3535,7 +3535,7 @@ function buildAllTools(client, options, desc) {
|
|
|
3535
3535
|
external_reference: zod.z.string().optional(),
|
|
3536
3536
|
max_installments: zod.z.number().int().min(1).max(24).optional().describe("Limit max cuotas offered. Defaults to MP account config."),
|
|
3537
3537
|
statement_descriptor: zod.z.string().max(13).optional(),
|
|
3538
|
-
excluded_payment_types: zod.z.array(zod.z.enum(["credit_card", "debit_card", "ticket", "atm", "bank_transfer"])).optional().describe("Block payment types
|
|
3538
|
+
excluded_payment_types: zod.z.array(zod.z.enum(["credit_card", "debit_card", "ticket", "atm", "bank_transfer"])).optional().describe("Block payment types, e.g., ['ticket'] to disable Rapipago/Pago F\xE1cil")
|
|
3539
3539
|
}),
|
|
3540
3540
|
execute: async (input) => {
|
|
3541
3541
|
const idemKey = await deterministicIdempotencyKey(
|
|
@@ -3747,7 +3747,7 @@ function buildAllTools(client, options, desc) {
|
|
|
3747
3747
|
inputSchema: zod.z.object({
|
|
3748
3748
|
customer_id: zod.z.string().describe("MP customer id (from create_customer / find_customer_by_email)"),
|
|
3749
3749
|
card_id: zod.z.string().describe("Saved card id (from list_customer_cards)"),
|
|
3750
|
-
security_code: zod.z.string().regex(/^\d{3,4}$/).describe("CVV
|
|
3750
|
+
security_code: zod.z.string().regex(/^\d{3,4}$/).describe("CVV, 3 digits (Visa/Master) or 4 (Amex). User must provide this each charge in AR."),
|
|
3751
3751
|
amount_ars: zod.z.number().positive(),
|
|
3752
3752
|
description: zod.z.string().min(1).max(255),
|
|
3753
3753
|
installments: zod.z.number().int().min(1).max(24).optional().describe("Default 1. Use calculate_installments first to pick a valid count."),
|
|
@@ -3796,7 +3796,7 @@ function buildAllTools(client, options, desc) {
|
|
|
3796
3796
|
title: zod.z.string().min(1).max(80).describe("Display title shown when scanning"),
|
|
3797
3797
|
description: zod.z.string().max(255).optional(),
|
|
3798
3798
|
external_reference: zod.z.string().optional(),
|
|
3799
|
-
notification_url: zod.z.string().url().optional().describe("Webhook URL
|
|
3799
|
+
notification_url: zod.z.string().url().optional().describe("Webhook URL, falls back to dashboard config if omitted"),
|
|
3800
3800
|
expires_in_seconds: zod.z.number().int().min(60).max(3600).optional().describe("Default 600 (10 min)")
|
|
3801
3801
|
}),
|
|
3802
3802
|
execute: async (input) => {
|
|
@@ -4079,7 +4079,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4079
4079
|
}
|
|
4080
4080
|
}),
|
|
4081
4081
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4082
|
-
// Disputes (v0.4
|
|
4082
|
+
// Disputes (v0.4, read-only)
|
|
4083
4083
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4084
4084
|
list_payment_disputes: ai.tool({
|
|
4085
4085
|
description: desc("list_payment_disputes"),
|
|
@@ -4227,7 +4227,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4227
4227
|
}
|
|
4228
4228
|
}),
|
|
4229
4229
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4230
|
-
// v0.5
|
|
4230
|
+
// v0.5, Webhook handler combo
|
|
4231
4231
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4232
4232
|
handle_webhook: ai.tool({
|
|
4233
4233
|
description: desc("handle_webhook"),
|
|
@@ -4339,7 +4339,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4339
4339
|
}
|
|
4340
4340
|
}),
|
|
4341
4341
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4342
|
-
// v0.5
|
|
4342
|
+
// v0.5, OAuth Marketplace flow
|
|
4343
4343
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4344
4344
|
oauth_authorize_url: ai.tool({
|
|
4345
4345
|
description: desc("oauth_authorize_url"),
|
|
@@ -4367,7 +4367,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4367
4367
|
return {
|
|
4368
4368
|
available: true,
|
|
4369
4369
|
url,
|
|
4370
|
-
next_step: "Redirect the seller to `url`. After approval MP sends them to redirect_uri?code=...&state
|
|
4370
|
+
next_step: "Redirect the seller to `url`. After approval MP sends them to redirect_uri?code=...&state=..., verify state matches, then call oauth_exchange_code with the code."
|
|
4371
4371
|
};
|
|
4372
4372
|
}
|
|
4373
4373
|
}),
|
|
@@ -4442,7 +4442,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4442
4442
|
}
|
|
4443
4443
|
}),
|
|
4444
4444
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4445
|
-
// v0.5
|
|
4445
|
+
// v0.5, Order Management API
|
|
4446
4446
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4447
4447
|
create_order: ai.tool({
|
|
4448
4448
|
description: desc("create_order"),
|
|
@@ -4461,7 +4461,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4461
4461
|
).optional(),
|
|
4462
4462
|
payer_email: zod.z.string().email().optional(),
|
|
4463
4463
|
capture_mode: zod.z.enum(["automatic", "manual"]).optional().describe(
|
|
4464
|
-
"'automatic' charges immediately; 'manual' authorizes only
|
|
4464
|
+
"'automatic' charges immediately; 'manual' authorizes only, capture later via capture_order."
|
|
4465
4465
|
),
|
|
4466
4466
|
notification_url: zod.z.string().url().optional(),
|
|
4467
4467
|
marketplace: zod.z.string().optional().describe(
|
|
@@ -4556,7 +4556,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4556
4556
|
}
|
|
4557
4557
|
}),
|
|
4558
4558
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4559
|
-
// v0.6
|
|
4559
|
+
// v0.6, Account / Balance / Movements / Settlements
|
|
4560
4560
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4561
4561
|
get_account_balance: ai.tool({
|
|
4562
4562
|
description: desc("get_account_balance"),
|
|
@@ -4610,7 +4610,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4610
4610
|
}
|
|
4611
4611
|
}),
|
|
4612
4612
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4613
|
-
// v0.6
|
|
4613
|
+
// v0.6, 3DS analyzer (combined: fetch payment + analyze)
|
|
4614
4614
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4615
4615
|
analyze_payment_3ds: ai.tool({
|
|
4616
4616
|
description: desc("analyze_payment_3ds"),
|
|
@@ -4629,7 +4629,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4629
4629
|
}
|
|
4630
4630
|
}),
|
|
4631
4631
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4632
|
-
// v0.6
|
|
4632
|
+
// v0.6, Test cards (pure)
|
|
4633
4633
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4634
4634
|
get_test_cards: ai.tool({
|
|
4635
4635
|
description: desc("get_test_cards"),
|
|
@@ -4643,7 +4643,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4643
4643
|
}
|
|
4644
4644
|
}),
|
|
4645
4645
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4646
|
-
// v0.7
|
|
4646
|
+
// v0.7, Customer + Card extensions
|
|
4647
4647
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4648
4648
|
get_customer: ai.tool({
|
|
4649
4649
|
description: desc("get_customer"),
|
|
@@ -4697,7 +4697,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4697
4697
|
}
|
|
4698
4698
|
}),
|
|
4699
4699
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4700
|
-
// v0.7
|
|
4700
|
+
// v0.7, Subscription / Plan / Refund / Preference extensions
|
|
4701
4701
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4702
4702
|
get_subscription_plan: ai.tool({
|
|
4703
4703
|
description: desc("get_subscription_plan"),
|
|
@@ -4772,7 +4772,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4772
4772
|
}
|
|
4773
4773
|
}),
|
|
4774
4774
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4775
|
-
// v0.7
|
|
4775
|
+
// v0.7, Merchant Orders
|
|
4776
4776
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4777
4777
|
get_merchant_order: ai.tool({
|
|
4778
4778
|
description: desc("get_merchant_order"),
|
|
@@ -4820,7 +4820,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4820
4820
|
}
|
|
4821
4821
|
}),
|
|
4822
4822
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4823
|
-
// v0.7
|
|
4823
|
+
// v0.7, Stores + POS CRUD completion
|
|
4824
4824
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4825
4825
|
get_store: ai.tool({
|
|
4826
4826
|
description: desc("get_store"),
|
|
@@ -4891,7 +4891,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4891
4891
|
}
|
|
4892
4892
|
}),
|
|
4893
4893
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4894
|
-
// v0.7
|
|
4894
|
+
// v0.7, Bank Accounts
|
|
4895
4895
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4896
4896
|
list_bank_accounts: ai.tool({
|
|
4897
4897
|
description: desc("list_bank_accounts"),
|
|
@@ -4916,7 +4916,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4916
4916
|
}
|
|
4917
4917
|
}),
|
|
4918
4918
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4919
|
-
// v0.7
|
|
4919
|
+
// v0.7, Point Devices físicos
|
|
4920
4920
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4921
4921
|
list_point_devices: ai.tool({
|
|
4922
4922
|
description: desc("list_point_devices"),
|
|
@@ -4986,7 +4986,7 @@ function buildAllTools(client, options, desc) {
|
|
|
4986
4986
|
}
|
|
4987
4987
|
}),
|
|
4988
4988
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4989
|
-
// v0.7
|
|
4989
|
+
// v0.7, Pure helpers
|
|
4990
4990
|
// ─────────────────────────────────────────────────────────────────────────
|
|
4991
4991
|
compute_marketplace_fee: ai.tool({
|
|
4992
4992
|
description: desc("compute_marketplace_fee"),
|
|
@@ -5033,7 +5033,7 @@ function buildAllTools(client, options, desc) {
|
|
|
5033
5033
|
description: desc("explain_payment_status"),
|
|
5034
5034
|
inputSchema: zod.z.object({
|
|
5035
5035
|
payment_id: zod.z.string().min(1).optional().describe(
|
|
5036
|
-
"If provided, fetches the Payment first. RECOMMENDED PATH for agents
|
|
5036
|
+
"If provided, fetches the Payment first. RECOMMENDED PATH for agents, pass the id and let the lib fetch."
|
|
5037
5037
|
),
|
|
5038
5038
|
// Loose object kept for advanced manual callers that have already
|
|
5039
5039
|
// fetched a Payment from another path. LLMs should prefer payment_id.
|
|
@@ -5048,7 +5048,7 @@ function buildAllTools(client, options, desc) {
|
|
|
5048
5048
|
payment_method_id: zod.z.string().optional(),
|
|
5049
5049
|
transaction_amount: zod.z.number().optional()
|
|
5050
5050
|
}).passthrough().optional().describe(
|
|
5051
|
-
"ADVANCED
|
|
5051
|
+
"ADVANCED, pass a pre-fetched Payment object to skip the network call. LLMs: use payment_id instead."
|
|
5052
5052
|
)
|
|
5053
5053
|
}),
|
|
5054
5054
|
execute: async ({ payment_id, payment }) => {
|
|
@@ -5073,7 +5073,7 @@ function buildAllTools(client, options, desc) {
|
|
|
5073
5073
|
}
|
|
5074
5074
|
}),
|
|
5075
5075
|
// ─────────────────────────────────────────────────────────────────────
|
|
5076
|
-
// v0.10
|
|
5076
|
+
// v0.10, AR issuer promos (pure)
|
|
5077
5077
|
// ─────────────────────────────────────────────────────────────────────
|
|
5078
5078
|
find_applicable_promos: ai.tool({
|
|
5079
5079
|
description: desc("find_applicable_promos"),
|
|
@@ -5107,7 +5107,7 @@ function buildAllTools(client, options, desc) {
|
|
|
5107
5107
|
}
|
|
5108
5108
|
}),
|
|
5109
5109
|
// ─────────────────────────────────────────────────────────────────────
|
|
5110
|
-
// v0.10
|
|
5110
|
+
// v0.10, 3DS challenge resolution (poll-and-confirm)
|
|
5111
5111
|
// ─────────────────────────────────────────────────────────────────────
|
|
5112
5112
|
confirm_3ds_challenge: ai.tool({
|
|
5113
5113
|
description: desc("confirm_3ds_challenge"),
|
|
@@ -5124,7 +5124,7 @@ function buildAllTools(client, options, desc) {
|
|
|
5124
5124
|
}
|
|
5125
5125
|
}),
|
|
5126
5126
|
// ─────────────────────────────────────────────────────────────────────
|
|
5127
|
-
// v0.10
|
|
5127
|
+
// v0.10, Auto-paginate variants (collect-all)
|
|
5128
5128
|
// ─────────────────────────────────────────────────────────────────────
|
|
5129
5129
|
search_payments_all: ai.tool({
|
|
5130
5130
|
description: desc("search_payments_all"),
|
|
@@ -5168,7 +5168,7 @@ function buildAllTools(client, options, desc) {
|
|
|
5168
5168
|
}
|
|
5169
5169
|
}),
|
|
5170
5170
|
// ─────────────────────────────────────────────────────────────────────
|
|
5171
|
-
// v0.11
|
|
5171
|
+
// v0.11, TaxID validation cross-LATAM (pure)
|
|
5172
5172
|
// ─────────────────────────────────────────────────────────────────────
|
|
5173
5173
|
validate_tax_id: ai.tool({
|
|
5174
5174
|
description: desc("validate_tax_id"),
|