Skip to main content

Overview

The MercadoPago integration allows your AI assistant to generate payment links and process transactions directly within WhatsApp conversations. Customers can complete purchases without leaving the chat, creating a seamless buying experience.
This is a new feature highlighted on our landing page: “Nuevo: Integración con MercadoPago”

What You Can Do

With the MercadoPago integration, RespondeIA enables:
  • In-chat payments: AI generates payment links automatically during sales conversations
  • Payment status tracking: Real-time notifications when payments are completed
  • Automatic receipts: Customers receive confirmation messages with transaction details
  • Subscription management: Handle recurring payments for subscription services
  • Refund processing: Process refunds directly from the dashboard

Prerequisites

Before connecting MercadoPago:
1

MercadoPago Account

You need an active MercadoPago business account. Create one at mercadopago.com if you don’t have one.
2

API Credentials

Obtain your MercadoPago API credentials:
  • Access Token (for production)
  • Public Key (for client-side operations)
You can find these in your MercadoPago dashboard under CredentialsProduction credentials.
3

RespondeIA Plan

MercadoPago integration is available on:
  • Pro plan: 59/month(billedmonthly)or59/month (billed monthly) or 47/month (billed yearly)
  • Agencia plan: 149/month(billedmonthly)or149/month (billed monthly) or 119/month (billed yearly)
Not available on the Básico plan.

Setup

Connect MercadoPago

1

Access Integration Settings

Navigate to SettingsIntegrationsPayments in your RespondeIA dashboard.
2

Select MercadoPago

Click Connect MercadoPago and enter your credentials:
Credentials Required
{
  "access_token": "APP_USR-1234567890-123456-abcdefghijklmnop",
  "public_key": "APP_USR-abcd1234-5678-90ef-ghij-klmnopqrstuv"
}
Keep your Access Token secure. Never commit it to version control or share it publicly.
3

Configure Webhooks

RespondeIA automatically configures webhooks to receive payment notifications:
https://api.respondeia.com/webhooks/mercadopago/{your-account-id}
This webhook receives:
  • payment.created: New payment initiated
  • payment.approved: Payment successful
  • payment.rejected: Payment failed
  • payment.refunded: Refund processed
4

Test Mode

Before going live, test the integration:
  1. Enable Test Mode in integration settings
  2. Use MercadoPago test cards to simulate payments
  3. Verify webhooks are received correctly
  4. Check that AI sends confirmation messages
Test card: 5031 7557 3453 0604, CVV: 123, Expiry: any future date
5

Go Live

Once testing is complete:
  1. Disable Test Mode
  2. Verify production credentials are entered
  3. Send a real transaction to confirm everything works

How It Works

Automatic Payment Flow

When a customer wants to make a purchase:

AI-Powered Sales

The AI assistant automatically:
  1. Detects purchase intent from customer messages
  2. Confirms details (product, quantity, price)
  3. Generates payment link with MercadoPago
  4. Sends link in the conversation
  5. Tracks payment status in real-time
  6. Confirms completion once payment is approved

API Integration

For custom implementations, use the RespondeIA API to create payments:
interface CreatePaymentParams {
  customerId: string;
  amount: number;
  description: string;
  items?: Array<{
    title: string;
    quantity: number;
    unitPrice: number;
  }>;
}

async function createPayment(params: CreatePaymentParams) {
  const response = await fetch('https://api.respondeia.com/v1/payments/create', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      provider: 'mercadopago',
      customer_id: params.customerId,
      amount: params.amount,
      currency: 'ARS', // or 'BRL', 'MXN', etc.
      description: params.description,
      items: params.items,
      notification_url: 'https://api.respondeia.com/webhooks/mercadopago/your-id',
      auto_return: 'approved'
    })
  });

  if (!response.ok) {
    throw new Error('Failed to create payment');
  }

  const { paymentLink, paymentId } = await response.json();
  return { paymentLink, paymentId };
}

// Example usage
const payment = await createPayment({
  customerId: 'wa:5491123456789',
  amount: 5900, // $59.00 in cents
  description: 'Plan Pro - Mensual',
  items: [
    {
      title: 'Plan Pro',
      quantity: 1,
      unitPrice: 5900
    }
  ]
});

// Send payment link via WhatsApp
await sendWhatsAppMessage(
  'wa:5491123456789',
  `Tu enlace de pago está listo: ${payment.paymentLink}`
);

Payment Tracking

Real-time Status Updates

Track payment status in real-time using webhooks:
Webhook Handler Example
interface PaymentWebhook {
  event: 'payment.created' | 'payment.approved' | 'payment.rejected' | 'payment.refunded';
  paymentId: string;
  customerId: string;
  amount: number;
  status: string;
  timestamp: number;
}

// RespondeIA handles webhooks automatically
// This shows the data structure you receive
function handlePaymentWebhook(webhook: PaymentWebhook) {
  switch (webhook.event) {
    case 'payment.approved':
      // AI automatically sends confirmation to customer
      console.log(`Payment ${webhook.paymentId} approved`);
      // Your custom logic here (e.g., provision service)
      break;
      
    case 'payment.rejected':
      // AI notifies customer of failed payment
      console.log(`Payment ${webhook.paymentId} rejected`);
      break;
      
    case 'payment.refunded':
      // Handle refund logic
      console.log(`Payment ${webhook.paymentId} refunded`);
      break;
  }
}

