Skip to main content
In this guide you will implement real payments within a conversational app deployed on WhatsApp, using Mercado Pago.
Prerequisites:
  • Have a flow in Brain Studio ready (for example, an AI Agent that handles a sales process).
  • Have a Mercado Pago account (to obtain test and production credentials).
We will use as an example an app that sells tour tickets: the user chooses the tour, date, number of tickets, and provides their email. Now we are going to enable charges with Mercado Pago within the same flow. This tutorial is divided into three parts:
  1. Implementation in test mode (DEV)
  2. Testing on WhatsApp
  3. Going to production (PROD)

1. Implementation in test mode (DEV)

Video 1: Installation and configuration in Brain Studio

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


Initial setup

1

Copy your test Access Token

First time? Check the step-by-step guide: Obtaining Mercado Pago credentials.
Open your Mercado Pago account and go to Your integrations.
Mercado Pago Dashboard showing Your integrations, Jelou application selector, and the Production credentials and Test credentials cards

Your integrations in Mercado Pago: choose your application and access Production Credentials or Test Credentials

  • Go to Test credentials
  • Copy the Access Token
You will use this token to install Mercado Pago in Brain Studio.
Token ready to paste into Brain Studio.
2

Install Mercado Pago from Marketplace

In Brain Studio:
  • Go to Marketplace
  • Search for Mercado Pago
  • Click Connect
  • Paste your test Access Token
  • Click Install
API Credentials modal in Brain Studio requesting the Access Token to install Mercado Pago

Installation modal: paste your Mercado Pago Access Token and confirm

Once installed, you will see Mercado Pago available in the Marketplace folder in the Canvas side panel.
Mercado Pago visible in Marketplace.
3

Drag and connect the node to the Canvas

Connect the payment flow right after the user confirms their purchase or reservation.
  • Inside Brain, find Mercado Pago in the Marketplace folder in the side panel, and drag it to the canvas
  • Connect it after the step where the user confirms their purchase or reservation.
Next, configure the node inputs. The three required fields are: payment reason, taxable amount, and buyer email.

Configure Inputs: What is each field?

Define three fundamental things at the time of the charge:
  1. What you are charging for (reason + amount + currency)
  2. Who you are charging (buyer email)
  3. Under what rules (environment, taxes, expiration, metadata)
Think of this section as the structural definition of the payment: what Mercado Pago needs to create the transaction correctly.
Input configuration panel

Input configuration panel

The exact names may vary slightly depending on your template, but the pattern is always the same: amount + currency + taxes (if applicable) + buyer email + optional metadata.

What you must complete

Before going into detail, make sure you have these three elements clear:
  • A readable payment reason (e.g., β€œValpo Walk Tour - 2 ticket(s)”)
  • A correct amount (net if you work with taxes)
  • A valid buyer email (in DEV it must be a test user)
If these three are well defined, the rest is configuration.

Summary of node inputs

Before going into detail, there are two key ideas:
  1. This node creates the charge (with amount, currency, taxes, reason, and email).
  2. This node returns a response (JSON) that you can reuse later (for example, to display a receipt or save payment IDs).

Save result as

At the top of the node you will see Save result as. There you define the name with which Brain Studio will save the complete tool response as a JSON in Memory.
  • In this tutorial we use: checkout_response
  • You can then read it from a Code node with something like:
    • const r = $memory.getJson('checkout_response')
Memory vs Context:
  • Memory persists between conversations (useful for querying the payment status later).
  • Context is only available during the current conversation.
For more details, see the full guide.

Detail of each input

Below is a practical guide on what to put in each field (in the same order you will see in the node).

Payment type (default: payment)

Leave it as payment unless your implementation has another type enabled/defined. In a generic tutorial, payment is correct.

Environment (DEV / PROD)

  • DEV: controlled testing with test credentials.
  • PROD: real charges with production credentials.
When you move to PROD, verify that your flow already handles the outputs well (success, pending, failed, errors) to avoid leaving the user β€œhanging”.

Button expiration (minutes)

Typical example: 20. This avoids out-of-context payments (β€œI opened it 3 hours later”) and helps the conversational flow remain coherent.

Currency

Select the actual charge currency according to country/operation. Examples: CLP, MXN, COP, PEN, etc.

Payment reason

This is the text that lets you easily identify the charge. Practical recommendation:
  • Use a readable variable (e.g., mp_payment_description)
  • Or clear text such as: Valpo Walk Tour - 2 ticket(s)
The more β€œhuman” the reason, the less friction for support: the user and the merchant understand each other faster when something goes wrong.

