Overview
This n8n node, OpenPix, automates interactions with the OpenPix workflow API. Specifically, it allows users to create a new charge by sending a POST request to the /charge endpoint of the OpenPix API. This is useful for scenarios where you need to programmatically generate payment charges, such as in e-commerce platforms, automated billing systems, or any workflow that requires initiating payments via OpenPix.
Practical Example:
You could use this node in an n8n workflow to automatically create a payment charge when a new order is received in your system, passing the order amount and a unique identifier for tracking.
Properties
| Display Name | Type | Description |
|---|---|---|
| Value | Number | Charge value in cents. |
| CorrelationID | String | Unique identifier for the charge. |
- Value: The amount to be charged, specified in cents (e.g., 1000 for R$10.00).
- CorrelationID: A unique string to identify and track the specific charge.
Output
The node returns the JSON response from the OpenPix API's /charge endpoint. The structure of this output depends on the OpenPix API, but typically includes details about the created charge, such as its ID, status, value, and correlation information.
Example Output Structure:
{
"chargeId": "string",
"correlationID": "string",
"value": 1000,
"status": "ACTIVE",
// ...other fields as provided by OpenPix
}
Note: The actual fields may vary based on the OpenPix API's response.
Dependencies
- External Service: Requires access to the OpenPix API.
- API Key: You must configure valid OpenPix API credentials in n8n under the name
openpixApi. - n8n Configuration: No additional configuration required beyond setting up credentials.
Troubleshooting
Missing or Invalid Credentials:
- Error Message: "No credentials found" or authentication errors from the API.
- Resolution: Ensure you have set up the
openpixApicredentials correctly in n8n.
Invalid Input Values:
- Error Message: API may return validation errors if
Valueis not a number orCorrelationIDis missing/invalid. - Resolution: Double-check that you are providing a numeric value for "Value" and a non-empty string for "CorrelationID".
- Error Message: API may return validation errors if
API Errors:
- Error Message: Any error returned by the OpenPix API will be surfaced as a node error.
- Resolution: Review the error message for details; consult OpenPix API documentation for error codes and meanings.