Overview
This node integrates with the Mercado Pago API to manage payment preferences, specifically allowing the creation of payment preferences for checkout processes. It is useful when you want to programmatically create a payment preference that defines items and their details for a checkout session using Mercado Pago's Checkout Pro or Split Payments features.
A practical example is an e-commerce platform that needs to generate a payment preference dynamically based on the shopping cart contents, enabling customers to complete purchases via Mercado Pago.
Properties
| Name | Meaning |
|---|---|
| Items | A collection of one or more items included in the payment preference. Each item requires: - ID: Unique identifier of the item - Title: The name/title displayed at checkout - Description (optional): Additional details about the item - Picture URL (optional): Image URL representing the item - Category ID (optional): Category classification of the item - Quantity: Number of units of this item - Currency ID: Currency code for the item's price. Options are: Real Brasileiro (BRL), Peso Argentino (ARS), Peso Chileno (CLP), Dólar Americano (USD) - Unit Price: Price per unit of the item |
Output
The node outputs a JSON array where each element corresponds to the response from the Mercado Pago API for each input item processed.
For the "Create Preference" operation, the output JSON contains the full response from Mercado Pago's /checkout/preferences endpoint, which typically includes:
- The created preference ID
- URLs for the checkout page
- Details of the items included
- Other metadata related to the payment preference
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for Mercado Pago configured in n8n.
- The node makes authenticated HTTP requests to the Mercado Pago API base URL:
https://api.mercadopago.com. - No additional environment variables are explicitly required beyond standard n8n credential setup.
Troubleshooting
- Missing or invalid fields: The node expects all required fields (e.g., item IDs, titles, quantities, unit prices) to be provided. Omitting required fields will cause errors.
- API authentication errors: Ensure the Mercado Pago API credentials are correctly set up and valid.
- Empty or malformed items array: If the items collection is empty or incorrectly structured, the API call may fail.
- Network issues: Connectivity problems can cause request failures; verify network access to Mercado Pago endpoints.
- Error messages: Errors returned by the Mercado Pago API will be propagated. Common errors include invalid currency codes, negative prices, or invalid item quantities.
To resolve errors:
- Double-check all required input properties.
- Validate the structure and data types of the items array.
- Confirm API credentials and permissions.
- Review error messages for specific API validation feedback.