Malaysia MyInvois E-Invoice Validator API

API ID 13423

Keyless Malaysia MyInvois (LHDN) e-invoice validator: official UBL 2.1 XSD, code lists, totals math, XAdES signature check. POST XML or JSON, get a rule-coded JSON report. No LHDN account.

410 ms avg response

API Documentation

Endpoints

Request
Simple liveness probe for monitoring and uptime checks. Returns {"status":"ok"} with HTTP 200 when the validation service is up and ready to accept documents. No parameters, no body required.
Endpoint ID: 29078
GET https://www.zylalabs.com/api/13423/malaysia+myinvois+e-invoice+validator+api/29078/health+check
INPUT PARAMETERS

Free test requests remaining: 3 of 3.

This endpoint does not require any input parameters.

API EXAMPLE RESPONSE
JSON
{
    "status": "ok"
}
Health check — CODE SNIPPETS

curl --location --request GET 'https://zylalabs.com/api/13423/malaysia+myinvois+e-invoice+validator+api/29078/health+check' --header 'Authorization: Bearer YOUR_API_KEY' 


    
Request
POST the raw MyInvois e-invoice as the request body (UBL 2.1 XML with Content-Type: application/xml, or MyInvois JSON with application/json - the format is auto-detected). Returns a JSON validation report: valid, wellFormed, documentType, errorCount, warningCount and detailed rule-coded findings (MY-STRUCT-*, MY-CORE-*, MY-CODE-*, MY-MATH-*, MY-SIG-*) covering the official UBL 2.1 XSD structure, mandatory fields, LHDN code lists, totals math and the enveloped XAdES signature. A non-compliant invoice is still HTTP 200 - the verdict is "valid": false inside the JSON.
Endpoint ID: 29079
POST https://www.zylalabs.com/api/13423/malaysia+myinvois+e-invoice+validator+api/29079/validate+e-invoice
INPUT PARAMETERS

Validate e-invoice — Endpoint Features

Object Description
Request Body Required Json

Free test requests remaining: 3 of 3.


INPUT PARAMETERS

