Actions26
Overview
This node integrates with the Mercado Pago MCP (Mercado Pago Checkout Pro) API to manage checkout preferences, among other resources. Specifically, for the Preference - Create operation, it allows users to create a new checkout preference by specifying an array of items that will be included in the checkout process.
This is useful when you want to programmatically generate a payment preference for a customer’s shopping cart or order, enabling a seamless checkout experience via Mercado Pago's platform.
Practical example:
You have an e-commerce site and want to create a checkout session dynamically based on the products a user has selected. By providing the list of items (with details like title, quantity, unit price, and currency), this node creates a checkout preference that can then be used to redirect the user to Mercado Pago’s payment page.
Properties
| Name | Meaning |
|---|---|
| Items | JSON array representing the items to include in the checkout preference. Each item should contain fields such as title, quantity, unit_price, and currency_id. Example: [{"title": "Product", "quantity": 1, "unit_price": 100, "currency_id": "BRL"}] |
Output
The output JSON contains the response from Mercado Pago after creating the checkout preference. It includes:
type: A string indicating the type of response, here"preference_created".preference: An object containing the details of the created checkout preference as returned by Mercado Pago.success: Boolean flag indicating if the operation was successful (true).timestamp: ISO string timestamp of when the operation was performed.
Example output structure:
{
"type": "preference_created",
"preference": {
// Mercado Pago preference object with id, init_point URL, items, etc.
},
"success": true,
"timestamp": "2024-06-01T12:00:00.000Z"
}
No binary data output is produced by this operation.
Dependencies
- Requires an API key credential for Mercado Pago MCP with appropriate permissions.
- The node makes HTTP requests to Mercado Pago’s API endpoints (
https://api.mercadopago.com). - Proper configuration of the credential with access token and endpoint is necessary.
- The
itemsproperty must be valid JSON parsable into an array of item objects.
Troubleshooting
Invalid JSON in Items: If the
itemsinput is not valid JSON or does not conform to the expected structure, the API call will fail. Ensure the JSON is correctly formatted and includes required fields (title,quantity,unit_price,currency_id).Authentication Errors: If the API credentials are missing, invalid, or expired, the node will throw authorization errors. Verify the API key credential is correctly set up and active.
API Endpoint Issues: Network issues or incorrect endpoint URLs may cause request failures. Confirm network connectivity and correct credential endpoint configuration.
Error Messages:
"Card token is required for card payments"— Not applicable for Preference creation but common in payment operations; ensure tokens are provided when needed.- General HTTP errors from Mercado Pago will be passed through; check the error message for details (e.g., invalid parameters, unauthorized access).
Use the node’s Continue On Fail option to handle errors gracefully in workflows.