Skip to content

Mercado Pago - Create Preference

Creates a payment preference for Mercado Pago Checkout Pro. Allows configuring items, return URLs, payer data, and payment options.

FieldTypeRequiredDescription
credentials_idcredentialYesMercado Pago credentials
itemsstringYesItems in JSON format (array)
payer_emailstringNoPayer email
payer_namestringNoPayer name
payer_phonestringNoPayer phone
external_referencestringNoExternal reference
success_urlstringNoSuccess redirect URL
failure_urlstringNoFailure redirect URL
pending_urlstringNoPending redirect URL
notification_urlstringNoIPN webhook URL
auto_returnselectNoAuto return behavior
expiresbooleanNoWhether the preference expires
expiration_date_fromstringNoValid from date
expiration_date_tostringNoValid until date

This module requires a mercadopago type credential with the following fields:

  • Access Token: Mercado Pago access token (obtained from the developer dashboard)
[
{
"title": "Producto 1",
"quantity": 2,
"unit_price": 100.50,
"currency_id": "ARS",
"description": "Descripción opcional",
"picture_url": "https://..."
}
]
{
"success": true,
"preference": { ... },
"preference_id": "123456789-abc",
"init_point": "https://www.mercadopago.com.ar/checkout/v1/redirect?...",
"sandbox_init_point": "https://sandbox.mercadopago.com.ar/checkout/v1/redirect?...",
"message": "Preferencia 123456789-abc creada"
}
  1. Create the preference with this module
  2. Redirect the user to init_point (production) or sandbox_init_point (testing)
  3. The user completes the payment in the Mercado Pago interface
  4. The user is redirected to your configured URLs
  5. Receive notifications via webhook at notification_url
{
"items": "[{\"title\": \"Producto 1\", \"quantity\": 2, \"unit_price\": 100.50, \"currency_id\": \"ARS\"}]",
"payer_email": "cliente@email.com",
"external_reference": "ORDER-123",
"success_url": "https://mitienda.com/success",
"failure_url": "https://mitienda.com/failure",
"notification_url": "https://mitienda.com/webhook"
}
  • The items field must be a JSON array serialized as text
  • Each item requires at least title, quantity, and unit_price
  • Return URLs are optional but recommended for a good user experience
  • The returned init_point is the URL to redirect the user to checkout
  • MercadopagoGetPayments - Get resulting payments
  • MercadopagoCreateRefund - Create refund
  • MercadopagoCreateCustomer - Create customer