Taxable amount + Tax-free amount + VAT

Here you define the structure of the amount.
  • Taxable amount: the part that does pay VAT (normally the net).
  • Tax-free amount: the exempt part (if it does not exist in your case, leave it as 0).
  • VAT percentage: for example 19.
Typical example (sale with VAT):
  • Taxable amount = net (e.g., 20168)
  • Tax-free amount = 0
  • VAT = 19
If your case does NOT use taxes:
  • Use 0 as appropriate in your implementation and maintain consistency with your calculation (the important thing is not to β€œinvent” VAT if it does not apply).

Payment metadata

This field is optional but useful; it lets you attach context for traceability. Recommendation: minimalist and intentional. Only save what you would actually use for:
  • payment reconciliation
  • debugging
  • or user support
Useful examples:
  • order_id
  • order_reference_id (if your backend uses it)
  • tour_slug
  • user_id

Buyer email (very important in DEV)

In DEV mode it is extremely important that the buyer is a test user, as required by Mercado Pago. In this tutorial we assume:
  • buyer email = payer email (they are the same)
In DEV use the test user email for the corresponding country (the list is below). In PROD, use the user’s real email.
If you are in DEV and you put a real email (not a test user), the payment will most likely fail or you will not be able to complete it.

Customize payment button text (optional)

By default it comes as No. If you change it to Yes, the node enables extra fields to customize the message the user will see before opening the checkout. This is useful when you want the CTA to feel more contextual (and less generic), without changing the flow or the checkout itself.
boolean
default:"false"
If you select Yes, additional fields are enabled to customize the message that accompanies the payment button.Fields enabled when activated:
  • Header (required)
  • Body (required)
  • Footer (required)
When this option is active, you can completely modify the message the user will see before opening the checkout.
Example of a message with customized text and Mercado Pago payment button in WhatsApp

Example of message with customized payment button in WhatsApp


Test emails by country (test mode / DEV)

In DEV, Mercado Pago only processes payments if the Buyer email belongs to a test user from the corresponding country. Copy the one you need and paste it directly into the Buyer email field of the node.
Always use the test user from the same country as the credentials you are testing.
If you are in DEV and the payment fails for no apparent reason, first check that the email is a valid test user.

Node configuration: Outputs

The node exposes different outputs depending on the payment status.
Jelou Pay node flow showing outputs: Successful Payment, Pending Payment, Failed Payment, Error Code, Error Http, and Correct CTA delivery connected to Text, Button, and support nodes

Node output configuration: Correct CTA delivery, Successful Payment, Pending, Failed, Error Code, Error Http


Quick output map

  • Correct CTA delivery β†’ The button was sent to the user (no payment result yet).
  • Successful Payment β†’ The payment was approved.
  • Pending Payment β†’ The payment was initiated but not yet credited.
  • Failed Payment β†’ The payment was rejected or not completed.
  • Error Code / Error Http β†’ Technical error from the flow or from the request.
CTA means the payment button was sent successfully. The other outputs represent the actual result of the transaction.

Outputs and what to connect


Correct CTA delivery (Success)

This means the payment button was sent to the user, but they have not yet taken an action inside the Webview that determines the transaction status (Approved, Rejected, Pending, Error). Recommendation: connect a post-CTA support AI Agent. This way, when the user receives the payment button, they will have someone on the other side: an agent with the appropriate context who can answer frequent questions, reassure them, and help complete the payment without restarting the sale.
WhatsApp conversation: agent offers to proceed with payment, user accepts, agent sends Mercado Pago button and support message; user asks if they accept credit cards and agent responds kindly

Payment button, proactive support message, and response to a question (credit card)

Example prompt

The prompt is designed for an AI Agent on the Correct CTA delivery output, with the Gmail tool (Marketplace) connected to send support tickets by email when the user requests it. You can copy it and adjust the tone or rules to your brand.

Successful Payment

The payment was approved. Recommendation:
  1. Connect a Code node to normalize and save the minimum in Context.
  2. Then a Text node that displays the short receipt (receipt line).

Example: Normalization code

This node reads checkout_response from memory and saves to context only what is reusable.
normalize-payment.js
If you use this code, you can print the message to the user in a Text output node by pasting this expression:
Diagram: Successful Payment output of the Jelou Pay node connected to the Code node, and that to the Text node with pay_receipt

Successful Payment flow β†’ Code (normalization) β†’ Text (pay_receipt)


Pending Payment

The payment is pending. Recommendation:
  • Connect a Text node with a brief explanation.
  • Then route to whatever flow comes next (wait, follow-up, support, etc.).
