Overview
This node integrates with the Mercado Pago API to manage payment preferences, specifically allowing you to update an existing payment preference. Payment preferences define the items and details shown in a checkout process using Mercado Pago's Checkout Pro.
The Update Preference operation lets you modify the items of an existing payment preference by specifying its unique ID and the new list of items. This is useful when you need to adjust the products or services offered in a payment flow without creating a new preference from scratch.
Practical examples:
- Updating the product list in a shopping cart before redirecting a customer to checkout.
- Changing item quantities or prices dynamically based on user selections.
- Correcting or adding item details like descriptions or images after a preference was created.
Properties
| Name | Meaning |
|---|---|
| Items | List of items in the payment preference. Each item includes: - ID (unique identifier) - Title (displayed in checkout) - Description (optional) - Picture URL (optional) - Category ID (optional) - Quantity (required, default 1) - Currency ID (ISO 4217 code; options: BRL, ARS, CLP, USD) - Unit Price (required) |
| Preference ID | The unique identifier of the payment preference to update (required). |
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 Update Preference operation, the output JSON contains the updated preference object returned by Mercado Pago, which includes details such as:
id: The preference ID.items: The updated list of items with their properties.- Other metadata related to the preference.
No binary data is produced by this operation.
Dependencies
- Requires an active Mercado Pago API credential configured in n8n for authentication.
- Internet access to call Mercado Pago's REST API at
https://api.mercadopago.com. - Proper permissions on the Mercado Pago account to update payment preferences.
Troubleshooting
- Missing or invalid Preference ID: The node throws an error if the Preference ID is empty or invalid. Ensure you provide a valid existing preference ID.
- Invalid item data: Required fields like item ID, title, quantity, currency, and unit price must be correctly set. Missing or incorrect values may cause API errors.
- API authentication errors: Verify that the Mercado Pago API credentials are correctly configured and have not expired.
- Network issues: Connectivity problems can cause request failures. Check your network and proxy settings if applicable.
- API rate limits: Frequent updates might hit Mercado Pago's rate limits; handle errors accordingly or add delays.