> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jelou.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Tutorial: Implementing your first payment from WhatsApp

> Implement your first payment from WhatsApp step by step with Mercado Pago.

In this guide you will implement [real payments](https://docs.jelou.ai/guides/integraciones/pagos/introduccion.md) within a conversational app on WhatsApp using **Mercado Pago**.

> [!NOTE]
>
> **Prerequisites:**
>
> * A flow in Brain Studio ready (for example, an AI Agent handling a sale).
> * A Mercado Pago account with test and production credentials.

We will use a **tour tickets** app: the user picks a tour, date, quantity, and email; then you charge with Mercado Pago in the same flow.

This tutorial has three parts:

1. **Implementation in test mode (Development)**
2. **Testing on WhatsApp**
3. **Go to production**

***

## 1. Implementation in test mode (Development)

### Video 1: Installation and configuration in Brain Studio

[Video 1 – Mercado Pago installation + node setup in test mode](https://www.youtube.com/embed/UsZsRWtk55c)

Video 1 – Mercado Pago installation + node setup in test mode

> [!NOTE]
>
> The video may show an older UI. For the current installation flow and node fields, use [Connect in Brain Studio](https://docs.jelou.ai/guides/integraciones/pagos/proveedores/mercado-pago/conectar-en-brain-studio.md) and [Usage and configuration](https://docs.jelou.ai/guides/integraciones/pagos/proveedores/mercado-pago/uso-y-configuracion.md).

***

### Install the integration and add the node

**1. Get test credentials**

Copy the **Access Token** from **Test credentials** in Mercado Pago.

Follow [Obtaining credentials](https://docs.jelou.ai/guides/integraciones/pagos/proveedores/mercado-pago/obtener-credenciales.md) if this is your first time.

![Mercado Pago dashboard showing Your integrations and Test credentials](https://mintcdn.com/jelouai/3D3ye1Wdwh66cTgk/assets/images/integraciones/pagos/dashboard-mercado-pago-tus-integraciones.png?fit=max\&auto=format\&n=3D3ye1Wdwh66cTgk\&q=85\&s=f0401c8cb1e647a9617d43c757d5dc08)

Your integrations in Mercado Pago

**2. Connect Mercado Pago in Brain Studio**

Install the integration with **test** credentials following [Connect in Brain Studio](https://docs.jelou.ai/guides/integraciones/pagos/proveedores/mercado-pago/conectar-en-brain-studio.md).

You can start from **Marketplace**, **Jelou Agent**, the **Payments** node in Canvas, or a **template**. The shared modal has four steps: environment, API Key, VAT/currency, and confirmation.

![Connect Mercado Pago modal with API Key field](https://mintcdn.com/jelouai/3D3ye1Wdwh66cTgk/assets/images/integraciones/pagos/mercado-pago-conectar-credenciales.png?fit=max\&auto=format\&n=3D3ye1Wdwh66cTgk\&q=85\&s=666804fa59303677692d47610839259d)

Modal step 2: enter your Mercado Pago API Key

**3. Add the node to your flow**

Add **Mercado Pago** from the **Payments** node in Canvas and connect it after the user confirms the purchase.

Step-by-step detail in [Usage and configuration — Add the node to Canvas](https://docs.jelou.ai/guides/integraciones/pagos/proveedores/mercado-pago/uso-y-configuracion.md#add-the-node-to-canvas).

***

### Configure the node (tours example)

Complete the minimum for the tours case. Full field reference in [Usage and configuration](https://docs.jelou.ai/guides/integraciones/pagos/proveedores/mercado-pago/uso-y-configuracion.md).

![Mercado Pago node in Canvas with Payment data panel and node outputs visible](https://mintcdn.com/jelouai/3D3ye1Wdwh66cTgk/assets/images/integraciones/pagos/mercado-pago-nodo-datos-del-pago.png?fit=max\&auto=format\&n=3D3ye1Wdwh66cTgk\&q=85\&s=0822dbc19dc6a7cde416f531d7e35f1d)

Mercado Pago node with Payment data tab and outputs on Canvas

| Field | Example value (tours) |
| - | - |
| Payment reason | `Tour Valpo Walk - 2 ticket(s)` or a flow variable |
| Taxable amount | Net charge amount (e.g. `20168`) |
| Tax-free amount | `0` if not applicable |
| Buyer email | Test user for the country (see below) |
| Currency | Match credentials (e.g. `CLP`) |
| VAT percentage | Match installation (e.g. `19`) |
| Save response | `checkout_response` (optional, for the code example) |

> [!NOTE]
>
> In **Development**, the node environment reflects **test** credentials. **Currency** and **VAT** must match what you set when installing the integration.

***

### Test emails by country (test mode)

In **Development**, Mercado Pago only processes payments if **Buyer email** belongs to a *test user* from the **same country** as your credentials.

> [accordion] 🇨🇱 Chile
>
> ```txt theme={null}
> test_user_230383680042455079@testuser.com
> ```

> [accordion] 🇵🇪 Peru
>
> ```txt theme={null}
> test_user_6344464757279593247@testuser.com
> ```

> [accordion] 🇨🇴 Colombia
>
> ```txt theme={null}
> test_user_7600640374023229585@testuser.com
> ```

> [accordion] 🇲🇽 Mexico
>
> ```txt theme={null}
> test_user_538195043292703001@testuser.com
> ```

> [accordion] 🇧🇷 Brazil
>
> ```txt theme={null}
> test_user_6254528388464257378@testuser.com
> ```

> [accordion] 🇦🇷 Argentina
>
> ```txt theme={null}
> test_user_1511189314898568640@testuser.com
> ```

> [accordion] 🇺🇾 Uruguay
>
> ```txt theme={null}
> test_user_1178397850300963040@testuser.com
> ```

> [!TIP]
>
> If payment fails for no clear reason in Development, check the test email first.

***

### Connect the node outputs

The node exposes five outputs. Connect them based on the result you want to handle.

| Output | Meaning | Connect |
| - | - | - |
| **Payment message sent** | Button sent; no payment result yet | Post-send support AI Agent (optional) |
| **Successful payment** | Transaction approved | Code → Text (receipt) |
| **Pending payment** | In process or pending settlement | Informative text |
| **Failed payment** | Rejected or not completed | Text + retry |
| **Error** | Technical or provider error | Error handling |

Detailed descriptions and a reference prompt for **Payment message sent** in [Usage and configuration — Node outputs](https://docs.jelou.ai/guides/integraciones/pagos/proveedores/mercado-pago/uso-y-configuracion.md#node-outputs).

![WhatsApp conversation with Mercado Pago button and support agent answering a question](https://mintcdn.com/jelouai/R4qL5d7Hj6fxJl87/assets/images/integraciones/pagos/soporte-post-cta-ejemplo-whatsapp.png?fit=max\&auto=format\&n=R4qL5d7Hj6fxJl87\&q=85\&s=696bc6187610f051c697263b3a3309ba)

Post-send payment button support example on WhatsApp

#### Example: normalize **Successful payment**

If you used **Save response** = `checkout_response`, map the minimum to Context:

> [accordion] Normalization code (Successful payment)
>
> ```javascript normalize-payment.js theme={null}
> const r = $memory.getJson('checkout_response')
> if (!r) throw new Error('checkout_response does not exist in memory.')
>
> const pl = r?.paymentLinkResponse
> if (!pl) throw new Error('checkout_response.paymentLinkResponse does not exist (check memory).')
>
> const gw = pl.gateway_response || {}
> const md = pl.metadata || gw.metadata || {}
>
> const email = String(gw?.payer?.email || md.email || '')
>
> $context.set('pay_operation_id', String(gw.id || ''))
> $context.set('pay_amount', Number(pl.amount || 0))
> $context.set('pay_currency', String(pl.currency || 'CLP'))
> $context.set('pay_email', email)
> $context.set('pay_status', String(gw.status || 'approved'))
> $context.set(
>   'pay_receipt',
>   `Done ✅ Payment approved.\n\nMercado Pago operation #: ${String(gw.id || '')}`
> )
> ```

In a **Text** node connected to **Successful payment**, display:

```txt theme={null}
{{$context.pay_receipt}}
```

![Successful payment output connected to Code node then Text node](https://mintcdn.com/jelouai/3D3ye1Wdwh66cTgk/assets/images/integraciones/pagos/pago-exitoso-codigo-texto-flujo.png?fit=max\&auto=format\&n=3D3ye1Wdwh66cTgk\&q=85\&s=682952ffc06accc634d1e0e1b87b60c4)

Successful payment → Code → Text flow

***

## 2. Testing on WhatsApp

Validate the end-to-end flow from WhatsApp; checkout opens in an **embedded WebView**.

> [!NOTE]
>
> Testing must be done from WhatsApp, not only from the Canvas preview.

### Video 2: Testing from WhatsApp

<video controls src="https://mintcdn.com/jelouai/ULgwEHLikEppkuDq/assets/videos/integraciones/pagos/paso-2-prueba-whatsapp.mp4?fit=max&auto=format&n=ULgwEHLikEppkuDq&q=85&s=aaa2ff0298feeb0b230d88d45cb787d6">
  Your browser does not support video playback.
</video>

Video 2 – Mobile test with test cards

**1. Open Test in Canvas**

In the top-right corner, click **Test**.

![Test project panel with WhatsApp test option](https://mintcdn.com/jelouai/R4qL5d7Hj6fxJl87/assets/images/integraciones/pagos/probar-proyecto-whatsapp.png?fit=max\&auto=format\&n=R4qL5d7Hj6fxJl87\&q=85\&s=c308cc290d959ee741c5aa76281af476)

Test project panel

**2. Start a test conversation**

Enter your number, send the first message, and complete the flow until the payment button.

**3. Complete payment in the WebView**

Open the payment button, use a test card for the corresponding country, and verify which **output** the flow continues through.

> [!NOTE]
>
> In some countries, the Mercado Pago app may try to open from the WebView. In Development, close it and return to WhatsApp to use the test card.

***

### Test cards by country

Mercado Pago publishes test cards by country to simulate approval or rejection:

> [accordion] 🇨🇱 Chile
>
> [Test cards (Chile)](https://www.mercadopago.cl/developers/es/docs/checkout-bricks/integration-test/test-cards)

> [accordion] 🇵🇪 Peru
>
> [Test cards (Peru)](https://www.mercadopago.com.pe/developers/es/docs/your-integrations/test/cards)

> [accordion] 🇨🇴 Colombia
>
> [Test cards (Colombia)](https://www.mercadopago.com.co/developers/es/docs/your-integrations/test/cards)

> [accordion] 🇲🇽 Mexico
>
> [Test cards (Mexico)](https://www.mercadopago.com.mx/developers/es/docs/shopify/additional-content/your-integrations/test/cards)

> [accordion] 🇧🇷 Brazil
>
> [Test cards (Brazil)](https://www.mercadopago.com.br/developers/es/docs/checkout-api-payments/additional-content/your-integrations/test/cards)

> [accordion] 🇦🇷 Argentina
>
> [Test cards (Argentina)](https://www.mercadopago.com.ar/developers/es/docs/subscriptions/additional-content/your-integrations/test/cards)

> [accordion] 🇺🇾 Uruguay
>
> [Test cards (Uruguay)](https://www.mercadopago.com.uy/developers/es/docs/subscriptions/additional-content/your-integrations/test/cards)

> [!TIP]
>
> Test at least one **approved** and one **rejected** case to validate **Successful payment** and **Failed payment**.

***

## 3. Go to production

Going to production means production credentials and the buyer's real data. The WhatsApp experience stays the same.

### Video 3: Production setup + real payment

[Video 3 – Go to production and real payment](https://www.youtube.com/embed/1sSVuPfs4rI)

Video 3 – Go to production and real payment

> [!NOTE]
>
> For the current **Go to production** flow, follow [Connect in Brain Studio](https://docs.jelou.ai/guides/integraciones/pagos/proveedores/mercado-pago/conectar-en-brain-studio.md#go-to-production).

**1. Get production Access Token**

In Mercado Pago, copy the **Access Token** from **Production credentials**.

**2. Go to production**

Start **Go to production** from the node's **Advanced** tab in Canvas or from **Mercado Pago** in Marketplace.

Enter the production Access Token and confirm **VAT** and **currency**.

**3. Use real data in the node**

Replace the test user in **Buyer email** with the real email captured in your flow.

Verify **Currency** and **VAT percentage** remain consistent with the production installation.

**4. Run a low-amount real payment test**

Complete a real payment and confirm **Successful payment**, the operation number, and the record in your Mercado Pago dashboard.

> [!WARNING]
>
> Production transactions consume Brain Studio credits per attempt, in addition to provider fees.

***

## Next steps

> [card] [Usage and configuration](https://docs.jelou.ai/guides/integraciones/pagos/proveedores/mercado-pago/uso-y-configuracion.md)
>
> Complete sidepanel and node output reference.

> [card] [Coverage and pricing](https://docs.jelou.ai/guides/integraciones/pagos/proveedores/mercado-pago/cobertura-y-precios.md)
>
> Countries, payment methods, and reference fees.

> [card] [Other providers](https://docs.jelou.ai/guides/integraciones/pagos/proveedores.md)
>
> Provider catalog by country.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.