Mercado Pago icon

Mercado Pago

Integração com APIs do Mercado Pago para processamento de pagamentos

Actions5

Overview

This node integrates with the Mercado Pago payment platform to create new payment requests using the PIX method. It is designed to facilitate the generation of payment links or QR codes for transactions, enabling users to collect payments easily via PIX, a popular instant payment system in Brazil.

Common scenarios where this node is beneficial include:

  • E-commerce platforms needing to generate PIX payment requests dynamically.
  • Service providers who want to send payment requests to customers via email or WhatsApp.
  • Businesses automating their billing and payment collection processes through Mercado Pago.

Practical example:

  • A small online store uses this node to create a PIX payment request for each order, sending the generated QR code or payment link to the customer’s email or WhatsApp for quick payment.

Properties

Name Meaning
Descrição Optional description of the payment.
Valor da Transação The transaction amount (required).
Método de Pagamento Payment method; only "PIX" is supported.
Nome do Cliente Optional payer's first name (optional for PIX).
Email do Cliente Payer's email address (required).
WhatsApp do Cliente Optional WhatsApp contact of the client (max 64 characters), used as an external reference.

Output

The node outputs JSON data containing the response from the Mercado Pago API after creating the payment. This includes:

  • Payment details such as status, ID, and transaction amount.
  • PIX-specific information like the QR code image and ticket URL.
  • Other metadata returned by Mercado Pago related to the created payment.

If the payment creation is successful, the output JSON will contain fields such as:

  • pix_qr_code: The PIX QR code string.
  • qr_code_base64: Base64 encoded image of the QR code.
  • pix_ticket: URL to the PIX payment ticket.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for Mercado Pago with a valid access token.
  • The node communicates with the Mercado Pago API endpoint at https://api.mercadopago.com/v1/payments.
  • Proper configuration of the API credentials in n8n is necessary, including environment setup for sandbox or production modes.

Troubleshooting

  • Missing or invalid access token: The node throws errors if the access token is missing, empty, too short, or not properly formatted. Ensure the API key credential is correctly set up and active.
  • Invalid transaction amount: Errors occur if the transaction amount is zero, negative, or exceeds R$ 999,999.99. Verify the input value.
  • Invalid payer email: The payer email must be non-empty and contain a valid format (must include '@' and '.'). Invalid emails cause operation errors.
  • Unsupported payment method: Only "PIX" is supported. Using other methods results in an error.
  • WhatsApp field length exceeded: The optional WhatsApp contact must not exceed 64 characters.
  • API request failures: Network issues or incorrect API URLs result in errors. Check network connectivity and API endpoint correctness.
  • JSON parsing errors: If the API response cannot be parsed, verify the API service status and response format.

Links and References


This summary is based on static analysis of the provided source code and property definitions for the "Pagamento" resource and "Criar" operation.

Discussion