API EXAMPLE RESPONSE
JSON
{
    "valid": true,
    "wellFormed": true,
    "inputFormat": "xml",
    "documentType": "01",
    "version": "1.1",
    "errorCount": 0,
    "warningCount": 4,
    "findings": [
        {
            "level": "info",
            "ruleId": "MY-STRUCT-XSD",
            "text": "Document is valid against the official UBL 2.1 Invoice XSD.",
            "location": null,
            "occurrences": 1
        },
        {
            "level": "warning",
            "ruleId": "MY-MATH-TAX-INCLUSIVE",
            "text": "TaxInclusiveAmount (1436.50) != TaxExclusiveAmount + total TaxAmount (1524.13).",
            "location": "cac:LegalMonetaryTotal/cbc:TaxInclusiveAmount",
            "occurrences": 1
        },
        {
            "level": "info",
            "ruleId": "MY-SIG-CERT",
            "text": "Embedded signing certificate: subject '1.2.840.113549.1.9.1=#1616616e61732e6140666776686f6c64696e67732e636f6d,2.5.4.5=#1309443132333435363738,CN=Dummy,OU=Test Unit eInvoice,2.5.4.97=#130c433239373032363335303630,O=Dummy,C=MY', issuer 'CN=Trial LHDNM Sub CA V1,OU=Terms of use at http://www.posdigicert.com.my,O=LHDNM,C=MY'.",
            "location": "ds:X509Certificate",
            "occurrences": 1
        },
        {
            "level": "info",
            "ruleId": "MY-SIG-EKU",
            "text": "Certificate carries the Document Signing EKU (1.3.6.1.4.1.311.10.3.12).",
            "location": "ds:X509Certificate",
            "occurrences": 1
        },
        {
            "level": "warning",
            "ruleId": "MY-SIG-CERT-VALIDITY",
            "text": "Signing certificate is outside its validity window (Thu Jun 06 02:52:36 UTC 2024 .. Fri Sep 06 02:52:36 UTC 2024): CertificateExpiredException.",
            "location": "ds:X509Certificate",
            "occurrences": 1
        },
        {
            "level": "info",
            "ruleId": "MY-SIG-CERTDIGEST",
            "text": "XAdES SigningCertificate/CertDigest matches SHA-256 of the embedded certificate.",
            "location": "xades:SigningCertificate",
            "occurrences": 1
        },
        {
            "level": "info",
            "ruleId": "MY-SIG-ISSUERSERIAL",
            "text": "XAdES IssuerSerial serial number matches the embedded certificate.",
            "location": "xades:IssuerSerial",
            "occurrences": 1
        },
        {
            "level": "info",
            "ruleId": "MY-SIG-DOC-DIGEST",
            "text": "Document digest VERIFIES: recomputed SHA-256 over the minified document (UBLExtensions and cac:Signature removed, inclusive Canonical XML) matches the signed DigestValue.",
            "location": "ds:Reference[@URI='']",
            "occurrences": 1
        },
        {
            "level": "warning",
            "ruleId": "MY-SIG-PROPS-DIGEST",
            "text": "SignedProperties digest MISMATCH: signed DigestValue Tc9oNX8EuNQohWVDZeaPOHmeBU5tuwVdwIRyfltnTPw= does not match the recomputed SHA-256 (exclusive b0VXjdpRrf5OQt96gzaFM1e8I9/+1qC5uFfI8eK8zjY= / inclusive vjjXqMNokPtL5qvfFj4irmcxCjxyVuirMVVe3KCKXBw=).",
            "location": "ds:Reference[@URI='#id-xades-signed-props']",
            "occurrences": 1
        },
        {
            "level": "warning",
            "ruleId": "MY-SIG-VALUE",
            "text": "SignatureValue does NOT verify: RSA-SHA256 over the canonicalized SignedInfo does not match the embedded certificate's public key.",
            "location": "ds:SignatureValue",
            "occurrences": 1
        },
        {
            "level": "info",
            "ruleId": "MY-SIG-TRUST",
            "text": "Trust chain to a Malaysian (LHDN/Pos Digicert) CA is NOT verified here; this requires the LHDNM CA/root list and, for full assurance, an online LHDN check. Structure and the embedded-certificate crypto are checked offline.",
            "location": null,
            "occurrences": 1
        }
    ]
}
Validate e-invoice — CODE SNIPPETS

curl --location --request POST 'https://zylalabs.com/api/13423/malaysia+myinvois+e-invoice+validator+api/29079/validate+e-invoice' --header 'Authorization: Bearer YOUR_API_KEY' 

