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

# Mercado Pago

> Set up Mercado Pago payments for prepaid and subscription plans in Davinci AI.

> [!WARNING]
>
> Mercado Pago requires the [SaaS Business](https://davinci.mintlify.site/saas/saas-business.md) extension (Extended License) and the **Mercado Pago Payment Gateway** extension from the **Marketplace**. The Mercadopago card appears in Finance Settings only after the Mercado Pago Payment Gateway extension is installed.

> [!NOTE]
>
> **Supported plans:** prepaid and lifetime plans (one-time payment through Checkout Pro), monthly and yearly subscription plans.

## Get your API credentials

**1. Step 1**

In [Mercado Pago Developers](https://www.mercadopago.com/developers/panel/app), go to **Your integrations** and open your application (create one if needed).

**2. Step 2**

Copy the **Access Token** (starts with `APP_USR-` for live or `TEST-` for sandbox). The **Public Key** is optional.

## Webhook

Required. Davinci completes payments, activates and renews subscriptions and records cancellations from Mercado Pago's notifications. It rejects every notification without a valid `x-signature`.

**1. Step 1**

In your application, go to **Webhooks** → **Configure notifications** and set the URL to `https://YOUR_DOMAIN/webhooks/mercadopago` (replace `YOUR_DOMAIN` with your domain). If you test with `TEST-` credentials, set the same URL for test mode.

**2. Step 2**

Select the **Payments** (`payment`) and **Plans and Subscriptions** (`subscription_preapproval`, `subscription_authorized_payment`) events and click **Save**.

**3. Step 3**

Copy the secret signature that Mercado Pago generates for the application.

## Configure Mercado Pago in Davinci

**1. Step 1**

Go to **Admin Panel** → **Finance Management** → **Finance Settings** and click **Mercadopago**.

**2. Step 2**

Fill in the fields:

| Field | Value |
| - | - |
| **Mercado Pago Access Token** | Access Token (required once either toggle is on) |
| **Mercado Pago Public Key** | Public Key (optional) |
| **Mercado Pago Webhook Secret** | Secret signature (required once either toggle is on) |
| **Mercado Pago Webhook URL** | `https://YOUR_DOMAIN/webhooks/mercadopago` (filled in automatically, read-only) |
| **Mercado Pago Environment** | **Sandbox** for test credentials, **Production** for live credentials |

**3. Step 3**

Turn on **Use Mercado Pago Prepaid** (prepaid and lifetime plans) and/or **Use Mercado Pago Subscription** (monthly and yearly plans), then click **Save**.

> [!NOTE]
>
> Davinci charges in the plan's currency. Price the plans you sell through Mercado Pago in your Mercado Pago account's currency (for example BRL, ARS or MXN).

## Subscription plans

Mercado Pago needs no plan IDs. At checkout Davinci creates a Mercado Pago subscription for the plan price, charged every month (monthly plans) or every 12 months (yearly plans), and sends the customer to Mercado Pago to authorize it. Davinci activates the plan as soon as Mercado Pago reports the subscription as authorized, when the customer returns or through the webhook. Each later charge is recorded as a renewal when the webhook reports it approved.

Cancelling a subscription in Davinci cancels it at Mercado Pago. If Mercado Pago doesn't confirm the cancellation, Davinci shows an error and keeps the subscription active. A subscription cancelled in Mercado Pago is cancelled in Davinci too.


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