Generate Dynamic QR
AI-generatedOverview
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: Used for fixed payments where the amount and details are predefined.
- Dynamic QR Code: Used for variable payments where transaction details can change per payment.
Typical use cases include:
- Merchants generating QR codes to receive payments from customers.
- Businesses automating payment requests with specific amounts and descriptions.
- Integrations where QR codes need to be generated dynamically based on transaction data.
For example, a merchant can generate a dynamic QR code specifying the customer’s payment amount and description, then send the QR code image or BR Code string to the customer for scanning and payment.
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 for receiving payments; can be CPF, CNPJ, email, phone number, or random key |
| Transaction Amount | Payment amount in BRL (Brazilian Real). For static QR, optional; for dynamic QR, required |
| Additional Info | Optional payment description |
| 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 an array of JSON objects, each representing one input item processed. Each output object contains:
success: Boolean indicating if the operation succeeded.operation: The operation performed (generateStaticorgenerateDynamic).creditsUsed: Number of credits consumed by the API call.creditsRemaining: Remaining credits after the call.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: The payment amount in BRL (present if specified).
If the node encounters an error and is configured to continue on failure, it outputs an object with:
error: Error message describing what went wrong.success: falseoperation: The attempted operation.
The node does not output binary data directly but provides the QR code image as a Base64-encoded string suitable for embedding or further processing.
Dependencies
- Requires an external API service for Pix QR code validation and generation, accessed via HTTP POST requests.
- Needs an API key credential for authentication with this external service.
- The node uses an internal Pix QR code generator library for creating the actual QR code strings and images.
- Requires configuration of the API URL and API key credential within n8n.
Troubleshooting
- Merchant Name or City Length Errors: If the merchant name exceeds 25 characters or the city exceeds 15 characters, the node throws an error. Ensure these fields respect the length limits.
- API Validation Failures: If the external API returns a failure during validation, the node will throw an error with the API's message. Check API credentials and network connectivity.
- Missing Required Fields: Required properties like Pix Key, Merchant Name, Merchant City, and Transaction Amount (for dynamic QR) must be provided; otherwise, errors occur.
- Credit Limits: The node tracks credits used and remaining from the API response. Running out of credits may cause failures.
- Output Options Misconfiguration: If both output options are disabled, the node will produce no QR code or BR Code output.
Links and References
- Pix Payment System - Official Documentation (in Portuguese)
- Pix QR Code Specification
- Base64 Encoding - Wikipedia
This summary is based solely on static analysis of the provided source code and property definitions.