E-Invoicing for Malaysia API References


Introduction

Welcome to the comprehensive API reference for our Malaysian E-Invoicing system. This documentation is designed to help you seamlessly integrate with our platform and streamline your invoicing processes, ensuring compliance with Malaysia's regulatory requirements.

Our E-Invoicing API provides a robust and secure solution for managing electronic invoices in Malaysia. It supports all aspects of the invoicing lifecycle, from creation and submission to validation and archiving. With a focus on sustainability and innovation, our API helps businesses optimize their financial operations while adhering to the latest e-invoicing standards set by Malaysian authorities.

To get started, you will have to obtain client_id and client_secret from LHDN and use our onbaording API to get yourself connected to MyInvois Portal. This client_credentials can be obtained by submitting a request via email to [sdkmyinvois@hasil.gov.my] together with all the information listed below:

  1. Tax Identification Number (TIN) - excluding Employer’s (E) No.
  2. New Business Registration Number
  3. Company Name
  4. Company Email Address
  5. Name of SP (Solution Provider) as Flick Solutions Sdn. Bhd

POST/api/einvoice/onboard

Onboard Flick as your SP

This endpoint allows you to onboard Flick as your Intermediary System / Service Provider. In this step, we will be generating a access_token from LHDN for further trusted communications on behalf of you.

