N8N Tools - Pix QR Code Generator icon

N8N Tools - Pix QR Code Generator

Generate Pix QR Codes for Brazilian instant payments

Generate Static QR

AI-generated

Overview

This node generates Pix QR Codes for Brazilian instant payments, supporting both static and dynamic QR code creation. Pix is a popular payment system in Brazil that enables fast and easy money transfers using QR codes.

  • Static QR Code generation: Creates a fixed QR code for a specific payment amount or donation. This is useful for businesses or individuals who want to receive payments with predefined details.
  • Dynamic QR Code generation: Creates QR codes with variable payment amounts, suitable for scenarios where the payment value changes per transaction.

Practical examples:

  • A small business generating a static QR code to display on their website or printed materials for customers to scan and pay a fixed amount.
  • An online store generating dynamic QR codes for each order with the exact payment amount embedded.

Properties

Name Meaning
Merchant Name Business or individual name (max 25 characters)
Merchant City Business location (max 15 characters)
Pix Key Valid Pix key used to receive payments (CPF, CNPJ, email, phone number, or random key)
Transaction Amount Payment amount in BRL; optional for static QR (e.g., donations), required for dynamic QR
Additional Info Optional payment description or additional information
Transaction ID Optional unique identifier for the transaction
Output Options Collection of output preferences:
- Output BR Code: Whether to output the BR Code string
- Output QR Image: Whether to output the QR code image in Base64 format

Output

The node outputs JSON data containing:

  • operation: The operation performed (generateStatic or generateDynamic).
  • success: Boolean indicating if the operation succeeded.
  • creditsUsed: Number of API credits consumed.
  • creditsRemaining: Remaining API credits after the operation.
  • brCode (optional): The generated BR Code string representing the Pix payment information.
  • qrCodeImage (optional): The QR code image encoded as a Base64 string.
  • pixKey: The Pix key used for the payment.
  • transactionAmount (if provided): The payment amount in BRL.

If an error occurs and "Continue On Fail" is enabled, the output will include:

  • error: Error message describing the failure.
  • success: false
  • operation: The attempted operation.

Dependencies

  • Requires an external API service for Pix QR code validation and generation.
  • Needs an API key credential configured in n8n to authenticate requests to this external service.
  • Uses an internal Pix QR code generator library for creating QR codes and images.
  • HTTP requests are made to the API endpoint /api/v1/pix-qrcode/validate to validate operations before generating codes.

Troubleshooting

  • Merchant name or city length errors: The merchant name must be 25 characters or less, and the city must be 15 characters or less. Exceeding these limits will cause errors.
  • API validation failures: If the external API rejects the request, check the API key validity and network connectivity.
  • Missing required fields: Ensure all required properties for the selected operation are provided.
  • Invalid Pix key: The Pix key must be valid (CPF, CNPJ, email, phone, or random key). Invalid keys will cause generation to fail.
  • Error messages: Errors from the API or validation are surfaced as node operation errors with descriptive messages. Use these messages to correct input data or configuration.

Links and References

Discussion