# Mercado Pago

Mercado Pago takes Pix, card and boleto, with the money going to your Mercado Pago
account. It is the gateway most used by stores in Brazil.

You need a Mercado Pago account (personal or business). The step by step is also
on the Mercado Pago card, in **Settings > Payments**, under **How to set up Mercado
Pago, step by step**.

![The Mercado Pago step by step open in the dashboard, with the webhook URL to copy](shots/payments-mp.webp)

## 1. Create the application

1. Open the
   [Mercado Pago Developer Panel](https://www.mercadopago.com.br/developers/panel/app)
   and log in with your account.
2. Click **Create application** (Criar aplicação).
3. Give it a name (for example, `Rede Pixel`), check **Online payments**
   (Pagamentos online) and save.

## 2. Copy the Public Key and the Access Token

1. Inside the application, open **Production credentials** in the side menu.
2. Copy the **Public key** and paste it into the **Public Key** field of the
   dashboard.
3. Copy the **Access token** and paste it into the **Access Token** field.

> [!WARNING]
> Use the production credentials. Test ones only simulate: the player "pays" and
> nothing reaches your account.

## 3. Set up the webhook

1. In the application's side menu, open **Webhooks > Configure notifications**.
2. In **Production URL**, paste the URL the dashboard shows (**Copy URL**
   button). It looks like this:

   ```text Webhook URL
   https://webhooks.hystore.com.br/api/v1/webhooks/mercadopago/<your store id>
   ```

3. In **Events**, check only **Payments**.
4. Click **Save**.
5. Mercado Pago shows the **Secret key** (Signing Secret). Copy it and paste it
   into the **Webhook Secret** field of the dashboard.

## 4. Turn it on and save

Turn on the Mercado Pago card's switch and save. Done: Pix, card and boleto show
up for the player at checkout.

> [!TIP]
> Make a cheap test purchase (a R$ 1.00 product, for example) with Pix. If the
> order moves to **Paid** on its own within seconds, the webhook is right.

## Common problems

| What happens | What to do |
| --- | --- |
| The order stays Pending after the Pix is paid | Check the webhook production URL and that the **Payments** event is checked |
| Error on save: Public Key or Access Token | Both fields are required and must be production ones, from the same application |
| Test payments do not show in the account | Test credentials only simulate; switch to production ones |

Mercado Pago fees in Finance: see [Gateway fees](/en/payments/fees/).
