API Overall Flow

API flow Authentication (Login API)

  • MyInvois APIs are protected and accessible only to registered taxpayers and their ERP/POS systems.
  • Client ID and Client Secret Key will be generated by the MyInvois System and can be found in the taxpayer’s MyInvois profile.
  • Taxpayers need to configure the Client ID and Client Secret Key in their ERP/POS system to access the MyInvois API.
  • After configuring the Client ID and Client Secret Key, taxpayers should call the Login API to obtain an access token for e-Invoice submission via the API.

1. Submit e-Invoice with Submit e-Invoice API

  • The Submit e-Invoice API supports documents submitted in XML/JSON format.
  • Taxpayer systems are responsible for converting invoice data into the required XML/JSON format as per the API data structure.
  • Referring to the e-Invoice Specific Guideline for the input data required to call this API.
  • When the API is called, it performs validation based on the e-Invoice Specific Guideline. Upon successful validation, the API returns a validated e-Invoice, the date and time of validation, and a validation link generated by the MyInvois System.

2. Receive notification with Notification API

  • Once an e-Invoice is issued by the Supplier, the Buyer can receive the notification via email or API.
  • The Buyer can retrieve further information through the validated link.

3. Request for Rejection

  • Buyers can send a request to reject an e-Invoice via API within 72 hours.
  • Once the Request for Rejection API is sent, a notification is sent to the Supplier to notify them of the rejection request.
  • The Supplier then has the option to accept the rejection request and cancel the e-Invoice.

4. Cancellation

  • Upon receiving the rejection request from the Buyer, the Supplier can cancel the e-Invoice via the Cancel Document API within 72 hours.
  • If no cancellation action is performed by the Supplier within 72 hours, the e-Invoice remains validated.

Validation Logic Flow

  • The MyInvois System performs a series of checks to ensure that the XML/JSON file conforms to the e-Invoice format, structure, and data standards. Three types of validation rules are commonly applied during the e-Invoice file validation:

(a) Syntax Validation

  1. The MyInvois System performs an initial and fundamental check to validate the structure of the XML/JSON file.
  2. This check ensures that there are no errors such as missing tags, incorrect data types, or invalid characters. Any file that fails this check is considered invalid and cannot proceed further.

(b) Schema Validation

  1. After passing the initial check, the MyInvois System proceeds with the second validation, which involves checking the data type and format of the XML/JSON file.
  2. This validation includes a reference check against data dictionaries such as e-Invoice type, invoice currency code, tax type catalog, etc.

(c) Business Rule Validation

  1. The MyInvois System conducts business rule validation in accordance with IRBM’s requirements.
  2. This validation includes checks on TIN validation, invoice details, product/service details, payment information, total included/excluded tax amount calculated in accordance with arithmetic principles, and additional validation.
  • Upon successful validation, the MyInvois System returns a validated e-Invoice, along with an IRBM Unique Identifier Number, the date and time of validation, and a validation link back to the Supplier.

IF Failure Scenario

API Retry Mechanism:

  • Taxpayer systems should implement a retry mechanism to handle server error messages from MyInvois. The mechanism should retry the API call after a delay, increasing the delay exponentially if the error persists.

Upload using MyInvois Portal:

  • In case the MyInvois API is down, taxpayers can use the MyInvois Portal to submit e-Invoices. The portal allows for bulk upload of consolidated e-Invoices or manual input of invoice data.
  • Validated e-Invoices submitted via the MyInvois Portal will contain an IRBM Unique Identifier Number.
  • When the MyInvois API is back online, taxpayers are required to input the IRBM Unique Identifier Number into their ERP system and call the Get Document API to sync the invoice status with MyInvois.

Resend e-Invoice within 72 Hours:

  • Taxpayers have 72 hours to retransmit an e-Invoice once the MyInvois System is available again.

Getting Information on System Status:

  • During disruptions, the IRBM ensures the availability of a helpdesk to support taxpayers. Taxpayers will receive periodic updates on the progress through the helpdesk, microsite, and email.

Conclusion

In conclusion, the API flow for MyInvois, the e-Invoice system, offers a seamless process for taxpayers. It begins with authentication through the Login API, followed by the submission of e-Invoices using the Submit e-Invoice API. Buyers receive notifications and have the option to request rejection, while suppliers can cancel e-Invoices.

The system employs validation logic flow, including syntax, schema, and business rule validations. In case of API failure, a retry mechanism is recommended, and taxpayers can use the MyInvois Portal as an alternative option. System status updates are provided during disruptions. The API overall flow guide provides comprehensive information on each step of the process.

Disclaimer: The information provided on this platform is for general informational purposes only. It does not constitute professional advice and should not be relied upon for making decisions. Wanconnect Consulting Group is not responsible for any errors or omissions in the content or for any actions taken based on the information provided. We recommend seeking professional advice for specific situations. Wanconnect Consulting Group reserves the right to modify, update, or remove any content without notice.

Leave a Reply

Your email address will not be published. Required fields are marked *

Name *