For the complete documentation index, see llms.txt. This page is also available as Markdown.

Mercado Pago

To use the Mercado Pago payment system, complete the settings below in your Mercado Pago Developers dashboard and then enter the details in the integration settings.

Application and Access Token

  1. Sign in to Mercado Pago and open the Developers section (Developers / Suas integrações).

  2. Create an application (Your integrations → Create application) if you don’t have one yet.

  3. Copy your Production Access Token or Test Access Token — this token will be used as the main API token.

For information about token types and where to find them, see: Credentials.

Webhooks (payment notifications)

  1. In the integration settings, open the Webhooks / уведомления section (see: Webhooks).

  2. Set the notification URL:

https://chatter.mavibot.ai/mercado_pago_callback/result

  1. Subscribe to Payments events so you can receive notifications about payment creation and status updates.

  2. Save the Webhook secret — it must be entered in the integration settings.

Connecting to Mavibot

In the Acquiring section, select Mercado Pago.

Then enter:

  • Access Token — the token you copied.

  • Webhook secret — the secret used to verify webhooks.

Calculator function: get_mercado_pago_payment_url(amount, description, currency, customer_email, product_name)

Parameters

Description

! amount

Payment amount.

This is required parameter.

description

Payment description.

This is optional parameter.

currency

ISO currency code (e.g. BRL, ARS, MXN, USD, EUR, CLP, COP, PEN, UYU) — optional; default is BRL.

customer_email

Customer email — optional.

product_name

Alternative product name — optional;

if not provided, the description is used instead.

The function returns a payment link.

This example shows how to pass parameters into the function and send the payment link in a message.

Payment via button

To send a payment button via Mercado Pago, select a button type with payment support in the button builder and choose Mercado Pago as the payment system. Enter the amount, description, and currency if needed.

Callbacks in the dialog after payment

Successful payment

After the client follows the link and completes a successful payment, a callback may be sent to the dialog in the following format:

<first_10_characters_of_Webhook_secret>_success <amount>

Example: gltubgnDle_success 100 — where the prefix is the first 10 characters of your Webhook secret, and 100 is the payment amount.

How to add a reaction to a successful payment

To send a message to your client after a successful payment (for example, “Payment completed successfully” or any other message), you need to set up a reaction using a block with a trigger and a callback.

Step 1

Create a block with a condition (Start block or Trigger block).

This is the Start block with a callback in the Trigger field
This is the Trigger block with a callback in the Trigger field

Step 2

Specify part of the callback (if you need to react to all payments, e.g. when you have multiple different products), or the full callback (if you want to set up a reaction only for a specific product sale).

If you need to set up a response to any payments in the project, leave a part of the callback and select the type of matching "Keywords match"

Step 3

Write the response message for a successful payment and save the block.Шаг 3. Пропишите сообщение-реакцию на успешную оплату и сохраните блок.

Failed payment

If the payment is not successful (declined, canceled, etc., depending on the status in the API), a callback may be sent in the following format:

<first_10_characters_of_Webhook_secret>_fail <amount>

Example: gltubgnDle_fail 100 — where the prefix is the first 10 characters of your Webhook secret, and 100 is the amount.

How to add a reaction to a failed payment

To send a message to your client after an unsuccessful payment (for example, “Payment failed” or any other message), you need to set up a reaction using a block with a trigger and a callback.

Step 1

Create a block with a condition (Start block or Trigger block).

Step 2

Specify part of the callback (if you need to react to all payments, e.g. when you have multiple different products), or the full callback (if you want to set up a reaction only for a specific product sale).

Step 3

Write the response message for a failed payment and save the block.

Client variables after successful payment

Variables

Description

mercado_pago_callback_data

Payment information received from the payment system.

mercado_pago_payment_completed

“True” — the payment has been processed as successful.

mercado_pago_payment_id

Mercado Pago payment ID

Last updated