Mercado Pago MCP icon

Mercado Pago MCP

Integração com MCP Server do Mercado Pago

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 - Update operation, it updates an existing checkout preference by sending a new set of items to the Mercado Pago API.

Use cases include updating the list of products or services in a checkout preference before redirecting customers to the payment page. For example, if you want to modify the items in a shopping cart or change prices dynamically before the customer completes the payment, this operation is useful.

Practical example:

  • You have a checkout preference with ID PREF123456789 and want to update its items to reflect a new product selection or quantity changes. This node sends the updated items array to Mercado Pago, which then updates the preference accordingly.

Properties

Name Meaning
ID da Preferência The unique identifier of the checkout preference to update (e.g., PREF123456789).
Items JSON array representing the items in the preference. Each item includes fields like title, quantity, unit price, and currency. Example: [{"title": "Product", "quantity": 1, "unit_price": 100, "currency_id": "BRL"}]

Output

The node outputs a JSON object containing the updated preference data returned from the Mercado Pago API. The output structure includes:

  • type: A string indicating the operation type, e.g., "preference_updated".
  • preference: An object with the updated preference details as returned by Mercado Pago.
  • success: Boolean indicating whether the operation was successful (true).
  • timestamp: ISO timestamp of when the operation was performed.

Example output snippet:

{
  "type": "preference_updated",
  "preference": {
    "id": "PREF123456789",
    "items": [
      {
        "title": "Product",
        "quantity": 1,
        "unit_price": 100,
        "currency_id": "BRL"
      }
    ],
    ...
  },
  "success": true,
  "timestamp": "2024-06-01T12:00:00.000Z"
}

No binary data output is involved in this operation.

Dependencies

  • Requires an active Mercado Pago API authentication token (API key credential) configured in n8n credentials.
  • Uses the Mercado Pago REST API endpoint https://api.mercadopago.com/checkout/preferences/{preferenceId} with HTTP PUT method.
  • Requires network access to Mercado Pago's API servers.

Troubleshooting

  • Invalid Preference ID: If the provided preference ID does not exist or is malformed, the API will return an error. Verify the ID format and existence.
  • Malformed Items JSON: The items property must be valid JSON and conform to Mercado Pago's expected schema. Invalid JSON or missing required fields (like title, quantity, unit_price, currency_id) will cause errors.
  • Authentication Errors: Ensure the API token credential is correctly set up and has permissions to update preferences.
  • API Rate Limits: Frequent updates may hit rate limits; handle such errors by retrying after some delay.
  • Network Issues: Connectivity problems can cause request failures; verify network access.

Common error messages usually come from the Mercado Pago API and should be inspected in the node's error output. They often indicate issues with authorization, invalid parameters, or resource not found.

Links and References

Discussion