Query Payment Status

Check payment status programmatically:
async function getPaymentStatus(paymentId: string) {
  const response = await fetch(
    `https://api.respondeia.com/v1/payments/${paymentId}`,
    {
      headers: {
        'Authorization': `Bearer ${token}`
      }
    }
  );

  const payment = await response.json();
  
  return {
    status: payment.status, // 'pending', 'approved', 'rejected', 'refunded'
    amount: payment.amount,
    paidAt: payment.paid_at,
    customerId: payment.customer_id
  };
}

Supported Payment Methods

MercadoPago supports multiple payment methods across Latin America:

Credit Cards

Visa, Mastercard, American Express, Diners Club

Debit Cards

All major debit cards in supported countries

Cash Payments

Rapipago, Pago Fácil, OXXO (Mexico), Boleto (Brazil)

Bank Transfers

PIX (Brazil), PSE (Colombia), Direct bank transfers

Pricing Plans Integration

The AI can automatically offer pricing plans based on the source code at /home/daytona/workspace/source/modules/prices/services/get-plans.ts:8-39:
Plan Offerings
// RespondeIA automatically reads your pricing configuration
const plans = [
  {
    id: "basico",
    name: "Básico",
    priceMonth: 29,
    priceYear: 23,
    features: ["1 número WhatsApp", "Hasta 500 mensajes", "Respuestas automáticas IA"]
  },
  {
    id: "pro",
    name: "Pro",
    priceMonth: 59,
    priceYear: 47,
    features: ["1 número WhatsApp", "Mensajes ilimitados", "IA personalizada avanzada", "CRM de contactos"]
  },
  {
    id: "agencia",
    name: "Agencia",
    priceMonth: 149,
    priceYear: 119,
    features: ["Hasta 5 números", "Mensajes ilimitados", "Panel multi-cliente", "White-label"]
  }
];
The AI will present these plans when customers inquire about pricing and generate appropriate payment links.

Refunds

Process Refunds

Refund payments from the dashboard or API:
async function refundPayment(paymentId: string, amount?: number) {
  const response = await fetch(
    `https://api.respondeia.com/v1/payments/${paymentId}/refund`,
    {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        amount: amount // Optional: partial refund amount
      })
    }
  );

  if (!response.ok) {
    throw new Error('Refund failed');
  }

  return response.json();
}
Full refunds are processed within 10 business days. Partial refunds may take up to 30 days depending on the payment method.

Security

PCI Compliance

RespondeIA never stores credit card information. All payment data is handled by MercadoPago’s PCI-compliant infrastructure.

Transaction Security

  • Encrypted communication: All API calls use TLS 1.3
  • Webhook verification: Signatures are validated to prevent spoofing
  • Access control: Only authorized users can process refunds
  • Audit logs: All payment actions are logged for compliance

Fraud Prevention

MercadoPago provides built-in fraud detection:
  • Device fingerprinting
  • Behavioral analysis
  • Transaction velocity checks
  • Geographic validation

Troubleshooting

1

Check Integration Status

Verify MercadoPago is connected: SettingsIntegrationsPayments
2

Verify Credentials

Ensure Access Token and Public Key are correct and not expired
3

Check Plan Limits

Confirm your RespondeIA plan includes payment processing

Webhook Not Received

  1. Check webhook URL is correctly configured in MercadoPago dashboard
  2. Verify firewall allows POST requests from MercadoPago IPs
  3. Review webhook logs in RespondeIA dashboard

Payment Stuck in Pending

Some payment methods (cash, bank transfer) take time to process. PIX is instant, but Boleto can take 1-3 business days.

Analytics

Track payment performance in your dashboard:
  • Total revenue: Sum of all approved payments
  • Conversion rate: Payment links sent vs. completed
  • Average transaction value: Mean payment amount
  • Payment method breakdown: Distribution by payment type
  • Failed payment reasons: Why transactions are rejected

Best Practices

  1. Clear pricing: Train AI to communicate prices clearly before generating links
  2. Fast follow-up: AI should send payment links immediately when requested
  3. Payment reminders: Set up automatic reminders for pending payments
  4. Localized currency: Use the customer’s local currency when possible
  5. Transparent fees: Communicate any transaction fees upfront
  6. Receipt confirmation: Always send receipt after successful payment

Supported Countries

MercadoPago is available in:
  • Argentina (ARS)
  • Brazil (BRL)
  • Chile (CLP)
  • Colombia (COP)
  • Mexico (MXN)
  • Peru (PEN)
  • Uruguay (UYU)
Currency is automatically detected based on your MercadoPago account country.

Next Steps

Pricing Configuration

Set up your pricing plans and products

AI Training

Train your AI to handle sales conversations

API Reference

Full payment API documentation

Analytics

Track revenue and conversion metrics

Build docs developers (and LLMs) love