Skip to main content

Setup

Required env vars:

How it works

Checkouts and one-off payments are both built on Mercado Pago’s Checkout Pro preferences. Subscriptions reference a pre-existing Plan instead — item_id maps to that plan’s id:

Webhooks

Mercado Pago signs webhooks with a secret signature configured separately in your integration settings — it’s not the same as your access token. Notifications only carry the resource type and id; the provider fetches the full resource before mapping standard events.
Mercado Pago sends the signature in the x-signature header (ts=...,v1=...), and the notified resource id in the data.id query parameter — both feed into the HMAC-SHA256 manifest alongside x-request-id.

Raw Mercado Pago events

Opt into any native Mercado Pago notification — fully typed against Mercado Pago’s webhook envelope:
Every webhook always emits its raw event first, alongside the matching standard PayKit event below where one applies.
Raw eventPayKit event
mercadopago.payment.createdpayment.created
mercadopago.payment.updated (status approved)payment.succeeded + invoice.generated
mercadopago.payment.updated (status rejected/cancelled)payment.failed
mercadopago.payment.updated (status refunded)refund.created
mercadopago.subscription_preapproval.createdsubscription.created
mercadopago.subscription_preapproval.updated (status cancelled)subscription.canceled
mercadopago.subscription_preapproval.updated (other statuses)subscription.updated
mercadopago.subscription_authorized_payment.* (charge approved)payment.succeeded + invoice.generated
mercadopago.subscription_authorized_payment.* (charge rejected)payment.failed
mercadopago.subscription_preapproval_plan.*(raw only)
Mercado Pago has no delete-preference API and no general payment-update API — use capturePayment/cancelPayment for payment state transitions instead of updatePayment.

provider_metadata