--data-raw '
  
    
      urn:oasis:names:specification:ubl:dsig:enveloped:xades
      
        
          
            urn:oasis:names:specification:ubl:signature:1
            urn:oasis:names:specification:ubl:signature:Invoice
            
              
                
                
                
                  
                    
                      not(//ancestor-or-self::ext:UBLExtensions)
                    
                    
                      not(//ancestor-or-self::cac:Signature)
                    
                    
                  
                  
                  fRaWJINS9sB9aSl/MhCjMsdVMFpLwnxstpPhJkJwkU4=
                
                
                  
                  Tc9oNX8EuNQohWVDZeaPOHmeBU5tuwVdwIRyfltnTPw=
                
              
              kZhLB843E/sJEd66jI1lcfRheCZXaaHs9EjYOktMy9f/QmK7f4rFKcK24lqdcr+upqNbgRBJy3ahPnEv/AMb+ncklAkkxj2bOeVtUhi3wgh7pF0UUFoGFGb49sHRf9wEJ/IMMhiCs+weOSzVUCPiUGszFxwfyDps+ft5ZEKU3m1pIG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wYBBQUHAwQGCisGAQQBgjcKAwwwEQYDVR0OBAoECEDwms66hrpiMFMGA1UdIARMMEowSAYJKwYBBAGDikUBMDswOQYIKwYBBQUHAgEWLWh0dHBzOi8vd3d3LnBvc2RpZ2ljZXJ0LmNvbS5teS9yZXBvc2l0b3J5L2NwczATBgNVHSMEDDAKgAhNf9lrtsUI0DAOBgNVHQ8BAf8EBAMCBkAwRAYDVR0fBD0wOzA5oDegNYYzaHR0cDovL3RyaWFsY3JsLnBvc2RpZ2ljZXJ0LmNvbS5teS9UcmlhbExIRE5NVjEuY3JsMA0GCSqGSIb3DQEBCwUAA4ICAQBwptnIb1OA8NNVotgVIjOnpQtowew87Y0EBWAnVhOsMDlWXD/s+BL7vIEbX/BYa0TjakQ7qo4riSHyUkQ+X+pNsPEqolC4uFOp0pDsIdjsNB+WG15itnghkI99c6YZmbXcSFw9E160c7vG25gIL6zBPculHx5+laE59YkmDLdxx27e0TltUbFmuq3diYBOOf7NswFcDXCo+kXOwFfgmpbzYS0qfSoh3eZZtVHg0r6uga1UsMGb90+IRsk4st99EOVENvo0290lWhPBVK2G34+2TzbbYnVkoxnq6uDMw3cRpXX/oSfya+tyF51kT3iXvpmQ9OMF3wMlfKwCS7BZB2+iRja/1WHkAP7QW7/+0zRBcGQzY7AYsdZUllwYapsLEtbZBrTiH12X4XnZjny9rLfQLzJsFGT7Q+e02GiCsBrK7ZHNTindLRnJYAo4U2at5+SjqBiXSmz0DG+juOyFkwiWyD0xeheg4tMMO2pZ7clQzKflYnvFTEFnt+d+tvVwNjTboxfVxEv2qWF6qcMJeMvXwKTXuwVI2iUqmJSzJbUY+w3OeG7fvrhUfMJPM9XZBOp7CEI1QHfHrtyjlKNhYzG3IgHcfAZUURO16gFmWgzAZLkJSmCIxaIty/EmvG5N3ZePolBOa7lNEH/eSBMGAQteH+Twtiu0Y2xSwmmsxnfJyw==
                
              
              
                
                  
                    
                      2024-07-23T16:31:06Z
                      
                        
                          
                            
                            KKBSTyiPKGkGl1AFqcPziKCEIDYGtnYUTQN4ukO7G40=
                          
                          
                            CN=Trial LHDNM Sub CA V1, OU=Terms of use at http://www.posdigicert.com.my, O=LHDNM, C=MY
                            162880276254639189035871514749820882117
                          
                        
                      
                    
                  
                
              
            
          
        
      
    
  
  XML-INV12345
  2024-07-23
  00:40:00Z
  01
  MYR
  MYR
  
    2024-07-01
    2024-07-31
    Monthly
  
  
    
      151891-1981
    
  
  
    L1
    CustomsImportForm
  
  
    FTA
    FreeTradeAgreement
    Sample Description
  
  
    L1
    K2
  
  
    L1
  
  
    urn:oasis:names:specification:ubl:signature:Invoice
    urn:oasis:names:specification:ubl:dsig:enveloped:xades
  
  
    CPT-CCN-W-211111-KL-000002
    
      46510
      
        Supplier's TIN
      
      
        Supplier's BRN
      
      
        NA
      
      
        NA
      
      
        Kuala Lumpur
        50480
        14
        
          Lot 66
        
        
          Bangunan Merdeka
        
        
          Persiaran Jaya
        
        
          MYS
        
      
      
        Supplier's Name
      
      
        +60123456789
        [email protected]
      
    
  
  
    
      
        Buyer's TIN
      
      
        Buyer's BRN
      
      
        NA
      
      
        NA
      
      
        Kuala Lumpur
        50480
        14
        
          Lot 66
        
        
          Bangunan Merdeka
        
        
          Persiaran Jaya
        
        
          MYS
        
      
      
        Buyer's Name
      
      
        +60123456780
        [email protected]
      
    
  
  
    
    
      Recipient's TIN
    
    
      Recipient's BRN
    
    
      Kuala Lumpur
      50480
      14
      
        Lot 66
      
      
        Bangunan Merdeka
      
      
        Persiaran Jaya
      
      
        MYS
      
    
    
      Recipient's Name
    
    
    
      1234
      
        true
        Service charge
        100
      
    
  
  
    01
    
      1234567890
    
  
  
    Payment method is cash
  
  
    E12345678912
    1.00
    2024-07-23
    00:30:00Z
  
  
    false
    Sample Description
    100
  
  
    true
    Service charge
    100
  
  
    87.63
    
      87.63
      87.63
      
        01
        
          OTH
        
      
    
  
  
    1436.50
    1436.50
    1436.50
    1436.50
    1436.50
    0.30
    1436.50
  
  
    1234
    1
    1436.50
    
      false
      Sample Description
      0.15
      100
    
    
      true
      Sample Description
      0.10
      100
    
    
      0
      
        1460.50
        0
        6.00
        
          E
          Exempt New Means of Transport
          
            OTH
          
        
      
    
    
      Laptop Peripherals
      
        MYS
      
      
        9800.00.0010
      
      
        003
      
    
    
      17
    
    
      100
    
  
'

    

API Access Key & Authentication

After signing up, every developer is assigned a personal API access key, a unique combination of letters and digits provided to access to our API endpoint. To authenticate with the Malaysia MyInvois E-Invoice Validator API simply include your bearer token in the Authorization header.

Headers
Header Description
Authorization Required Should be Bearer access_key. See "Your API Access Key" above when you are subscribed.

No long-term commitment. Upgrade, downgrade, or cancel anytime. Free Trial includes up to 50 requests.

(Save 2 months with annual billing 🎉)

🚀 Enterprise Plan

Starts at
$ 10,000/Year


  • Custom Volume
  • Custom Rate Limit
  • Specialized Customer Support
  • Real-Time API Monitoring

Overview

Keyless Malaysia MyInvois (LHDN) e-invoice validator: official UBL 2.1 XSD, code lists, totals math, XAdES signature check. POST XML or JSON, get a rule-coded JSON report. No LHDN account.

Malaysia MyInvois E-Invoice Validator API FAQs

The GET Health check endpoint returns a simple JSON object indicating the service status, while the POST Validate e-invoice endpoint returns a detailed JSON validation report that includes fields like "valid," "wellFormed," "documentType," "errorCount," and "findings" with specific rule-coded messages.

Key fields in the POST Validate e-invoice response include "valid" (boolean), "wellFormed" (boolean), "documentType" (string), "errorCount" (integer), "warningCount" (integer), and "findings" (array of detailed validation results).

The returned data is in JSON format. The structure includes a top-level object with fields for validation status, counts of errors and warnings, and an array of findings, each containing details like "level," "ruleId," "text," and "location."

The GET Health check provides service status, while the POST Validate e-invoice offers comprehensive validation results, including compliance with UBL 2.1 XSD, mandatory fields, LHDN code lists, and XAdES signature checks.

The API supports both XML (application/xml) and JSON (application/json) formats for the POST Validate e-invoice endpoint. The format is auto-detected based on the request body.

The response data is organized into a JSON object with key-value pairs. The "findings" field contains an array of objects, each detailing specific validation issues, categorized by severity (info, warning, error) and associated rule IDs.

Typical use cases include validating e-invoices for compliance with Malaysian regulations, ensuring proper formatting and structure, and checking for mathematical accuracy in totals and tax calculations.

Users can analyze the "valid" and "wellFormed" fields to determine invoice compliance. The "findings" array provides actionable insights for correcting issues, while "errorCount" and "warningCount" help prioritize necessary adjustments.

No. The validator is keyless: no LHDN account, no digital certificate, no token. You POST the invoice, you get a JSON report. Nothing is submitted to LHDN.

UBL 2.1 XML (Content-Type: application/xml) and MyInvois JSON (application/json). The format is auto-detected and the same LHDN rules are applied to both.

General FAQs

To obtain your API key, first sign in to your account and navigate to the API you want to use. From the API's Pricing section, choose a plan and complete the subscription process. Once subscribed, return to the API page and you will see your API Access Key displayed at the top of the documentation page. You can use this key to authenticate your requests.

You can’t switch APIs during the free trial. If you subscribe to a different API, your trial will end and the new subscription will start as a paid plan.

The free trial lasts for 7 days and allows you to make up to 50 API requests.

No, the free trial is available only once, so we recommend using it on the API that interests you the most. Most of our APIs offer a free trial, but some may not include this option.

Yes. If the API offers a free trial, you will see a "Free 7-Day Trial" option in its Pricing section. The trial lasts for 7 days and allows up to 50 API requests, enabling you to evaluate the API before subscribing to a paid plan.

Zyla API Hub is like a big store for APIs, where you can find thousands of them all in one place. We also offer dedicated support and real-time monitoring of all APIs. Once you sign up, you can pick and choose which APIs you want to use. Just remember, each API needs its own subscription. But if you subscribe to multiple ones, you'll use the same key for all of them, making things easier for you.

Prices are listed in USD (United States Dollar), EUR (Euro), CAD (Canadian Dollar), AUD (Australian Dollar), and GBP (British Pound). We accept all major debit and credit cards. Our payment system uses the latest security technology and is powered by Stripe, one of the world's most reliable payment companies. If you have any trouble paying by card, just contact us at [email protected]

Additionally, if you already have an active subscription in any of these currencies (USD, EUR, CAD, AUD, GBP), that currency will remain for subsequent subscriptions. You can change the currency at any time as long as you don't have any active subscriptions.
The local currency shown on the pricing page is based on the country of your IP address and is provided for reference only. The actual prices are in USD (United States Dollar). When you make a payment, the charge will appear on your card statement in USD, even if you see the equivalent amount in your local currency on our website. This means you cannot pay directly with your local currency.
Occasionally, a bank may decline the charge due to its fraud protection settings. We suggest reaching out to your bank initially to check if they are blocking our charges. Also, you can access the Billing Portal and change the card associated to make the payment. If these does not work and you need further assistance, please contact our team at [email protected]
Prices are determined by a recurring monthly or yearly subscription, depending on the chosen plan.
API calls are deducted from your plan based on successful requests. Each plan comes with a specific number of calls that you can make per month. Only successful calls, indicated by a Status 200 response, will be counted against your total. This ensures that failed or incomplete requests do not impact your monthly quota.
Zyla API Hub works on a recurring monthly subscription system. Your billing cycle will start the day you purchase one of the paid plans, and it will renew the same day of the next month. So be aware to cancel your subscription beforehand if you want to avoid future charges.
To upgrade your current subscription plan, simply go to the pricing page of the API and select the plan you want to upgrade to. The upgrade will be instant, allowing you to immediately enjoy the features of the new plan. Please note that any remaining calls from your previous plan will not be carried over to the new plan, so be aware of this when upgrading. You will be charged the full amount of the new plan.
To check how many API calls you have left for the current month, refer to the 'X-Zyla-API-Calls-Monthly-Remaining' field in the response header. For example, if your plan allows 1,000 requests per month and you've used 100, this field in the response header will indicate 900 remaining calls.

You can monitor your API usage through the response headers included with every request:

x-zyla-api-calls-monthly-used: Shows the total number of API requests you have used during the current billing period.
x-zyla-api-calls-monthly-remaining: Shows the number of API requests you have remaining for the current billing period.

The 'X-Zyla-RateLimit-Reset' header shows the number of seconds until your rate limit resets. This tells you when your request count will start fresh. For example, if it displays 3,600, it means 3,600 seconds are left until the limit resets.

Yes, you can cancel your subscription at any time. Simply go to the Pricing section of the API you're subscribed to and click the "Unsubscribe" button.

Please note that upgrades, downgrades, and cancellations take effect immediately. Once your subscription is canceled, access to the service will end immediately, regardless of any remaining API calls in your quota.

After 7 days, you will be charged the full amount for the plan you were subscribed to during the trial. Therefore, it's important to cancel before the trial period ends. Refund requests for forgetting to cancel on time are not accepted.
When you subscribe to an API free trial, you can make up to 50 API calls. If you wish to make additional API calls beyond this limit, the API will prompt you to perform an "Start Your Paid Plan." You can find the "Start Your Paid Plan" button in your profile under Subscription -> Choose the API you are subscribed to -> Pricing tab.
You can contact us through our chat channel to receive immediate assistance. We are always online from 8 am to 5 pm (EST). If you reach us after that time, we will get back to you as soon as possible. Additionally, you can contact us via email at [email protected]

Please have a look at our Refund Policy: https://zylalabs.com/terms#refund


Related APIs