Mercado Pago

Integração com APIs do Mercado Pago

Actions6

Overview

This node integrates with the Mercado Pago API to manage payment operations. Specifically, for the Payment - Create operation, it allows users to create a new payment transaction by providing details such as description, amount, payment method, payer information, and external references.

Common scenarios where this node is beneficial include:

  • Automating payment processing in e-commerce workflows.
  • Creating payments programmatically from form submissions or CRM systems.
  • Integrating Mercado Pago payment creation into custom business processes.

For example, an online store could use this node to create a payment when a customer places an order, specifying the payment method (e.g., PIX, Visa), the transaction amount, and the customer's contact details.

Properties

Name Meaning
Description Description of the payment. A required text describing the payment purpose.
Transaction Amount The monetary value of the transaction. Must be greater than zero.
Payment Method ID The payment method to use. Options: PIX, Visa, Mastercard, American Express.
Installments Number of installments for the payment. Defaults to 1.
Payer First Name First name of the payer. Required for identification.
Payer Email Email address of the payer. Used for communication and receipt delivery.
External Reference External reference string (e.g., user's WhatsApp number) to link the payment externally.

Output

The node outputs a JSON array where each element corresponds to the result of a payment creation request. The JSON structure includes all data returned by the Mercado Pago API for the created payment.

If the payment method is PIX, additional fields are included in the output:

  • pix_qr_code: The QR code string for the PIX payment.
  • pix_qr_code_base64: Base64 encoded image of the PIX QR code.
  • pix_ticket_url: URL to the PIX payment ticket.

These fields enable downstream nodes or systems to display or process PIX payment information.

No binary data output is produced by this operation.

Dependencies

  • Requires an active Mercado Pago API credential configured in n8n for authentication.
  • The node makes HTTP requests to the Mercado Pago API endpoint at https://api.mercadopago.com.
  • Environment should have network access to Mercado Pago services.

Troubleshooting

  • Missing Required Fields: Errors will occur if mandatory properties like Description, Transaction Amount (>0), Payer First Name, Payer Email, or External Reference are empty or invalid. Ensure all required inputs are correctly provided.
  • Invalid Payment Method: Using unsupported payment methods may cause API errors. Use one of the supported options: PIX, Visa, Mastercard, American Express.
  • API Authentication Errors: If the API key or credentials are misconfigured, the node will fail to authenticate. Verify that the Mercado Pago API credential is properly set up in n8n.
  • Idempotency Key Conflicts: The node generates a unique idempotency key per request to avoid duplicate payments. If you encounter duplicate payment issues, check how the node is triggered and ensure no repeated executions happen unintentionally.
  • PIX Specific Issues: For PIX payments, if the QR code or ticket URL is missing, verify that the payment method is correctly set to PIX and that the Mercado Pago account supports PIX transactions.

Links and References

Discussion