Request Body

  • Name
    registered_name
    Type
    string: mandatory (limit: 300 chars)
    Description

    Registred Name of Supplier’s business

  • Name
    tin_number
    Type
    string: mandatory (limit: 14 chars)
    Description

    Tax Identification Number (TIN) of the entity that is being onboarded.

  • Name
    other_ids
    Type
    struct{}: mandatory
    Description

    For all SST registrants, SST Number is Mandatory. For businesses, Business registration number is Mandatory. For Malaysian individuals, any of the NRIC Identification like MyKad/MyKAS/MyPR is necessary. If you are a non-Malaysian individual then Passport number is mandatory. If you have a MyTentera number, then it should also be shared. Tourism tax registration number for tourism tax registrant, which may consist of hotel operators and online travel operators.

  • Name
    sst
    Type
    string: mandatory if applicable (limit: 35 chars)
    Description
  • Name
    brn
    Type
    string: mandatory if applicable (limit: 20 chars)
    Description
  • Name
    nric
    Type
    string: mandatory if applicable (limit: 12 chars)
    Description
  • Name
    passport
    Type
    string: mandatory if applicable (limit: 12 chars)
    Description
  • Name
    army
    Type
    string: mandatory if applicable (limit: 12 chars)
    Description
  • Name
    ttx
    Type
    string: mandatory if applicable (limit: 17 chars)
    Description
  •   {
        "sst": "A01-2345-67891012", // SST Registeration Number
        "brn": "202001234567", // Business Registration Number
        "nric": "770305-02-1234", // MyKad/MyPR/MyKAS Number
        "passport": "A12345678", // Passport Number
        "army": "T123456789012", // MyTentera Number
        "ttx": "123-4567-89012345" // Tourism Tax Registration Number
      }
    
  • Name
    msic_code
    Type
    string: mandatory (5 chars)
    Description

    5-digit code that represent the Supplier’s business nature and activity. Please refer: (https://sdk.myinvois.hasil.gov.my/codes/msic-codes/)

  • Name
    industry
    Type
    string: mandatory (limit: 300 chars)
    Description

    Description of the Supplier’s business activity

  • Name
    city
    Type
    string: mandatory (limit: 50 chars)
    Description

    Registered City of the supplier.

  • Name
    street
    Type
    string: mandatory (limit: 150 chars)
    Description

    Street details of the supplier. If not available, provide 'NA'.

  • Name
    state
    Type
    string: mandatory (2 chars)
    Description

    SubEntity/State Code. Please refer: (https://sdk.myinvois.hasil.gov.my/codes/state-codes/)

  • Name
    country
    Type
    string: mandatory (3 chars)
    Description

    Country of the supplier. Please refer (https://sdk.myinvois.hasil.gov.my/codes/countries/)

  • Name
    contact_number
    Type
    string: mandatory (limit: 20 chars)
    Description

    The telephone number of the Supplier (e.g., office, mobile, fax). Following the E.164 standard (https://www.itu.int/rec/T-REC-E.164).

  • Name
    client_id
    Type
    string: mandatory
    Description

    Client ID for the Service Provider.

  • Name
    client_secret
    Type
    string: mandatory
    Description

    Client secret for the Serviec Provider.

Sample Request

POST
/api/einvoice/onboard
curl 
  --url https://sandbox-my.flick.network/api/einvoice/onboard \
  --header 'x-flick-auth-key: {token}' \
  --header 'Content-Type: application/json' \
  --data '
  {
    "registered_name": "ABC Demo Company Sdn. Bhd.",
    "tin_number": "C12345678910",
    "other_ids": {
      "brn": "202001234567",
      "sst": "A01-2345-67891012"
    },
    "msic_code": "20121",
    "industry": "Manufacture of fertilizers",
    "city": "Kuala Lumpur",
    "street": "Jalan Alor",
    "state": "14",
    "country": "MYS",
    "contact_number": "+60-123456789",
    "client_id": "dcf589e3-d1bb-4f2e-83d2-d5cb4ee1bfcf",
    "client_secret": "34bf56fc-bf02-41cb-af5e-4c0e22ee49f5"
  }'

Sample Response

200
Success
{
  "status": "success",
  "message": "Successfully Onboarded & Access Token generated for ABC Demo Company Sdn. Bhd.",
  "data": {
    "supplier_uuid": "f4b173a9-9f0f-4850-b682-762290885fee"
  }
}

POST/api/einvoice/validate-tin

Validate Taxpayer's TIN

This endpoint allows you to validate specific Tax Identification Number (TIN) and related IDs before adding this number to an invoice and issuing the invoice.

Request Body

  • Name
    tin_number
    Type
    string: mandatory
    Description

    The Tax Identification Number to get the validity of the tin.

  • Name
    id_type
    Type
    enum: mandatory [BRN, NRIC, PASSPORT, ARMY]
    Description

    It can be NRIC, Passport number, Business registration number, army number etc

  • Name
    id_value
    Type
    string: mandatory
    Description

    The actual value of the ID Type selected.

Sample Request

POST
/api/einvoice/validate-tin
curl 
  --url https://sandbox-my.flick.network/api/einvoice/validate-tin \
  --header 'x-flick-auth-key: {token}' \
   --header 'supplier_uuid: {supplier_uuid}' \
  --header 'Content-Type: application/json' \
  --data '
  {
    "tin_number": "C25845632020",
    "id_type": "NRIC",
    "id_value": "770625015324"
  }'

Sample Response

200/404
Success/Not Found
{
  "status": "success",
  "message": "TIN & NRIC ID validated successfully"
}

POST/api/einvoice/generate/invoice

Submit an Invoice

To Generate a new E-Invoice Document, this endpoint can be used along with the Supplier UUID to which it belongs to. Specify transport_mode for proper delivery of the document.

Request Body

  • Name
    ID
    Type
    string: mandatory (limit: 50 chars)
    Description

    Unique Invoice Reference Number. This should be made in sequence.

  • Name
    IssueDate
    Type
    date: mandatory, schema: YYYY-MM-DD
    Description

    Date on which the invoice was issued.

  • Name
    IssueTime
    Type
    time: mandatory, schema: HH-MM-ssZ
    Description

    Time at which the invoice was issued. Keep it in UTC format.

  • Name
    InvoiceTypeCode
    Type
    enum: mandatory
    Description

    Document Type to be specified.

    enumdescription
    01Invoice
    02Credit Note
    03Debit Note
    04Refund Note
  • Name
    InvoiceTotal
    Type
    number: optional
    Description

    If you want to make rounding to stay total aligned, please pass the total of Invoice including all taxes.

  • Name
    DocumentCurrencyCode
    Type
    string: mandatory (3 chars)
    Description

    Currency in which Invoice was issued. Default value: MYR. Please see the list of currency code in LHDN Documentation

  • Name
    TaxExchangeRate
    Type
    string: mandatory if applicable
    Description

    Rate at which non-Malaysian currency will be converted into Malaysian Ringgit. This is required when DocumentCurrencyCode is not MYR

  • Name
    InvoiceDocumentReference
    Type
    array: mandatory if applicable
    Description

    In case of Credit Note, Debit Note and Refund Note, it is mandatory to reference which that dodcument relates to.

    • UUID mandatory: IRBM Unique Identifier Number of the Invoice to which this credit note refers to.
    • InternalID mandatory: Internal ID / e-Invoice Code / Number to which this credit note belongs to.
     "InvoiceDocumentReference": [{
       "UUID": "71E88663PY17SQ9JZ48NYM0J10",
       "InternalID": "INV12345"
     }]
    
  • Name
    Discounts
    Type
    array: optional
    Description

    Document level discounts need to be shown here. It is an optional tag and can be skipped if there is no discounts involved.

  • Name
    Charges
    Type
    array: optional
    Description

    Document level charges or fees need to be shown here. It is an optional tag and can be skipped if there is no charges involved.

  • Both Discounts and Charges Should have the schema as specified below:

     [{
       "Amount": 100, // Amount to be adjusted from total txable
       "Reason": "Flat Discount / Service Fee Charged", // Reason
     }]
    
  • Name
    Prepayments
    Type
    array: optional
    Description

    Prepayments related this specific invoice need to me mentioned here. It is an optional tag.

     [{
       "PaymentID": "REC1012", 
       "Amount": 100, 
       "Date": "2024-01-10", 
       "Time": "12:00:00Z", 
     }]
    
  • Name
    CustomsImportForm
    Type
    string: mandatory if applicable
    Description

    Unique identifier assigned on the Declaration of Goods Imported.The input of special characters is not allowed. (limit: 19 chars)

  • Name
    Incoterms
    Type
    string: optional
    Description

    A set of international trade rules that define the responsibilities of buyers and suppliers.The input of special characters is not allowed. (limit: 3 chars)

  • Name
    CustomerParty
    Type
    strcut: mandatory
    Description

    Details of customers to which this Invoice is being issued to.

    1. LegalName string: mandatory (limit: 300 chars): Official name of Customer
    2. CustomerTIN string: mandatory (limit: 14 chars): TIN Number of Customer
    • EI00000000010 - For General Public
    • EI00000000020 - For Foreign Buyer’s/Foreign Shipping Recipient’s TIN
    1. Any one of the below is mandatory
    tagdescription
    CustomerBRNValid BRN if Customer is a Business
    CustomerNRICValid NRIC (MyKad/MyKAS/MyPR) if its an Individual
    CustomerPassportValid Passport ID if Customer is a Non-Malaysian
    CustomerArmyIDValid MyTentera ID if Customer is having one
    1. CustomerSST string: optional (limit: 35 chars): If they are SST Registered
    2. CityName string: mandatory (limit: 300 chars): City of Customer
    3. AddressLines[] mandatory: min 1, max 3: Address Details of the Customer. One line is mandatory. Provide 'NA' if not recognizable.
    4. CountrySubentityCode string: mandatory (2 chars): Subentity Code from authority. 17 can be given if not applicable in case of foreign buyers. Please refer LHDN Documentation
    5. CountryCode string: mandatory (3 chars): Country of Customer. For codes, please refer LHDN Documentation
    6. Telephone string: mandatory (limit: 20 chars): Contact Number of Customer
    7. Email string: optional (limit: 300 chars): Email Address of Customer
  • Name
    DeliveryDetails
    Type
    strcut: optional
    Description

    Details of receipient to which this Invoice is being delivered to.

    1. RecipientName string: mandatory (limit: 300 chars): Official name of receipient
    2. RecipientTIN string: mandatory (limit: 14 chars): TIN Number of receipient
    3. Any one of the below is mandatory
    tagdescription
    RecipientBRNValid BRN if Customer is a Business
    RecipientNRICValid NRIC (MyKad/MyKAS/MyPR) if its an Individual
    RecipientPassportValid Passport ID if Customer is a Non-Malaysian
    RecipientArmyIDValid MyTentera ID if Customer is having one
    1. RecipientSST string: optional (limit: 35 chars): If they are SST Registered
    2. CityName string: mandatory (limit: 300 chars): City of receipient
    3. AddressLines[] mandatory: min 1, max 3: Address Details of the receipient. One line is mandatory. Provide 'NA' if not recognizable.
    4. CountrySubentityCode string: mandatory (2 chars): Subentity Code from authority. 17 can be given if not applicable in case of foreign buyers. Please refer LHDN Documentation
    5. CountryCode string: mandatory (3 chars): Country of receipient. For codes, please refer LHDN Documentation
    6. ShipmentID string: optional (limit: 50 chars): Shipping ID if any.
    7. ShipmentCharges array: optional[if given, at least one]: Amount and Reason of such a charge need to be given.
  • Name
    InvoiceLines
    Type
    array: mandatory
    Description

    Details of line items in the document as an array. At least one item is mandatory in an Invoice. Each elemnt in this array must have:

    1. Description string: mandatory (limit: 300 chars): Item Name
    2. InvoicedQuantity number: mandatory: Quantity of Items
    3. UOM string: optional: Default: "C62". If you want to specify, then you can use any of the code given in: (https://sdk.myinvois.hasil.gov.my/codes/unit-types/)
    4. PriceAmount number: mandatory: Unit Price of Items
    5. LineTaxes array: mandatory: Taxes in each Line item
    codedescription
    01Sales Tax
    02Service Tax
    03Tourism Tax
    04High-Value Goods Tax
    05Sales Tax on Low Value Goods
    06Not Applicable
    ETax exemption (where applicable)
    • TaxExemptionReason string: mandatory if applicable: If TaxType is 'E', then TaxExemptionReason is mandatory.
    • TaxRate number: optional: 0.10 for 10% of Tax Rate [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
    • TaxBaseUnit number: optional: Units that have Tax applied [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
    • TaxPerUnit number: mandatory: Per unit tax to be considered [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
     [
       {
         "TaxType": "01",
         "TaxBaseUnit": 1,
         "TaxPerUnit": 10
       },
       {
         "TaxType": "E",
         "TaxRate": 0,
         "TaxExemptionReason": "Exempt New Means of Transport"
       }
     ]
    
    1. ClassificationCode array: mandatory ([] each has limit of: 3 chars): The 3 digit number of classification. Please refer LHDN Documentation
    2. Discounts array: optional: Line item level discounts need to be passed here. It is an optional tag and can be skipped if there is no discounts involved.
    3. Charges array: optional: Line item level charges/fees need to be passed here. It is an optional tag and can be skipped if there is no charges/fees involved.

    Both Discounts and Charges Should have the schema as specified below:

     [{
       "Amount": 100, // Amount to be adjusted from line total
       "Reason": "Discount / Item Service Fee", // Reason text
     }]
    

Sample Request

POST
/api/einvoice/generate/invoice
curl --url https://sandbox-my.flick.network/api/einvoice/generate/invoice \
  --header 'x-flick-auth-key: {token}' \
  --header 'supplier_uuid: {supplier_uuid}' \
  --header 'transport_mode: peppol' \
  --header 'Content-Type: application/json' \
  --data '
    {
      "ID": "INV12345",
      "IssueDate": "2024-01-26",
      "IssueTime": "15:30:00Z",
      "InvoiceTypeCode": "01",
      "DocumentCurrencyCode": "MYR",
      "CustomerParty": {
        "LegalName": "Hebat Group",
        "CustomerTIN": "C25845632100",
        "CustomerBRN":"202121111111",
        "CityName": "Kuala Lumpur",
        "PostalZone": "50480",
        "CountrySubentityCode": "14",
        "AddressLines": [
          "Lot 66"
        ],
        "CountryCode": "MYS",
        "Telephone": "+60-123456789"
      },
      "DeliveryDetails": {
        "RecipientName": "Hebat Group",
        "RecipientTIN": "C25845632100",
        "RecipientBRN":"202121111111",
        "CityName": "Kuala Lumpur",
        "PostalZone": "50480",
        "CountrySubentityCode": "14",
        "AddressLines": [
          "Lot 66"
        ],
        "CountryCode": "MYS",
        "Telephone": "+60-123456789",
        "ShipmentID": "TRN-INQ-001",
        "ShipmentCharges": [{
          "Amount": 100,
          "Reason": "Shipment Charges from KL to MK"
        }]
      },          
      "InvoiceLines": [
        {
          "Description": "Laptop Peripherals",
          "InvoicedQuantity": 1,
          "PriceAmount": 17,
          "LineTaxes":  [
            {
              "TaxType": "01",
              "TaxBaseUnit": 1,
              "TaxPerUnit": 10
            },
            {
              "TaxType": "E",
              "TaxRate": 0,
              "TaxExemptionReason": "Exempt New Means of Transport"
            }
          ],
          "ClassificationCode": ["001", "002", "003"]
        }
      ]
    }'

Sample Response

200
Success
{
  "status": "submitted",
  "data": {
    "submissionResponse": {
      "submissionUid": "GJ49979N7RCV2KAXDCH6ZK0J10",
      "acceptedDocuments": [
        {
          "uuid": "FRSS37P7NSM94970DCH6ZK0J10",
          "invoiceCodeNumber": "INV12345"
        }
      ],
      "rejectedDocuments": []
    }
  }
}

POST/api/einvoice/generate/invoice/bulk

Submit Invoices in Bulk

To submit E-Invoices in bulk, this endpoint can be used along with the Supplier UUID to which it belongs to. Specify transport_mode for proper delivery of the document.

Request Body

The request body should be an array of Documents[]. Each document will have the below schema:

  • Name
    ID
    Type
    string: mandatory (limit: 50 chars)
    Description

    Unique Invoice Reference Number. This should be made in sequence.

  • Name
    IssueDate
    Type
    date: mandatory, schema: YYYY-MM-DD
    Description

    Date on which the invoice was issued.

  • Name
    IssueTime
    Type
    time: mandatory, schema: HH-MM-ssZ
    Description

    Time at which the invoice was issued. Keep it in UTC format.

  • Name
    InvoiceTypeCode
    Type
    enum: mandatory
    Description

    Document Type to be specified.

    enumdescription
    01Invoice
    02Credit Note
    03Debit Note
    04Refund Note
  • Name
    InvoiceTotal
    Type
    number: optional
    Description

    If you want to make rounding to stay total aligned, please pass the total of Invoice including all taxes.

  • Name
    DocumentCurrencyCode
    Type
    string: mandatory (3 chars)
    Description

    Currency in which Invoice was issued. Default value: MYR. Please see the list of currency code in LHDN Documentation

  • Name
    TaxExchangeRate
    Type
    string: mandatory if applicable
    Description

    Rate at which non-Malaysian currency will be converted into Malaysian Ringgit. This is required when DocumentCurrencyCode is not MYR

  • Name
    InvoiceDocumentReference
    Type
    array: mandatory if applicable
    Description

    In case of Credit Note, Debit Note and Refund Note, it is mandatory to reference which that dodcument relates to.

    • UUID mandatory: IRBM Unique Identifier Number of the Invoice to which this credit note refers to.
    • InternalID mandatory: Internal ID / e-Invoice Code / Number to which this credit note belongs to.
     "InvoiceDocumentReference": [{
       "UUID": "71E88663PY17SQ9JZ48NYM0J10",
       "InternalID": "INV12345"
     }]
    
  • Name
    Discounts
    Type
    array: optional
    Description

    Document level discounts need to be shown here. It is an optional tag and can be skipped if there is no discounts involved.

  • Name
    Charges
    Type
    array: optional
    Description

    Document level charges or fees need to be shown here. It is an optional tag and can be skipped if there is no charges involved.

  • Both Discounts and Charges Should have the schema as specified below:

     [{
       "Amount": 100, // Amount to be adjusted from total txable
       "Reason": "Flat Discount / Service Fee Charged", // Reason
     }]
    
  • Name
    Prepayments
    Type
    array: optional
    Description

    Prepayments related this specific invoice need to me mentioned here. It is an optional tag.

     [{
       "PaymentID": "REC1012", 
       "Amount": 100, 
       "Date": "2024-01-10", 
       "Time": "12:00:00Z", 
     }]
    
  • Name
    CustomsImportForm
    Type
    string: mandatory if applicable
    Description

    Unique identifier assigned on the Declaration of Goods Imported.The input of special characters is not allowed. (limit: 19 chars)

  • Name
    Incoterms
    Type
    string: optional
    Description

    A set of international trade rules that define the responsibilities of buyers and suppliers.The input of special characters is not allowed. (limit: 3 chars)

  • Name
    CustomerParty
    Type
    strcut: mandatory
    Description

    Details of customers to which this Invoice is being issued to.

    1. LegalName string: mandatory (limit: 300 chars): Official name of Customer
    2. CustomerTIN string: mandatory (limit: 14 chars): TIN Number of Customer
    • EI00000000010 - For General Public
    • EI00000000020 - For Foreign Buyer’s/Foreign Shipping Recipient’s TIN
    1. Any one of the below is mandatory
    tagdescription
    CustomerBRNValid BRN if Customer is a Business
    CustomerNRICValid NRIC (MyKad/MyKAS/MyPR) if its an Individual
    CustomerPassportValid Passport ID if Customer is a Non-Malaysian
    CustomerArmyIDValid MyTentera ID if Customer is having one
    1. CustomerSST string: optional (limit: 35 chars): If they are SST Registered
    2. CityName string: mandatory (limit: 300 chars): City of Customer
    3. AddressLines[] mandatory: min 1, max 3: Address Details of the Customer. One line is mandatory. Provide 'NA' if not recognizable.
    4. CountrySubentityCode string: mandatory (2 chars): Subentity Code from authority. 17 can be given if not applicable in case of foreign buyers. Please refer LHDN Documentation
    5. CountryCode string: mandatory (3 chars): Country of Customer. For codes, please refer LHDN Documentation
    6. Telephone string: mandatory (limit: 20 chars): Contact Number of Customer
    7. Email string: optional (limit: 300 chars): Email Address of Customer
  • Name
    DeliveryDetails
    Type
    strcut: optional
    Description

    Details of receipient to which this Invoice is being delivered to.

    1. RecipientName string: mandatory (limit: 300 chars): Official name of receipient
    2. RecipientTIN string: mandatory (limit: 14 chars): TIN Number of receipient
    3. Any one of the below is mandatory
    tagdescription
    RecipientBRNValid BRN if Customer is a Business
    RecipientNRICValid NRIC (MyKad/MyKAS/MyPR) if its an Individual
    RecipientPassportValid Passport ID if Customer is a Non-Malaysian
    RecipientArmyIDValid MyTentera ID if Customer is having one
    1. RecipientSST string: optional (limit: 35 chars): If they are SST Registered
    2. CityName string: mandatory (limit: 300 chars): City of receipient
    3. AddressLines[] mandatory: min 1, max 3: Address Details of the receipient. One line is mandatory. Provide 'NA' if not recognizable.
    4. CountrySubentityCode string: mandatory (2 chars): Subentity Code from authority. 17 can be given if not applicable in case of foreign buyers. Please refer LHDN Documentation
    5. CountryCode string: mandatory (3 chars): Country of receipient. For codes, please refer LHDN Documentation
    6. ShipmentID string: optional (limit: 50 chars): Shipping ID if any.
    7. ShipmentCharges array: optional[if given, at least one]: Amount and Reason of such a charge need to be given.
  • Name
    InvoiceLines
    Type
    array: mandatory
    Description

    Details of line items in the document as an array. At least one item is mandatory in an Invoice. Each elemnt in this array must have:

    1. Description string: mandatory (limit: 300 chars): Item Name
    2. InvoicedQuantity number: mandatory: Quantity of Items
    3. UOM string: optional: Default: "C62". If you want to specify, then you can use any of the code given in: (https://sdk.myinvois.hasil.gov.my/codes/unit-types/)
    4. PriceAmount number: mandatory: Unit Price of Items
    5. LineTaxes array: mandatory: Taxes in each Line item
    codedescription
    01Sales Tax
    02Service Tax
    03Tourism Tax
    04High-Value Goods Tax
    05Sales Tax on Low Value Goods
    06Not Applicable
    ETax exemption (where applicable)
    • TaxExemptionReason string: mandatory if applicable: If TaxType is 'E', then TaxExemptionReason is mandatory.
    • TaxRate number: optional: 0.10 for 10% of Tax Rate [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
    • TaxBaseUnit number: optional: Units that have Tax applied [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
    • TaxPerUnit number: mandatory: Per unit tax to be considered [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
     [
       {
         "TaxType": "01",
         "TaxBaseUnit": 1,
         "TaxPerUnit": 10
       },
       {
         "TaxType": "E",
         "TaxRate": 0,
         "TaxExemptionReason": "Exempt New Means of Transport"
       }
     ]
    
    1. ClassificationCode array: mandatory ([] each has limit of: 3 chars): The 3 digit number of classification. Please refer LHDN Documentation
    2. Discounts array: optional: Line item level discounts need to be passed here. It is an optional tag and can be skipped if there is no discounts involved.
    3. Charges array: optional: Line item level charges/fees need to be passed here. It is an optional tag and can be skipped if there is no charges/fees involved.

    Both Discounts and Charges Should have the schema as specified below:

     [{
       "Amount": 100, // Amount to be adjusted from line total
       "Reason": "Discount / Item Service Fee", // Reason text
     }]
    

Sample Request

POST
/api/einvoice/generate/invoice/bulk
curl --url https://sandbox-my.flick.network/api/einvoice/generate/invoice/bulk \
  --header 'x-flick-auth-key: {token}' \
  --header 'supplier_uuid: {supplier_uuid}' \
  --header 'transport_mode: peppol' \
  --header 'Content-Type: application/json' \
  --data '
   [{
      "ID": "INV12345",
      "IssueDate": "2024-01-26",
      "IssueTime": "15:30:00Z",
      "InvoiceTypeCode": "01",
      "DocumentCurrencyCode": "MYR",
      "CustomerParty": {
        "LegalName": "Hebat Group",
        "CustomerTIN": "C25845632100",
        "CustomerBRN":"202121111111",
        "CityName": "Kuala Lumpur",
        "PostalZone": "50480",
        "CountrySubentityCode": "14",
        "AddressLines": [
          "Lot 66"
        ],
        "CountryCode": "MYS",
        "Telephone": "+60-123456789"
      },
      "InvoiceLines": [
        {
          "Description": "Laptop Peripherals",
          "InvoicedQuantity": 1,
          "PriceAmount": 17,
          "LineTaxes":  [
            {
              "TaxType": "01",
              "TaxBaseUnit": 1,
              "TaxPerUnit": 10
            },
            {
              "TaxType": "E",
              "TaxRate": 0,
              "TaxExemptionReason": "Exempt New Means of Transport"
            }
          ],
          "ClassificationCode": ["001", "002", "003"]
        }
      ]
    }]'

Sample Response

200
Success
{
  "status": "submitted",
  "data": {
    "submissionResponse": {
      "submissionUid": "GJ49979N7RCV2KAXDCH6ZK0J10",
      "acceptedDocuments": [
        {
          "uuid": "FRSS37P7NSM94970DCH6ZK0J10",
          "invoiceCodeNumber": "INV12345"
        }
      ],
      "rejectedDocuments": []
    }
  }
}

POST/api/einvoice/generate/invoice/consolidated

Report Consolidated Invoices

To Generate a new Credit Note, this endpoint can be used along with the Supplier UUID to which it belongs to. Specify transport_mode for proper delivery of the document.

Request Body

  • Name
    ID
    Type
    string: mandatory (limit: 50 chars)
    Description

    Unique Invoice Reference Number. This should be made in sequence.

  • Name
    IssueDate
    Type
    date: mandatory, schema: YYYY-MM-DD
    Description

    Date on which the invoice was issued.

  • Name
    IssueTime
    Type
    time: mandatory, schema: HH-MM-ssZ
    Description

    Time at which the invoice was issued. Keep it in UTC format.

  • Name
    InvoiceTypeCode
    Type
    enum: mandatory
    Description

    Document Type to be specified.

    enumdescription
    01Invoice
    02Credit Note
    03Debit Note
    04Refund Note
  • Name
    InvoiceTotal
    Type
    number: optional
    Description

    If you want to make rounding to stay total aligned, please pass the total of Invoice including all taxes.

  • Name
    DocumentCurrencyCode
    Type
    string: mandatory (3 chars)
    Description

    Currency in which Invoice was issued. Default value: MYR. Please see the list of currency code in LHDN Documentation

  • Name
    TaxExchangeRate
    Type
    string: mandatory if applicable
    Description

    Rate at which non-Malaysian currency will be converted into Malaysian Ringgit. This is required when DocumentCurrencyCode is not MYR

  • Name
    InvoiceDocumentReference
    Type
    array: mandatory if applicable
    Description

    In case of Credit Note, Debit Note and Refund Note, it is mandatory to reference which that dodcument relates to.

    • UUID mandatory: IRBM Unique Identifier Number of the Invoice to which this credit note refers to.
    • InternalID mandatory: Internal ID / e-Invoice Code / Number to which this credit note belongs to.
     "InvoiceDocumentReference": [{
       "UUID": "71E88663PY17SQ9JZ48NYM0J10",
       "InternalID": "INV12345"
     }]
    
  • Name
    Discounts
    Type
    array: optional
    Description

    Document level discounts need to be shown here. It is an optional tag and can be skipped if there is no discounts involved.

  • Name
    Charges
    Type
    array: optional
    Description

    Document level charges or fees need to be shown here. It is an optional tag and can be skipped if there is no charges involved.

  • Both Discounts and Charges Should have the schema as specified below:

     [{
       "Amount": 100, // Amount to be adjusted from total txable
       "Reason": "Flat Discount / Service Fee Charged", // Reason
     }]
    
  • Name
    Prepayments
    Type
    array: optional
    Description

    Prepayments related this specific invoice need to me mentioned here. It is an optional tag.

     [{
       "PaymentID": "REC1012", 
       "Amount": 100, 
       "Date": "2024-01-10", 
       "Time": "12:00:00Z", 
     }]
    
  • Name
    CustomsImportForm
    Type
    string: mandatory if applicable
    Description

    Unique identifier assigned on the Declaration of Goods Imported.The input of special characters is not allowed. (limit: 19 chars)

  • Name
    Incoterms
    Type
    string: optional
    Description

    A set of international trade rules that define the responsibilities of buyers and suppliers.The input of special characters is not allowed. (limit: 3 chars)

  • Name
    CustomerParty
    Type
    strcut: mandatory
    Description

    Details of customers to which this Invoice is being issued to.

    1. LegalName string: mandatory (limit: 300 chars): Official name of Customer
    2. CustomerTIN string: mandatory (limit: 14 chars): TIN Number of Customer
    • EI00000000010 - For General Public
    1. CustomerTIN string: mandatory (limit: 14 chars): NA for General Public.

    2. CityName string: mandatory (limit: 300 chars): NA for General Public

    3. AddressLines[] mandatory: min 1, max 3: Provide 'NA' if not recognizable.

    4. CountrySubentityCode string: mandatory (2 chars): Subentity Code from authority. 17 can be given if not applicable in case of General Public. Please refer LHDN Documentation

    5. CountryCode string: mandatory (3 chars): Country of Customer. For codes, please refer LHDN Documentation

    6. Telephone string: mandatory (limit: 20 chars): Contact Number of Customer

  • Name
    InvoiceLines
    Type
    array: mandatory
    Description

    Details of line items in the document as an array. At least one item is mandatory in an Invoice. Each elemnt in this array must have:

    1. Description string: mandatory (limit: 300 chars): Item Name
    2. InvoicedQuantity number: mandatory: Quantity of Items
    3. UOM string: optional: Default: "C62". If you want to specify, then you can use any of the code given in: (https://sdk.myinvois.hasil.gov.my/codes/unit-types/)
    4. PriceAmount number: mandatory: Unit Price of Items
    5. LineTaxes array: mandatory: Taxes in each Line item
    codedescription
    01Sales Tax
    02Service Tax
    03Tourism Tax
    04High-Value Goods Tax
    05Sales Tax on Low Value Goods
    06Not Applicable
    ETax exemption (where applicable)
    • TaxExemptionReason string: mandatory if applicable: If TaxType is 'E', then TaxExemptionReason is mandatory.
    • TaxRate number: optional: 0.10 for 10% of Tax Rate [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
    • TaxBaseUnit number: optional: Units that have Tax applied [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
    • TaxPerUnit number: mandatory: Per unit tax to be considered [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
     [
       {
         "TaxType": "01",
         "TaxBaseUnit": 1,
         "TaxPerUnit": 10
       },
       {
         "TaxType": "E",
         "TaxRate": 0,
         "TaxExemptionReason": "Exempt New Means of Transport"
       }
     ]
    
    1. ClassificationCode array: mandatory ([] each has limit of: 3 chars): The 3 digit number of classification. Please refer LHDN Documentation
    2. Discounts array: optional: Line item level discounts need to be passed here. It is an optional tag and can be skipped if there is no discounts involved.
    3. Charges array: optional: Line item level charges/fees need to be passed here. It is an optional tag and can be skipped if there is no charges/fees involved.

    Both Discounts and Charges Should have the schema as specified below:

     [{
       "Amount": 100, // Amount to be adjusted from line total
       "Reason": "Discount / Item Service Fee", // Reason text
     }]
    

Sample Request

POST
/api/einvoice/generate/invoice/consolidated
curl --url https://sandbox-my.flick.network/api/einvoice/generate/invoice/consolidated \
  --header 'x-flick-auth-key: {token}' \
  --header 'supplier_uuid: {supplier_uuid}' \
  --header 'transport_mode: peppol' \
  --header 'Content-Type: application/json' \
  --data '
    {
      "ID": "INV12345",
      "IssueDate": "2024-01-26",
      "IssueTime": "15:30:00Z",
      "InvoiceTypeCode": "01",
      "DocumentCurrencyCode": "MYR",
      "CustomerParty": {
        "LegalName": "General Public",
        "CustomerTIN": "EI00000000010",
        "CustomerBRN": "NA",
        "CityName": "NA",
        "CountrySubentityCode": "17",
        "AddressLines": [
          "NA"
        ],
        "CountryCode": "MYS",
        "Telephone": "NA"
      },
      "InvoiceLines": [
        {
          "Description": "INV1 - INV99",
          "InvoicedQuantity": 1,
          "PriceAmount": 17,
          "LineTaxes":  [
            {
              "TaxType": "01",
              "TaxBaseUnit": 1,
              "TaxPerUnit": 10
            },
            {
              "TaxType": "E",
              "TaxRate": 0,
              "TaxExemptionReason": "Exempt New Means of Transport"
            }
          ],
          "ClassificationCode": ["001", "002", "003"]
        },
        {
          "Description": "INV99 - INV199",
          "InvoicedQuantity": 1,
          "PriceAmount": 17,
          "LineTaxes":  [
            {
              "TaxType": "01",
              "TaxBaseUnit": 1,
              "TaxPerUnit": 10
            },
            {
              "TaxType": "E",
              "TaxRate": 0,
              "TaxExemptionReason": "Exempt New Means of Transport"
            }
          ],
          "ClassificationCode": ["001", "002", "003"]
        }
      ]
    }'

Sample Response

200
Success
{
  "status": "submitted",
  "data": {
    "submissionResponse": {
      "submissionUid": "GJ49979N7RCV2KAXDCH6ZK0J10",
      "acceptedDocuments": [
        {
          "uuid": "FRSS37P7NSM94970DCH6ZK0J10",
          "invoiceCodeNumber": "INV12345"
        }
      ],
      "rejectedDocuments": []
    }
  }
}

POST/api/einvoice/generate/self-billed-invoice

Submit a Self-Billed Invoice

To submit Self-Billed E-Invoice, this endpoint can be used along with the Supplier UUID to which it belongs to. Specify transport_mode for proper delivery of the document.

Request Body

  • Name
    ID
    Type
    string: mandatory (limit: 50 chars)
    Description

    Unique Invoice Reference Number. This should be made in sequence.

  • Name
    IssueDate
    Type
    date: mandatory, schema: YYYY-MM-DD
    Description

    Date on which the invoice was issued.

  • Name
    IssueTime
    Type
    time: mandatory, schema: HH-MM-ssZ
    Description

    Time at which the invoice was issued. Keep it in UTC format.

  • Name
    InvoiceTypeCode
    Type
    enum: mandatory
    Description

    Document Type to be specified.

    enumdescription
    11Self-Billed Invoice
    12Self-Billed Credit Note
    13Self-Billed Debit Note
    14Self-Billed Refund Note
  • Name
    InvoiceTotal
    Type
    number: optional
    Description

    If you want to make rounding to stay total aligned, please pass the total of Invoice including all taxes.

  • Name
    DocumentCurrencyCode
    Type
    string: mandatory (3 chars)
    Description

    Currency in which Invoice was issued. Default value: MYR. Please see the list of currency code in LHDN Documentation

  • Name
    TaxExchangeRate
    Type
    string: mandatory if applicable
    Description

    Rate at which non-Malaysian currency will be converted into Malaysian Ringgit. This is required when DocumentCurrencyCode is not MYR

  • Name
    InvoiceDocumentReference
    Type
    array: mandatory if applicable
    Description

    In case of Self-Billed Credit Note, Debit Note and Refund Note, it is mandatory to reference which that dodcument relates to.

    • UUID mandatory: IRBM Unique Identifier Number of the Invoice to which this credit note refers to.
    • InternalID mandatory: Internal ID / e-Invoice Code / Number to which this credit note belongs to.
     "InvoiceDocumentReference": [{
       "UUID": "71E88663PY17SQ9JZ48NYM0J10",
       "InternalID": "INV12345"
     }]
    
  • Name
    Discounts
    Type
    array: optional
    Description

    Document level discounts need to be shown here. It is an optional tag and can be skipped if there is no discounts involved.

  • Name
    Charges
    Type
    array: optional
    Description

    Document level charges or fees need to be shown here. It is an optional tag and can be skipped if there is no charges involved.

  • Both Discounts and Charges Should have the schema as specified below:

     [{
       "Amount": 100, // Amount to be adjusted from total txable
       "Reason": "Flat Discount / Service Fee Charged", // Reason
     }]
    
  • Name
    Prepayments
    Type
    array: optional
    Description

    Prepayments related this specific invoice need to me mentioned here. It is an optional tag.

     [{
       "PaymentID": "REC1012", 
       "Amount": 100, 
       "Date": "2024-01-10", 
       "Time": "12:00:00Z", 
     }]
    
  • Name
    CustomsImportForm
    Type
    string: mandatory if applicable
    Description

    Unique identifier assigned on the Declaration of Goods Imported.The input of special characters is not allowed. (limit: 19 chars)

  • Name
    Incoterms
    Type
    string: optional
    Description

    A set of international trade rules that define the responsibilities of buyers and suppliers.The input of special characters is not allowed. (limit: 3 chars)

  • Name
    SupplierParty
    Type
    strcut: mandatory
    Description

    Details of supplier against whom which the document is being issued.

    1. LegalName string: mandatory (limit: 300 chars): Official name of Supplier
    2. SupplierTIN string: mandatory (limit: 14 chars): TIN Number of Supplier
    • EI00000000010 - For General Public
    • EI00000000030 - Foreign Supplier’s TIN
    1. Any one of the below is mandatory
    tagdescription
    SupplierBRNValid BRN if Supplier is a Business
    SupplierNRICValid NRIC (MyKad/MyKAS/MyPR) if its an Individual
    SupplierPassportValid Passport ID if Supplier is a Non-Malaysian
    SupplierArmyIDValid MyTentera ID if Supplier is having one
    1. SupplierSST string: optional (limit: 35 chars): If they are SST Registered
    2. CityName string: mandatory (limit: 300 chars): City of Supplier
    3. AddressLines[] mandatory: min 1, max 3: Address Details of the Supplier. One line is mandatory. Provide 'NA' if not recognizable.
    4. CountrySubentityCode string: mandatory (2 chars): Subentity Code from authority. 17 can be given if not applicable in case of foreign buyers. Please refer LHDN Documentation
    5. CountryCode string: mandatory (3 chars): Country of Supplier. For codes, please refer LHDN Documentation
    6. Telephone string: mandatory (limit: 20 chars): Contact Number of Supplier.
    7. MSICCode string: mandatory (5 chars): MSCIC Code of Supplier. You can provide 00000 if not available.
    8. Industry string: mandatory (limit: 300 chars): Industry of the supplier.
    9. Email string: optional (limit: 300 chars): Email Address of Supplier
  • Name
    DeliveryDetails
    Type
    strcut: optional
    Description

    Details of receipient to which this Invoice is being delivered to.

    1. RecipientName string: mandatory (limit: 300 chars): Official name of receipient
    2. RecipientTIN string: mandatory (limit: 14 chars): TIN Number of receipient
    3. Any one of the below is mandatory
    tagdescription
    RecipientBRNValid BRN if Customer is a Business
    RecipientNRICValid NRIC (MyKad/MyKAS/MyPR) if its an Individual
    RecipientPassportValid Passport ID if Customer is a Non-Malaysian
    RecipientArmyIDValid MyTentera ID if Customer is having one
    1. RecipientSST string: optional (limit: 35 chars): If they are SST Registered
    2. CityName string: mandatory (limit: 300 chars): City of receipient
    3. AddressLines[] mandatory: min 1, max 3: Address Details of the receipient. One line is mandatory. Provide 'NA' if not recognizable.
    4. CountrySubentityCode string: mandatory (2 chars): Subentity Code from authority. 17 can be given if not applicable in case of foreign buyers. Please refer LHDN Documentation
    5. CountryCode string: mandatory (3 chars): Country of receipient. For codes, please refer LHDN Documentation
    6. ShipmentID string: optional (limit: 50 chars): Shipping ID if any.
    7. ShipmentCharges array: optional[if given, at least one]: Amount and Reason of such a charge need to be given.
  • Name
    InvoiceLines
    Type
    array: mandatory
    Description

    Details of line items in the document as an array. At least one item is mandatory in an Invoice. Each elemnt in this array must have:

    1. Description string: mandatory (limit: 300 chars): Item Name
    2. InvoicedQuantity number: mandatory: Quantity of Items
    3. UOM string: optional: Default: "C62". If you want to specify, then you can use any of the code given in: (https://sdk.myinvois.hasil.gov.my/codes/unit-types/)
    4. PriceAmount number: mandatory: Unit Price of Items
    5. LineTaxes array: mandatory: Taxes in each Line item
    codedescription
    01Sales Tax
    02Service Tax
    03Tourism Tax
    04High-Value Goods Tax
    05Sales Tax on Low Value Goods
    06Not Applicable
    ETax exemption (where applicable)
    • TaxExemptionReason string: mandatory if applicable: If TaxType is 'E', then TaxExemptionReason is mandatory.
    • TaxRate number: optional: 0.10 for 10% of Tax Rate [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
    • TaxBaseUnit number: optional: Units that have Tax applied [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
    • TaxPerUnit number: mandatory: Per unit tax to be considered [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
     [
       {
         "TaxType": "01",
         "TaxBaseUnit": 1,
         "TaxPerUnit": 10
       },
       {
         "TaxType": "E",
         "TaxRate": 0,
         "TaxExemptionReason": "Exempt New Means of Transport"
       }
     ]
    
    1. ClassificationCode array: mandatory ([] each has limit of: 3 chars): The 3 digit number of classification. Please refer LHDN Documentation
    2. Discounts array: optional: Line item level discounts need to be passed here. It is an optional tag and can be skipped if there is no discounts involved.
    3. Charges array: optional: Line item level charges/fees need to be passed here. It is an optional tag and can be skipped if there is no charges/fees involved.

    Both Discounts and Charges Should have the schema as specified below:

     [{
       "Amount": 100, // Amount to be adjusted from line total
       "Reason": "Discount / Item Service Fee", // Reason text
     }]
    

Sample Request

POST
/api/einvoice/generate/self-billed-invoice
curl --url https://sandbox-my.flick.network/api/einvoice/generate/self-billed-invoice \
  --header 'x-flick-auth-key: {token}' \
  --header 'supplier_uuid: {supplier_uuid}' \
  --header 'transport_mode: peppol' \
  --header 'Content-Type: application/json' \
  --data '
     {
      "ID": "SBINV-14003",
      "IssueDate": "2024-07-17",
      "IssueTime": "01:40:00Z",
      "InvoiceTypeCode": "11",
      "DocumentCurrencyCode": "USD",
      "TaxExchangeRate": 4.75,
      "CustomsImportForm": "1312312",
      "Incoterms": "CIF",
      "SupplierParty": {
        "LegalName": "Amazon Inc",
        "SupplierTIN": "EI00000000030",
        "SupplierBRN": "NA",
        "CityName": "Seattle",
        "PostalZone": "50000",
        "CountrySubentityCode": "17",
        "AddressLines": [
          "National Landing",
          "Crystal City",
          "Virginia"
        ],
        "CountryCode": "USA",
        "Telephone": "+60-123456789",
        "MSICCode": "46413",
        "Industry": "Wholesale of clothing"
      },
      "PaymentMeansCode": "01",
      "InvoiceLines": [
        {
          "Description": "Item 2",
          "InvoicedQuantity": 1,
          "PriceAmount": 50000,
          "LineTaxes":  [
            {
              "TaxType": "01",
              "TaxBaseUnit": 1,
              "TaxPerUnit": 10
            },
            {
              "TaxType": "E",
              "TaxRate": 0,
              "TaxExemptionReason": "Exempt New Means of Transport"
            }
          ],
          "ClassificationCode": ["001", "002", "003"]
        }
      ]
    }'

Sample Response

200
Success
{
  "status": "submitted",
  "data": {
    "submissionResponse": {
      "submissionUid": "GJ49979N7RCV2KAXDCH6ZK0J10",
      "acceptedDocuments": [
        {
          "uuid": "FRSS37P7NSM94970DCH6ZK0J10",
          "invoiceCodeNumber": "INV12345"
        }
      ],
      "rejectedDocuments": []
    }
  }
}

POST/api/einvoice/generate/self-billed/bulk

Self-Billed Invoices in Bulk

To submit multiple Self-Billed E-Invoice, this endpoint can be used along with the Supplier UUID to which it belongs to. Specify transport_mode for proper delivery of the document.

Request Body

The body of request should be an array of Documents. Each document should have the below schema.

  • Name
    ID
    Type
    string: mandatory (limit: 50 chars)
    Description

    Unique Invoice Reference Number. This should be made in sequence.

  • Name
    IssueDate
    Type
    date: mandatory, schema: YYYY-MM-DD
    Description

    Date on which the invoice was issued.

  • Name
    IssueTime
    Type
    time: mandatory, schema: HH-MM-ssZ
    Description

    Time at which the invoice was issued. Keep it in UTC format.

  • Name
    InvoiceTypeCode
    Type
    enum: mandatory
    Description

    Document Type to be specified.

    enumdescription
    11Self-Billed Invoice
    12Self-Billed Credit Note
    13Self-Billed Debit Note
    14Self-Billed Refund Note
  • Name
    InvoiceTotal
    Type
    number: optional
    Description

    If you want to make rounding to stay total aligned, please pass the total of Invoice including all taxes.

  • Name
    DocumentCurrencyCode
    Type
    string: mandatory (3 chars)
    Description

    Currency in which Invoice was issued. Default value: MYR. Please see the list of currency code in LHDN Documentation

  • Name
    TaxExchangeRate
    Type
    string: mandatory if applicable
    Description

    Rate at which non-Malaysian currency will be converted into Malaysian Ringgit. This is required when DocumentCurrencyCode is not MYR

  • Name
    InvoiceDocumentReference
    Type
    array: mandatory if applicable
    Description

    In case of Self-Billed Credit Note, Debit Note and Refund Note, it is mandatory to reference which that dodcument relates to.

    • UUID mandatory: IRBM Unique Identifier Number of the Invoice to which this credit note refers to.
    • InternalID mandatory: Internal ID / e-Invoice Code / Number to which this credit note belongs to.
     "InvoiceDocumentReference": [{
       "UUID": "71E88663PY17SQ9JZ48NYM0J10",
       "InternalID": "INV12345"
     }]
    
  • Name
    Discounts
    Type
    array: optional
    Description

    Document level discounts need to be shown here. It is an optional tag and can be skipped if there is no discounts involved.

  • Name
    Charges
    Type
    array: optional
    Description

    Document level charges or fees need to be shown here. It is an optional tag and can be skipped if there is no charges involved.

  • Both Discounts and Charges Should have the schema as specified below:

     [{
       "Amount": 100, // Amount to be adjusted from total txable
       "Reason": "Flat Discount / Service Fee Charged", // Reason
     }]
    
  • Name
    Prepayments
    Type
    array: optional
    Description

    Prepayments related this specific invoice need to me mentioned here. It is an optional tag.

     [{
       "PaymentID": "REC1012", 
       "Amount": 100, 
       "Date": "2024-01-10", 
       "Time": "12:00:00Z", 
     }]
    
  • Name
    CustomsImportForm
    Type
    string: mandatory if applicable
    Description

    Unique identifier assigned on the Declaration of Goods Imported.The input of special characters is not allowed. (limit: 19 chars)

  • Name
    Incoterms
    Type
    string: optional
    Description

    A set of international trade rules that define the responsibilities of buyers and suppliers.The input of special characters is not allowed. (limit: 3 chars)

  • Name
    SupplierParty
    Type
    strcut: mandatory
    Description

    Details of supplier against whom which the document is being issued.

    1. LegalName string: mandatory (limit: 300 chars): Official name of Supplier
    2. SupplierTIN string: mandatory (limit: 14 chars): TIN Number of Supplier
    • EI00000000010 - For General Public
    • EI00000000030 - Foreign Supplier’s TIN
    1. Any one of the below is mandatory
    tagdescription
    SupplierBRNValid BRN if Supplier is a Business
    SupplierNRICValid NRIC (MyKad/MyKAS/MyPR) if its an Individual
    SupplierPassportValid Passport ID if Supplier is a Non-Malaysian
    SupplierArmyIDValid MyTentera ID if Supplier is having one
    1. SupplierSST string: optional (limit: 35 chars): If they are SST Registered
    2. CityName string: mandatory (limit: 300 chars): City of Supplier
    3. AddressLines[] mandatory: min 1, max 3: Address Details of the Supplier. One line is mandatory. Provide 'NA' if not recognizable.
    4. CountrySubentityCode string: mandatory (2 chars): Subentity Code from authority. 17 can be given if not applicable in case of foreign buyers. Please refer LHDN Documentation
    5. CountryCode string: mandatory (3 chars): Country of Supplier. For codes, please refer LHDN Documentation
    6. Telephone string: mandatory (limit: 20 chars): Contact Number of Supplier.
    7. MSICCode string: mandatory (5 chars): MSCIC Code of Supplier. You can provide 00000 if not available.
    8. Industry string: mandatory (limit: 300 chars): Industry of the supplier.
    9. Email string: optional (limit: 300 chars): Email Address of Supplier
  • Name
    DeliveryDetails
    Type
    strcut: optional
    Description

    Details of receipient to which this Invoice is being delivered to.

    1. RecipientName string: mandatory (limit: 300 chars): Official name of receipient
    2. RecipientTIN string: mandatory (limit: 14 chars): TIN Number of receipient
    3. Any one of the below is mandatory
    tagdescription
    RecipientBRNValid BRN if Customer is a Business
    RecipientNRICValid NRIC (MyKad/MyKAS/MyPR) if its an Individual
    RecipientPassportValid Passport ID if Customer is a Non-Malaysian
    RecipientArmyIDValid MyTentera ID if Customer is having one
    1. RecipientSST string: optional (limit: 35 chars): If they are SST Registered
    2. CityName string: mandatory (limit: 300 chars): City of receipient
    3. AddressLines[] mandatory: min 1, max 3: Address Details of the receipient. One line is mandatory. Provide 'NA' if not recognizable.
    4. CountrySubentityCode string: mandatory (2 chars): Subentity Code from authority. 17 can be given if not applicable in case of foreign buyers. Please refer LHDN Documentation
    5. CountryCode string: mandatory (3 chars): Country of receipient. For codes, please refer LHDN Documentation
    6. ShipmentID string: optional (limit: 50 chars): Shipping ID if any.
    7. ShipmentCharges array: optional[if given, at least one]: Amount and Reason of such a charge need to be given.
  • Name
    InvoiceLines
    Type
    array: mandatory
    Description

    Details of line items in the document as an array. At least one item is mandatory in an Invoice. Each elemnt in this array must have:

    1. Description string: mandatory (limit: 300 chars): Item Name
    2. InvoicedQuantity number: mandatory: Quantity of Items
    3. UOM string: optional: Default: "C62". If you want to specify, then you can use any of the code given in: (https://sdk.myinvois.hasil.gov.my/codes/unit-types/)
    4. PriceAmount number: mandatory: Unit Price of Items
    5. LineTaxes array: mandatory: Taxes in each Line item
    codedescription
    01Sales Tax
    02Service Tax
    03Tourism Tax
    04High-Value Goods Tax
    05Sales Tax on Low Value Goods
    06Not Applicable
    ETax exemption (where applicable)
    • TaxExemptionReason string: mandatory if applicable: If TaxType is 'E', then TaxExemptionReason is mandatory.
    • TaxRate number: optional: 0.10 for 10% of Tax Rate [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
    • TaxBaseUnit number: optional: Units that have Tax applied [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
    • TaxPerUnit number: mandatory: Per unit tax to be considered [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
     [
       {
         "TaxType": "01",
         "TaxBaseUnit": 1,
         "TaxPerUnit": 10
       },
       {
         "TaxType": "E",
         "TaxRate": 0,
         "TaxExemptionReason": "Exempt New Means of Transport"
       }
     ]
    
    1. ClassificationCode array: mandatory ([] each has limit of: 3 chars): The 3 digit number of classification. Please refer LHDN Documentation
    2. Discounts array: optional: Line item level discounts need to be passed here. It is an optional tag and can be skipped if there is no discounts involved.
    3. Charges array: optional: Line item level charges/fees need to be passed here. It is an optional tag and can be skipped if there is no charges/fees involved.

    Both Discounts and Charges Should have the schema as specified below:

     [{
       "Amount": 100, // Amount to be adjusted from line total
       "Reason": "Discount / Item Service Fee", // Reason text
     }]
    

Sample Request

POST
/api/einvoice/generate/self-billed/bulk
curl --url https://sandbox-my.flick.network/api/einvoice/generate/self-billed/bulk \
  --header 'x-flick-auth-key: {token}' \
  --header 'supplier_uuid: {supplier_uuid}' \
  --header 'transport_mode: peppol' \
  --header 'Content-Type: application/json' \
  --data '
     [{
      "ID": "SBINV-14003",
      "IssueDate": "2024-07-17",
      "IssueTime": "01:40:00Z",
      "InvoiceTypeCode": "11",
      "DocumentCurrencyCode": "USD",
      "TaxExchangeRate": 4.75,
      "CustomsImportForm": "1312312",
      "Incoterms": "CIF",
      "SupplierParty": {
        "LegalName": "Amazon Inc",
        "SupplierTIN": "EI00000000030",
        "SupplierBRN": "NA",
        "CityName": "Seattle",
        "PostalZone": "50000",
        "CountrySubentityCode": "17",
        "AddressLines": [
          "National Landing",
          "Crystal City",
          "Virginia"
        ],
        "CountryCode": "USA",
        "Telephone": "+60-123456789",
        "MSICCode": "46413",
        "Industry": "Wholesale of clothing"
      },
      "PaymentMeansCode": "01",
      "InvoiceLines": [
        {
          "Description": "Item 2",
          "InvoicedQuantity": 1,
          "PriceAmount": 50000,
          "LineTaxes":  [
            {
              "TaxType": "01",
              "TaxBaseUnit": 1,
              "TaxPerUnit": 10
            },
            {
              "TaxType": "E",
              "TaxRate": 0,
              "TaxExemptionReason": "Exempt New Means of Transport"
            }
          ],
          "ClassificationCode": ["001", "002", "003"]
        }
      ]
    }]'

Sample Response

200
Success
{
  "status": "submitted",
  "data": {
    "submissionResponse": {
      "submissionUid": "GJ49979N7RCV2KAXDCH6ZK0J10",
      "acceptedDocuments": [
        {
          "uuid": "FRSS37P7NSM94970DCH6ZK0J10",
          "invoiceCodeNumber": "INV12345"
        }
      ],
      "rejectedDocuments": []
    }
  }
}

POST/api/einvoice/generate/self-billed/consolidated

Report Consolidated SB Invoices

To Generate a consolidated Self-Billed Document, this endpoint can be used along with the Supplier UUID to which it belongs to. Specify transport_mode for proper delivery of the document.

Request Body

  • Name
    ID
    Type
    string: mandatory (limit: 50 chars)
    Description

    Unique Invoice Reference Number. This should be made in sequence.

  • Name
    IssueDate
    Type
    date: mandatory, schema: YYYY-MM-DD
    Description

    Date on which the invoice was issued.

  • Name
    IssueTime
    Type
    time: mandatory, schema: HH-MM-ssZ
    Description

    Time at which the invoice was issued. Keep it in UTC format.

  • Name
    InvoiceTypeCode
    Type
    enum: mandatory
    Description

    Document Type to be specified.

    enumdescription
    11Self-Billed Invoice
    12Self-Billed Credit Note
    13Self-Billed Debit Note
    14Self-Billed Refund Note
  • Name
    InvoiceTotal
    Type
    number: optional
    Description

    If you want to make rounding to stay total aligned, please pass the total of Invoice including all taxes.

  • Name
    DocumentCurrencyCode
    Type
    string: mandatory (3 chars)
    Description

    Currency in which Invoice was issued. Default value: MYR. Please see the list of currency code in LHDN Documentation

  • Name
    TaxExchangeRate
    Type
    string: mandatory if applicable
    Description

    Rate at which non-Malaysian currency will be converted into Malaysian Ringgit. This is required when DocumentCurrencyCode is not MYR

  • Name
    InvoiceDocumentReference
    Type
    array: mandatory if applicable
    Description

    In case of Self-Billed Credit Note, Debit Note and Refund Note, it is mandatory to reference which that dodcument relates to.

    • UUID mandatory: IRBM Unique Identifier Number of the Invoice to which this credit note refers to.
    • InternalID mandatory: Internal ID / e-Invoice Code / Number to which this credit note belongs to.
      "InvoiceDocumentReference": [{
        "UUID": "71E88663PY17SQ9JZ48NYM0J10",
        "InternalID": "INV12345"
      }]
    
  • Name
    Discounts
    Type
    array: optional
    Description

    Document level discounts need to be shown here. It is an optional tag and can be skipped if there is no discounts involved.

  • Name
    Charges
    Type
    array: optional
    Description

    Document level charges or fees need to be shown here. It is an optional tag and can be skipped if there is no charges involved.

  • Both Discounts and Charges Should have the schema as specified below:

     [{
       "Amount": 100, // Amount to be adjusted from total txable
       "Reason": "Flat Discount / Service Fee Charged", // Reason
     }]
    
  • Name
    Prepayments
    Type
    array: optional
    Description

    Prepayments related this specific invoice need to me mentioned here. It is an optional tag.

     [{
       "PaymentID": "REC1012", 
       "Amount": 100, 
       "Date": "2024-01-10", 
       "Time": "12:00:00Z", 
     }]
    
  • Name
    CustomsImportForm
    Type
    string: mandatory if applicable
    Description

    Unique identifier assigned on the Declaration of Goods Imported.The input of special characters is not allowed. (limit: 19 chars)

  • Name
    Incoterms
    Type
    string: optional
    Description

    A set of international trade rules that define the responsibilities of buyers and suppliers.The input of special characters is not allowed. (limit: 3 chars)

  • Name
    SupplierParty
    Type
    strcut: mandatory
    Description

    Details of supplier against whom which the document is being issued.

    1. LegalName string: mandatory (limit: 300 chars): Official name of Supplier
    2. SupplierTIN string: mandatory (limit: 14 chars): TIN Number of Supplier
    • EI00000000010 - For General Public
    1. SupplierBRN string: mandatory (limit: 14 chars): NA Can be given for General Public
    2. CityName string: mandatory (limit: 300 chars): NA Can be given for General Public
    3. AddressLines[] mandatory: min 1, max 3: NA Can be given for General Public
    4. CountrySubentityCode string: mandatory (2 chars): Subentity Code from authority. 17 can be given if not applicable in case of foreign buyers. Please refer LHDN Documentation
    5. CountryCode string: mandatory (3 chars): Country of Supplier. For codes, please refer LHDN Documentation
    6. Telephone string: mandatory (limit: 20 chars): Contact Number of Supplier.
    7. MSICCode string: mandatory (5 chars): MSCIC Code of Supplier. You can provide 00000 if not available.
    8. Industry string: mandatory (limit: 300 chars): Industry of the supplier, NA if not available.
  • Name
    InvoiceLines
    Type
    array: mandatory
    Description

    Details of line items in the document as an array. At least one item is mandatory in an Invoice. Each elemnt in this array must have:

    1. Description string: mandatory (limit: 300 chars): Item Name
    2. InvoicedQuantity number: mandatory: Quantity of Items
    3. UOM string: optional: Default: "C62". If you want to specify, then you can use any of the code given in: (https://sdk.myinvois.hasil.gov.my/codes/unit-types/)
    4. PriceAmount number: mandatory: Unit Price of Items
    5. LineTaxes array: mandatory: Taxes in each Line item
    codedescription
    01Sales Tax
    02Service Tax
    03Tourism Tax
    04High-Value Goods Tax
    05Sales Tax on Low Value Goods
    06Not Applicable
    ETax exemption (where applicable)
    • TaxExemptionReason string: mandatory if applicable: If TaxType is 'E', then TaxExemptionReason is mandatory.
    • TaxRate number: optional: 0.10 for 10% of Tax Rate [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
    • TaxBaseUnit number: optional: Units that have Tax applied [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
    • TaxPerUnit number: mandatory: Per unit tax to be considered [Either TaxRate or TaxBaseUnit & TaxPerUnit together].
     [
       {
         "TaxType": "01",
         "TaxBaseUnit": 1,
         "TaxPerUnit": 10
       },
       {
         "TaxType": "E",
         "TaxRate": 0,
         "TaxExemptionReason": "Exempt New Means of Transport"
       }
     ]
    
    1. ClassificationCode array: mandatory ([] each has limit of: 3 chars): The 3 digit number of classification. Please refer LHDN Documentation
    2. Discounts array: optional: Line item level discounts need to be passed here. It is an optional tag and can be skipped if there is no discounts involved.
    3. Charges array: optional: Line item level charges/fees need to be passed here. It is an optional tag and can be skipped if there is no charges/fees involved.

    Both Discounts and Charges Should have the schema as specified below:

     [{
       "Amount": 100, // Amount to be adjusted from line total
       "Reason": "Discount / Item Service Fee", // Reason text
     }]
    

Sample Request

POST
/api/einvoice/generate/self-billed/consolidated
curl --url https://sandbox-my.flick.network/api/einvoice/generate/self-billed/consolidated \
  --header 'x-flick-auth-key: {token}' \
  --header 'supplier_uuid: {supplier_uuid}' \
  --header 'transport_mode: peppol' \
  --header 'Content-Type: application/json' \
  --data '
    {
      "ID": "CR12345",
      "InvoiceDocumentReference": {
        "UUID": "71E88663PY17SQ9JZ48NYM0J10",
        "InternalID": "INV12345"
      },
      "IssueDate": "2024-01-26",
      "IssueTime": "15:30:00Z",
      "InvoiceTypeCode": "12",
      "DocumentCurrencyCode": "MYR",
      "CustomerParty": {
        "LegalName": "General Public",
        "CustomerTIN": "EI00000000010",
        "CustomerBRN":"NA",
        "CityName": "NA",
        "PostalZone": "NA",
        "CountrySubentityCode": "17",
        "AddressLines": [
          "NA"
        ],
        "CountryCode": "MYS",
        "Telephone": "NA"
      },
      "InvoiceLines": [
        {
          "Description": "INV-1",
          "InvoicedQuantity": 1,
          "PriceAmount": 50000,
          "LineTaxes":  [
            {
              "TaxType": "01",
              "TaxBaseUnit": 1,
              "TaxPerUnit": 10
            },
            {
              "TaxType": "E",
              "TaxRate": 0,
              "TaxExemptionReason": "Exempt New Means of Transport"
            }
          ],
          "ClassificationCode": ["001", "002", "003"]
        }
      ]
    }'

Sample Response

200
Success
{
  "status": "submitted",
  "data": {
    "submissionResponse": {
      "submissionUid": "GJ49979N7RCV2KAXDCH6ZK0J10",
      "acceptedDocuments": [
        {
          "uuid": "FRSS37P7NSM94970DCH6ZK0J10",
          "invoiceCodeNumber": "INV12345"
        }
      ],
      "rejectedDocuments": []
    }
  }
}

GET/api/einvoice/get-document/{uuid}

Get Document Details from LHDN

This API endpoint allows users to query LHDN system and return details of a particular Document submitted.

GET Request Parameters

  • Name
    uuid
    Type
    string
    Description

    UUID issued by LHDN for the document

Sample Request

GET
/api/einvoice/get-document/{uuid}
curl 
  --url https://sandbox-my.flick.network/api/einvoice/get-document/{uuid} \

  --header 'x-flick-auth-key: {token}' \
  --header 'supplier_uuid: {supplier_uuid}' 

Sample Response

200
Success
{
  "uuid": "T9Z4ZES3SQFESQ0P3N4FXA1J10",
  "submissionUid": "74980SSDSHF87KD33N4FXA1J10",
  "longId": "EEXA83PNNMJADQPH3N4FXA1J10MoVOEi1719427109",
  "typeName": "Self-billed Invoice",
  "typeVersionName": "Version 1",
  "issuerTin": "C51231412",
  "issuerName": "Demo Company SDN. BHD",
  "receiverId": "C23234234",
  "receiverName": "Demo Receiver SDN. BHD",
  "dateTimeReceived": "2024-06-26T18:38:29Z",
  "dateTimeValidated": "2024-06-26T18:38:32Z",
  "totalExcludingTax": 120,
  "totalDiscount": 0,
  "totalNetAmount": 120,
  "totalPayableAmount": 127.2,
  "status": "Valid",
  "createdByUserId": "C58715578070:67876c24-b8bf-4336-ae4a-de5cccffe00f",
  "documentStatusReason": null,
  "cancelDateTime": null,
  "rejectRequestDateTime": null,
  "validationResults": {
    "status": "Valid",
    "validationSteps": [
      {
        "status": "Valid",
        "name": "Step03-Duplicated Submission Validator"
      },
      {
        "status": "Valid",
        "name": "Step-07. Code Field Validator"
      },
      {
        "status": "Valid",
        "name": "Step14-Taxpayer Profile Validator"
      }
    ]
  },
  "internalId": "SBINV-14003",
  "dateTimeIssued": "2024-06-25T17:40:00Z",
  "data": {
      "ID": "SBINV-14003",
      "IssueDate": "2024-07-17",
      "IssueTime": "01:40:00Z",
      "InvoiceTypeCode": "11",
      "DocumentCurrencyCode": "USD",
      "TaxExchangeRate": 4.75,
      "CustomsImportForm": "1312312",
      "Incoterms": "CIF",
      "SupplierParty": {
        "LegalName": "Amazon Inc",
        "SupplierTIN": "EI00000000030",
        "SupplierBRN": "NA",
        "CityName": "Seattle",
        "PostalZone": "50000",
        "CountrySubentityCode": "17",
        "AddressLines": [
          "National Landing",
          "Crystal City",
          "Virginia"
        ],
        "CountryCode": "USA",
        "Telephone": "+60-123456789",
        "MSICCode": "46413",
        "Industry": "Wholesale of clothing"
      },
      "PaymentMeansCode": "01",
      "InvoiceLines": [
        {
          "Description": "Item 1",
          "InvoicedQuantity": 1,
          "PriceAmount": 120,
          "LineTaxes":  [
            {
              "TaxType": "01",
              "TaxBaseUnit": 1,
              "TaxPerUnit": 10
            },
            {
              "TaxType": "E",
              "TaxRate": 0,
              "TaxExemptionReason": "Exempt New Means of Transport"
            }
          ],
          "ClassificationCode": ["001", "002", "003"]
        }
      ]
    },
  "qrCode": "iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAAAklEQVR4AewaftIAAAdnSURBVO3BQY4kR5IAQVVH/f/Lun0b20sAgcxqkg4TsT9Y6xKHtS5yWOsih7UucljrIoe1LnJY6yKHtS5yWOsih7UucljrIoe1LnJY6yKHtS5yWOsih7Uu8sOHVP6miicqU8Wk8kbFpPKkYlKZKp6oTBVPVN6omFSmiknlb6r4xGGtixzWushhrYv88GUV36TyROWNiknljYpJ5ZsqJpU3KiaVJxVvVHyTyjcd1rrIYa2LHNa6yA+/TOWNijcqJpUnKk8qJpUnFW+oTBVvVEwqb6hMFZ9QeaPiNx3WushhrYsc1rrID+v/UXlS8UbFE5Wp4onKVLH+57DWRQ5rXeSw1kV++I9TeaLyiYpPqDypmFTeUJkq3lCZKv7LDmtd5LDWRQ5rXeSHX1bxmyqeqEwVk8pUMak8qZhUpopJZVKZKiaVN1SmikllqvhExb/JYa2LHNa6yGGti/zwZSp/k8pU8ZsqJpWpYlKZKiaVNyomlaliUpkqJpWp4onKv9lhrYsc1rrIYa2L2B9cROXfrGJSmSp+k8qTiv+yw1oXOax1kcNaF7E/+IDKVDGpTBWTylQxqUwVb6hMFZPKVPGGylQxqTyp+ITKGxXfpDJVPFGZKr7psNZFDmtd5LDWRewPvkjlmyqeqHxTxROVJxWTypOKN1SeVDxReaPiN6lMFZ84rHWRw1oXOax1kR9+WcWkMlU8UXlS8ZtU3lCZKj6h8k0Vk8pUMan8lxzWushhrYsc1rqI/cG/iMpU8UTlScWkMlVMKlPFE5UnFZPKVDGpTBVPVD5RMalMFU9UnlRMKlPFNx3WushhrYsc1rrIDx9SeaNiUpkqJpUnFW9UTCpvqEwVk8qTiknlDZWpYlKZKp6oPFF5UvEJlaniE4e1LnJY6yKHtS7yw4cqnqi8oTJVTCqfUJkq3qiYVKaK31QxqUwVk8pU8aRiUpkqPlHxmw5rXeSw1kUOa13E/uBfROVJxROVqWJSeVIxqUwVT1Smik+oTBVPVKaKN1TeqHiiMlVMKlPFJw5rXeSw1kUOa13khw+pfKLiScWk8qTin1TxhsobKlPFJ1SmijdUpoqpYlL5TYe1LnJY6yKHtS7yw5dVPFF5UjGpTBWTyqTyCZUnKlPFN1VMKk9U3lD5TSpTxVTxmw5rXeSw1kUOa13E/uADKm9U/CaVqWJSeVLxRGWqeEPlmyreUJkqJpU3KiaVJxWTylTxicNaFzmsdZHDWhf54R+m8omKT1S8UfGbKiaVqWJSmSomlTcqJpWpYlKZKp6o/KbDWhc5rHWRw1oXsT/4gMpUMalMFZPKk4pJ5RMVT1TeqJhUnlRMKp+omFT+popJZaqYVKaKbzqsdZHDWhc5rHWRH75M5YnKVDGpTCpPKiaVN1SeVHyiYlJ5o+KJypOKJypvVDypmFSmit90WOsih7UucljrIj/8w1SeVEwqTyomlU+oPKl4ojJVTCpTxaQyVTyp+E0qU8WkMlVMKk8qPnFY6yKHtS5yWOsiP3xZxSdUJpUnKlPFVPFGxROVSWWqmFTeUJkqnlT8m1RMKlPFbzqsdZHDWhc5rHUR+4NfpPKkYlKZKiaVNyomlU9UTCpvVEwqU8UbKm9UPFGZKp6oTBVPVKaKbzqsdZHDWhc5rHWRHz6kMlVMFU9UpopJZar4J6k8qZhUJpWp4g2VJxWTym+qmFSmir/psNZFDmtd5LDWRX74UMUbKm9UPFGZKv7LVKaKqeKNit+kMlW8oTJVfOKw1kUOa13ksNZFfviQylQxqXxCZap4ovJGxaQyVUwqn6h4Q+WNikllqphUnqhMFW+o/E2HtS5yWOsih7UuYn/wRSpPKj6hMlVMKlPFpDJVTCpPKiaVT1RMKr+p4ptUpop/0mGtixzWushhrYv88CGVqeKJym+qeENlqphUJpWpYlJ5UjGpPKmYVN6oeKLyN6k8qfjEYa2LHNa6yGGti/zwoYo3Kr5J5Y2KSeWbKt6omFSeVEwqU8UnKt5QmVSmiqliUvmmw1oXOax1kcNaF/nhQyp/U8VU8UTlExWTyhOVqeKJylQxqUwVn1B5Q2Wq+KaKbzqsdZHDWhc5rHWRH76s4ptUvkllqphUnlRMKlPFE5UnKp9QmSqmiknlScVvUpkqPnFY6yKHtS5yWOsiP/wylTcq3lB5o2JS+UTFN1VMKp9QmSqeqPyXHda6yGGtixzWusgP/3EVk8pUMak8qXiiMlVMKlPFN6k8qXiiMlW8ofKk4onKbzqsdZHDWhc5rHWRH/7jVKaKSeUNlaliqnhSMal8U8WkMqlMFVPFpPKkYqqYVN6omFS+6bDWRQ5rXeSw1kV++GUVv6liUnmj4onKk4onFU9UJpXfpDJVvKHyCZWp4psOa13ksNZFDmtd5IcvU/mbVD6h8qTiicqTiknljYpJZaqYVD6h8qTiDZUnKlPFJw5rXeSw1kUOa13E/mCtSxzWushhrYsc1rrIYa2LHNa6yGGtixzWushhrYsc1rrIYa2LHNa6yGGtixzWushhrYsc1rrI/wFKk7qmDdchaQAAAABJRU5ErkJggg=="
}

POST/api/einvoice/cancel

Cancel a Document

This endpoint allows you to cancel an already issued E-Document.

Request Body

  • Name
    uuid
    Type
    string: mandatory
    Description

    UUID of the document that you want to cancel.

  • Name
    status
    Type
    enum: mandatory
    Description

    Desired status for the document. Must be "cancelled" always to cancel previously issued document, be it usual or self-billed.

  • Name
    reason
    Type
    string: string (limit: 300 chars)
    Description

    Reason for cancelling the document.

Sample Request

POST
/api/einvoice/cancel
curl 
  --url https://sandbox-my.flick.network/api/einvoice/cancel \
  --header 'x-flick-auth-key: {token}' \
  --header 'supplier_uuid: {supplier_uuid}' \
  --header 'Content-Type: application/json' \
  --data '
  {
    "uuid": "5YS7R96D4X110AS9HCD8D13J10",
    "status": "cancelled",
    "reason": "Wrong buyer details"
  }'

Sample Response

200
Success
{
  "status": "success",
  "data": {
    "uuid": "5YS7R96D4X1S0AS9HCD8D13J10",
    "status": "Cancelled"
  }
}

GET/api/einvoice/supplier-invoices?pageNo={pageNo}&pageSize={pageSize}&submissionDateFrom={submissionDateFrom}&submissionDateTo={submissionDateTo}&issueDateFrom={issueDateFrom}&issueDateTo={IssueDateTo}&status={status}&documentType={documentType}&issuerIdType={issuerIdType}&issuerId={issuerId}&issuerTin={issuerTin}

Get Invoices from Suppliers

This API endpoint allows users to query LHDN system and return list of documents that have been recently issued against them.

System limits the number of the documents that can be received in one request by implementing paging mechanism for this API and also by not allowing to request documents that are issued more than 30 days ago.

GET Request Parameters

  • Name
    pageNo
    Type
    number (optional)
    Description

    Number of the page to retrieve. Typically this parameter value is derived from initial parameter less call when caller learns total amount of page of certain size

  • Name
    pageSize
    Type
    number (optional)
    Description

    Number of the documents to retrieve per page. Page size cannot exceed system configured maximum page size for this API

  • Name
    submissionDateFrom
    Type
    date (optional)
    Description

    The start date and time when the document was submitted to the e-Invoice API, Time to be supplied in UTC timezone. Mandatory when ‘submissionDateTo’ is provided.

  • Name
    submissionDateTo
    Type
    date (optional)
    Description

    The end date and time when the document was submitted to the e-Invoice API, Time to be supplied in UTC timezone. Mandatory when ‘submissionDateFrom’ is provided

  • Name
    issueDateFrom
    Type
    date (optional)
    Description

    The start date and time when the document was issued. Mandatory when ‘issueDateTo’ is provided

  • Name
    issueDateTo
    Type
    date (optional)
    Description

    The end date and time when the document was issued. Mandatory when ‘issueDateFrom’ is provided

  • Name
    status
    Type
    string (optional)
    Description

    status of the document. Possible values: (Valid, Invalid, Cancelled, Submitted)

  • Name
    documentType
    Type
    string (optional)
    Description

    Document type code.

  • Name
    issuerIdType
    Type
    string (optional)
    Description

    Document issuer identifier type. Possible values: (BRN, PASSPORT, NRIC, ARMY) This is mandatory in case the issuerId is provided.

  • Name
    issuerId
    Type
    string (optional)
    Description

    Document issuer identifier.

  • Name
    issuerTin
    Type
    string (optional)
    Description

    Document issuer identifier. Possible values: (Business registration number, National ID(IC), Passport Number, Army ID)

Sample Request

POST
/api/einvoice/supplier-invoices
curl 
  --url https://sandbox-my.flick.network/api/einvoice/supplier-invoices
  ?pageNo={pageNo}
  &pageSize={pageSize}
  &submissionDateFrom={submissionDateFrom}
  &submissionDateTo={submissionDateTo}
  &issueDateFrom={issueDateFrom}
  &issueDateTo={IssueDateTo}
  &status={status}
  &documentType={documentType}
  &issuerIdType={issuerIdType}
  &issuerId={issuerId}
  &issuerTin={issuerTin} \

  --header 'x-flick-auth-key: {token}' \
  --header 'supplier_uuid: {supplier_uuid}' 

Sample Response

200
Success
{
  "status": "success",
  "data": [{
    "uuid": "216e7b91-dc17-4316-85dd-2afc913cd630",
    "submissionUID": "1bc5e22a-07c9-47dd-9ec4-26032e5dfa21",
    "longId": "FjeaQo89YgVcRbS4dNpWzX1UjLkPvT6Ygt9eD1b4mc5F3xWs7rZyQoXnIA2aB8h0fEjMuGNzVqRlSOCHdwUiKpFjeaQo89YgVcRbS4dNpWzX1UjLkPvT6Ygt9eD1b4mc5F3xWs7rZyQoXnIA2aB8h0fEjMuGNzVqRlSOCHdwUiKpFjeaQo89YgVcRbS4dNpWzX1UjLkPvT6Ygt9eD1b4mc5F3xWs7rZyQoXnIA2aB8h0fEjMuGNzVqRlSOCHdwUiKp",
    "internalId": "PZ-234-A",
    "typeName": "invoice",
    "typeVersionName": "1.0",
    "issuerTin": "C25845632100",
    "issuerName": "AMS Setia Jaya Sdn. Bhd.",
    "receiverId": "201901234567",
    "receiverName": "AMS Setia Jaya Sdn. Bhd.",
    "dateTimeIssued": "2021-02-13T13:15:00Z",
    "dateTimeReceived": "2021-02-13T14:20:00Z",
    "dateTimeValidated": "2021-02-13T14:20:00Z",
    "totalSales": 10.10,
    "totalDiscount": 50.00,
    "netAmount": 100.70,
    "total": 124.09,
    "status": "Valid",
    "cancelDateTime": "2021-02-25T01:59:10Z",
    "rejectRequestDateTime": "2021-02-25T01:59:10Z",
    "documentStatusReason": "Wrong buyer details",
    "createdByUserId": "C1XXXXXXXX00:9e21b10c-41c4-9323-c590-95abcb6e4e4d",
    "issuerEmail": "general.ams@supplier.com"
  }],
  "metadata": {
    "totalPages": 1,
    "totalCount": 1
  }
}

POST/api/einvoice/reject

Reject any Document

This endpoint allows you to cancel an already issued E-Document.

Request Body

  • Name
    uuid
    Type
    string: mandatory
    Description

    UUID of the document that you want to reject.

  • Name
    status
    Type
    enum: mandatory
    Description

    Desired status for the document. Must be rejected to reject received document. 'rejected' is the only allowed value.

  • Name
    reason
    Type
    string: mandatory (limit: 300 chars)
    Description

    Reason for rejecting the document. Examples of reasons: Wrong buyer details or Wrong invoice details or any other reasons as the supplier deems appropriate

Sample Request

POST
/api/einvoice/cancel
curl 
  --url https://sandbox-my.flick.network/api/einvoice/cancel \
  --header 'x-flick-auth-key: {token}' \
  --header 'supplier_uuid: {supplier_uuid}' \
  --header 'Content-Type: application/json' \
  --data '
  {
    "uuid": "5YS7R96D4X1S0AS9HCD8D13J10",
    "status": "rejected",
    "reason": "Wrong buyer details"
  }'

Sample Response

200
Success
{
  "status": "success",
   "data":{ 
      "uuid": "5YS7R96D4X1S0AS9HCD8D13J10",
      "status": "Rejected",
    }
}

WEBHOOKPOST REQUEST to {your_url}

Listen Status Changes

You can listen to the updates in status of a document that is already issued by the user or issued against him, by adding a webhook endpoint.

Request Body

  • Name
    eventType
    Type
    string
    Description

    Type of Event happend

  • Name
    uuid
    Type
    string
    Description

    UUID of the document

  • Name
    longId
    Type
    string
    Description

    LongId of the document

  • Name
    internalId
    Type
    string
    Description

    Internal Document ID

  • Name
    status
    Type
    string
    Description

    Current status of the document

  • Name
    cancelDateTime
    Type
    datetime
    Description

    Datetime when the document was cancelled.

  • Name
    rejectRequestDateTime
    Type
    datetime
    Description

    Datetime when the rejection was requested.

  • Name
    documentStatusReason
    Type
    string
    Description

    Reason why a document has the current status of cancelled or invalid. This includes validation errors from LHDN.

Sample Request

POST
{
  "eventType": "statusChange",
  "uuid": "5YS7R96D4X1S0AS9HCD8D13J10",
  "longId": "FjeaQo89YgVcRbS4dNpWzX1UjLkPvT6Ygt9eD1b4mc5F3xWs7rZyQoXnIA2aB8h0fEjMuGNzVqRlSOCHdwUiKpFjeaQo89YgVcRbS4dNpWzX1UjLkPvT6Ygt9eD1b4mc5F3xWs7rZyQoXnIA2aB8h0fEjMuGNzVqRlSOCHdwUiKpFjeaQo89YgVcRbS4dNpWzX1UjLkPvT6Ygt9eD1b4mc5F3xWs7rZyQoXnIA2aB8h0fEjMuGNzVqRlSOCHdwUiKp",
  "internalId": "PZ-234-A",
  "status": "cancelled",
  "cancelDateTime": "2021-02-25T01:59:10Z",
  "rejectRequestDateTime": "2021-02-25T01:59:10Z",
  "documentStatusReason": "Wrong buyer details",
}

WEBHOOKPOST REQUEST to {your_url}/document/cancel

Listen Cancelation Requests

You can listen for cancellation requests from your receipients, by adding a webhook endpoint.

Request Body

  • Name
    uuid
    Type
    string
    Description

    UUID of the document

  • Name
    longId
    Type
    string
    Description

    LongId of the document

  • Name
    internalId
    Type
    string
    Description

    Internal Document ID

  • Name
    status
    Type
    string
    Description

    Current status of the document

  • Name
    rejectRequestDateTime
    Type
    datetime
    Description

    Datetime when the rejection was requested.

  • Name
    documentStatusReason
    Type
    string
    Description

    Reason why a document has the current status of cancelled or invalid. This includes validation errors from LHDN.

Sample Request

POST
{
  "uuid": "5YS7R96D4X1S0AS9HCD8D13J10",
  "longId": "FjeaQo89YgVcRbS4dNpWzX1UjLkPvT6Ygt9eD1b4mc5F3xWs7rZyQoXnIA2aB8h0fEjMuGNzVqRlSOCHdwUiKpFjeaQo89YgVcRbS4dNpWzX1UjLkPvT6Ygt9eD1b4mc5F3xWs7rZyQoXnIA2aB8h0fEjMuGNzVqRlSOCHdwUiKpFjeaQo89YgVcRbS4dNpWzX1UjLkPvT6Ygt9eD1b4mc5F3xWs7rZyQoXnIA2aB8h0fEjMuGNzVqRlSOCHdwUiKp",
  "internalId": "PZ-234-A",
  "status": "valid",
  "rejectRequestDateTime": "2021-02-25T01:59:10Z",
  "documentStatusReason": "Wrong buyer details",
}

WEBHOOKPOST REQUEST to {your_url}/document/reject

Listen Rejection Status

You can listen to updates in your rejection requests to know whether they are accepted by the issuer, by adding a webhook endpoint.

Request Body

  • Name
    uuid
    Type
    string
    Description

    UUID of the document

  • Name
    longId
    Type
    string
    Description

    LongId of the document

  • Name
    internalId
    Type
    string
    Description

    Internal Document ID

  • Name
    status
    Type
    string
    Description

    Current status of the document

  • Name
    cancelDateTime
    Type
    datetime
    Description

    Datetime when the document was cancelled.

  • Name
    rejectRequestDateTime
    Type
    datetime
    Description

    Datetime when the rejection was requested.

  • Name
    documentStatusReason
    Type
    string
    Description

    Reason why a document has the current status of cancelled or invalid. This includes validation errors from LHDN.

Sample Request

POST
{
  "uuid": "5YS7R96D4X1S0AS9HCD8D13J10",
  "longId": "FjeaQo89YgVcRbS4dNpWzX1UjLkPvT6Ygt9eD1b4mc5F3xWs7rZyQoXnIA2aB8h0fEjMuGNzVqRlSOCHdwUiKpFjeaQo89YgVcRbS4dNpWzX1UjLkPvT6Ygt9eD1b4mc5F3xWs7rZyQoXnIA2aB8h0fEjMuGNzVqRlSOCHdwUiKpFjeaQo89YgVcRbS4dNpWzX1UjLkPvT6Ygt9eD1b4mc5F3xWs7rZyQoXnIA2aB8h0fEjMuGNzVqRlSOCHdwUiKp",
  "internalId": "PZ-234-A",
  "status": "cancelled",
  "cancelDateTime": "2021-02-25T01:59:10Z",
  "rejectRequestDateTime": "2021-02-25T01:59:10Z",
  "documentStatusReason": "Wrong buyer details",
}