Keep the message simple: the goal is not to confuse and not to push a second payment without context.

Failed Payment

The payment failed (rejection / not credited). Recommendation:
  • Connect a clear and brief Text node.
  • Offer a retry or method change.
  • If the user continues to have issues, route to support.

Error Code / Error Http

Technical errors from your flow (code) or from the HTTP request. Recommendation:
  • Connect an error handling block.
  • Show a brief message + retry option + support.
  • Avoid exposing technical details to the end user.

2. Testing on WhatsApp

Once you have the node configured (inputs + connected outputs), it is time to test the complete flow from WhatsApp.
Important: The payment experience opens in a WebView inside WhatsApp. Therefore, to validate the payment end-to-end, the test must be done from WhatsApp (not from the Canvas message preview).

Video 2: Testing from WhatsApp (DEV)

Video 2 – Testing from a mobile phone with test cards (DEV)


How to start the test from WhatsApp

In Brain Studio you can start a real WhatsApp test in seconds.
1

Open the Test panel

In the upper right corner of the Canvas, click Test.
Test project panel in Brain Studio with the Test from WhatsApp option and phone number entry

Test project panel: start a test from WhatsApp by entering your number

If you do not yet have a connected/enabled WhatsApp channel, this is the fastest way to validate the payment flow.
2

Enter your number and send the first message

  • Select your prefix (e.g., CL +56)
  • Enter your number
  • Send the first message to begin the test conversation
From that point, the flow runs as if it were a real user.
3

Complete the payment in the WebView

When the bot sends you the Proceed to payment button, open it from WhatsApp.There you will see the checkout WebView and you can test test cards, statuses (approved/rejected), and all output handling.
In some countries, if the user has the Mercado Pago app installed on their device, the checkout webview will attempt to open it automatically as the first payment option. However, for DEV payments this option is not enabled, so you must close it and return to WhatsApp to enter the test card.

Test cards by country

To test different scenarios (approved payment, rejected payment, etc.), Mercado Pago publishes test cards by country.
In DEV, remember two things:
  • Use test credentials.
  • Use a valid test user in the Buyer email field (from the same country as your credentials).
Each link contains card numbers, CVV, and approval/rejection cases:
If you want to test your flow properly, try at least 2 cases: one approved and one rejected. This validates that your outputs (Successful Payment / Failed) are connected correctly.

3. Going to production (PROD)

Going to PROD is basically changing two things: credentials and real data. The WhatsApp experience remains the same, but now the payment affects your production account.

Video 3: Production configuration + real payment

Video 3 – Going to production (PROD) and real payment

1

Obtain production credentials

In Mercado Pago, go to Production credentials and copy your production Access Token.
This token is associated with your production account. Only use it when you are ready to charge real.
2

Update credentials in Marketplace

To avoid confusion (and make it explicit), we will reinstall the integration with the correct token:
  • Go to Marketplace
  • Open Mercado Pago
  • Press Delete integration
  • Press Install again
  • Paste your production Access Token
  • Press Install
3

Change the node environment to PROD

In the Jelou Pay: Send payment link node:
  • Change Environment from DEV to PROD
From this point on, the flow will attempt to generate real charges.
4

Replace the Buyer email with the real email from the flow

In DEV, we used a test user for the Buyer email field. In PROD, that same field must come from your flow (the user’s real email).If during the test stage you left a hardcoded test user in the input, now replace it with your variable.
In this tutorial, the email is captured during the conversation (AI Agent) and normalized as a variable before reaching the payment node. The important thing is that in PROD the Buyer email field is connected to that real data.
5

(Optional) Customize payment button text

If you want the CTA to feel more contextual (without changing the checkout), activate Customize payment button text.
  • Change the selector to Yes
  • Complete Header, Body, and Footer (required)
This only customizes the pre-checkout message within WhatsApp. The payment logic and the WebView do not change.
6

Test real payment

Make a real payment (wallet or card) and verify:
  • Approved status
  • Operation number (operation ID)
  • Record visible in your Mercado Pago dashboard
Production transactions consume Brain Studio credits per attempt, in addition to provider commissions. If you are validating for the first time, make a small charge and review the dashboard before scaling.

Next steps

Payment experiences

When to use WebView, native experience, or conversational flows.

Payment providers

Other providers by country and specific guides.

Mercado Pago - Usage and configuration

Complete reference for inputs, outputs, and node options.

With these steps you have the flow working in test and production. From here you can record operations, issue receipts, send automatic email tickets, or integrate more providers depending on your use case.