Mi2u Search Invoice icon

Mi2u Search Invoice

MI2U custom node that search invoice from ICS

Overview

This node, named "Mi2u Search Invoice," is designed to search for invoice details from the MI2U ICS (Invoice Cloud System) platform. It allows users to query invoice information by providing a supplier's Taxpayer Identification Number (TIN) and an invoice document number. The node handles authentication either by using a provided cookie or by logging in with stored credentials to obtain a session cookie automatically.

Common scenarios where this node is beneficial:

  • Automating invoice verification processes by retrieving invoice data directly from the MI2U system.
  • Integrating invoice lookup into larger workflows for accounting, auditing, or payment processing.
  • Validating supplier invoices before approval or payment.

Practical example:
A finance team wants to automate the validation of incoming invoices. They can use this node to input the supplier TIN and invoice number, retrieve the official invoice details from MI2U, and then cross-check these details against their internal records.

Properties

Name Meaning
Suppiler TIN Supplier Taxpayer Identification Number (e.g., "C123456789"). Required to identify the supplier.
Document Number Invoice Code Number (e.g., "INV-001"). Required to specify the invoice to search for.
Authentication Cookie Optional. Directly provide an authentication cookie string to override credential-based login. Useful if you already have a valid session cookie.

Output

The node outputs an array of JSON objects, each corresponding to an input item processed. Each output JSON object contains:

  • returnCode: A status code returned by the MI2U API indicating success or failure (e.g., "00" means success).
  • returnMsg: A message describing the result of the request.
  • cookie: The authentication cookie used for the request.
  • json_error: Boolean flag indicating if there was a JSON parsing error.
  • statusCode: HTTP status code of the API response.
  • statusMessage: HTTP status message of the API response.
  • decodedContent: Parsed JSON content of the invoice details if the request was successful and content was returned. This field contains the actual invoice data decoded from base64.

If an error occurs (e.g., missing required parameters or failed login), the output JSON will contain an error field describing the issue along with any relevant context such as the TIN and document number used.

The node does not output binary data.

Dependencies

  • Requires access to the MI2U ICS API endpoints:
    • Login endpoint: https://ics-uat.myinvoice2u.com/MYWs/ws/api/getToken
    • Invoice search endpoint: https://ics-uat.myinvoice2u.com/MYWs/ws/api/myInvoice
  • Requires an API key credential containing username and password for MI2U login unless an authentication cookie is provided directly.
  • Uses HTTP POST requests with JSON payloads and expects JSON responses.
  • Needs network connectivity to the MI2U API URLs.

Troubleshooting

  • Missing TIN or Document Number: The node requires both fields to be provided either via input data or node parameters. If missing, it returns an error stating that both are required.
  • Login failures: If no authentication cookie is provided and login fails (no cookie received), the node outputs an error "Login failed - no cookie received." Ensure credentials are correct and the MI2U service is reachable.
  • Invalid or expired cookies: If the provided or obtained cookie is invalid or expired, the invoice search may fail or return errors. Try refreshing the cookie by re-authenticating.
  • API connectivity issues: Network problems or incorrect API URLs can cause HTTP errors. Verify network access and endpoint correctness.
  • JSON parsing errors: If the response content cannot be parsed, the json_error flag will be set to true. Check the API response format and ensure it matches expectations.

Links and References

Discussion