Overview
This node, named "Mi2u Auth," is designed to retrieve an authentication code from the MyInvoice2U API based on user-provided email and Taxpayer Identification Number (TIN). It is useful in scenarios where users need to programmatically obtain authentication tokens or codes for further interactions with the MyInvoice2U platform, such as automating invoice management or integrating tax-related workflows.
Typical use cases include:
- Automating authentication steps in invoice processing pipelines.
- Validating user credentials before performing other API operations.
- Retrieving auth codes for secure access to MyInvoice2U services.
Properties
| Name | Meaning |
|---|---|
| The email address associated with your MyInvoice2U account. Used for authentication. | |
| TIN | Your Taxpayer Identification Number (TIN). Used alongside the email to retrieve the auth code. |
Output
The node outputs a JSON object for each input item with the following structure:
success(boolean): Indicates whether the API call was successful.email(string): The email used in the request.tin(string): The TIN used in the request.response(object): The full raw response from the API.authCode(string, optional): The authentication code retrieved from the API if available.message(string, optional): Any message returned by the API or generated during processing.status(string, optional): Status string returned by the API.error(string, optional): Error message if the request failed.statusCode(number|string, optional): HTTP status code of the failed request.timestamp(string): ISO timestamp when the response was processed.
If no email or TIN is provided, the node skips the API call and returns a JSON indicating the skip with success: false.
The node does not output binary data.
Dependencies
- Requires an API key credential for authenticating requests to the MyInvoice2U API.
- Makes HTTP GET requests to the endpoint:
https://api.myinvoice2u.com/AuthRetrieval/api/getauthcode - The API key must be configured in the node's credentials section.
- No additional environment variables are required.
Troubleshooting
- Missing API Key: If the API key is not set, the node throws an error prompting to configure it in credentials.
- No Email or TIN Provided: The node will skip the API call and return a message indicating missing parameters.
- HTTP Request Failures: Network issues or invalid API keys may cause HTTP errors. The node captures these and outputs error details including status code and message.
- API Response Indicates Failure: If the API returns an error or unsuccessful status, the node marks the operation as failed and includes the message from the API.
- Unexpected Errors: Other unexpected exceptions are caught; if "Continue On Fail" is enabled, the node outputs failure info per item, otherwise it stops execution.
To resolve common issues:
- Ensure the API key credential is correctly configured.
- Provide valid email and TIN values.
- Check network connectivity and API endpoint availability.
- Review error messages returned in the output for specific guidance.
Links and References
- MyInvoice2U API Documentation (general reference, actual URL may vary)
- n8n HTTP Request Node documentation for understanding HTTP options and error handling.