Skip to content

Creation of E-invoice Header and Line

Overview

The E-invoice API enables the creation of e_invoice header and line records. This documentation provides detailed information on the endpoints, request and response formats, and field descriptions.

Create

Endpoint:/api/execbo/submitEinvoiceToPortal/submit_einv_to_portal/{company}

This API will create a new invoice header and line. Also it checks for consolidation, and creates consilidation invoice when the input satisfies the consolidation conditions.The input will decide whether to create normal invoice or consolidation invoice.

  • Method: POST
  • Content-Type: application/json
  • Authentication: Bearer <token>

Request Body:

json
{
    "adis": "<Invoice-Additional-Discount-Amount>",          //float
    "afee": "<Invoice-Additional-Fee-Amount>",               //float
    "anum": "<Authorisation-Number-for-Certified-Exporter>", //string
    "bedt": "<Billing-Period-End-Date>",                     //date
    "bref": "<Bill-Reference-Number>",                       //string
    "bsdt": "<Billing-Period-Start-Date>",                   //date
    "buy_adrs": "<Buyer-Address>",                           //string
    "ccur": "<Invoice-Currency-Code>",                       //string
    "comp": "<Supplier-Code>",                               //integer
    "cvat": "<Tax-Type>",                                    //string
    "dataset": "<Dataset>",                                  //string
    "doct": "<Invoice-Type>",                                //string
    "dshp": false,                                           //boolean
    "dtrm": "<Incoterms>",                                   //string            
    "esta": "<LHDN-Status>",                                 //string
    "etim": "<LHDN-Validated-Date & Time>",                  //datetime
    "fbil": "<Frequency-of-Billing>",                        //string
    "frm1": "<Reference-No-of-Customs-form No 1, 9, etc>",   //string
    "frm2": "<Reference-Number-of-Customs-Form No.2>",       //string
    "ftrd": "<Free-Trade-Agreement-Information>",            //string
    "idoc": "<Invoice-Number>",                              //integer
    "inv_bp": "<Buyer-Code>",                                //string
    "line": "<Line>",                                        //intrger
    "line_cnt": "<Line-Count>",                              //integer
    "lines": [
        {
            "amti": "<Line-Invoice-Amount>",                 //float
            "amtt": "<Amount-Exempted-from-Tax>",            //float
            "ccde": "<Product-Tariff>",                      //string
            "ccty": "<Country-of-Orgin>",                    //string
            "ceno": "<Tax-Exemption-Certificate-Number>",    //string
            "clas": "<Classification>",                      //string
            "comp": "<Supplier-Code>",                       //integer
            "cuni": "<Unit-of-Measure>",                     //string
            "cvat": "<Tax-Type>",                            //string
            "disc": "<Discount-Rate>",                       //float
            "dqua": "<Quantity>",                            //float
            "feea": "<Fee / Charge-Amount>",                 //float
            "feer": "<Fee / Charge-Rate>",                   //float
            "idoc": "<Invoice-Number>",                      //integer
            "item": "<Item-Code>",                           //string
            "item_desc": "<Item-Description>",               //string
            "ldai": "<Discount-Amount>",                     //float
            "line": "<Line>",                                //integer
            "pric": "<Price>",                               //float
            "pvat": "<Tax-Rate>",                            //float
            "stot": "<Sub-Total>",                           //float
            "tran": "<Finance-Type>",                        //string
            "txai": "<Tax-Amount>",                          //float
            "reference0": "<Reference-0>",                   //string
            "reference1": "<Reference-1>",                   //string
            "reference2": "<Reference-2>",                   //string
            "reference3": "<Reference-3>",                   //string
            "reference4": "<Reference-4>",                   //string
            "reference5": "<Reference-5>",                   //string
            "reference6": "<Reference-6>",                   //string
            "reference7": "<Reference-7>",                   //string
            "reference8": "<Reference-8>",                   //string
            "reference9": "<Reference-9>",                   //string
        }
    ],
    "ochg": false,                                           //boolean
    "paym": "<Payment-Mode>",                                //string
    "pref": "<PrePayment-Reference-Number>",                 //string
    "pydt": "<PrePayment-Date>",                             //date
    "pytm": "<PrePayment-Time>",                             //datetime
    "ramt": "<Rounding-Amount>",                             //float
    "rate": "<Currency-Exchange-Rate>",                      //float
    "sadr": "<Shipper-Address-Code>",                        //string
    "src_type": "<Sales-Type>",                              //string
    "stbp": "<Shipper-Code>",                                //string
    "styp": "<Sales-Category>",                              //string
    "tdis": "<Total-Discount-Value>",                        //float
    "term": "<Payment-Term>",                                //string
    "tfee": "<Total-Fee / Charge-Amount>",                   //float
    "tnat": "<Total-Net-Amount>",                            //float
    "tote": "<Total-Excluding-Tax>",                         //float
    "toti": "<Total-Including-Tax>",                         //float
    "tott": "<Total-Tax-Amount>",                            //float
    "tpat": "<Total-Payable-Amount>",                        //float
    "tran": "<Finance-Type>",                                //string
    "ttat": "<Total-Tax-Amount-Per-Tax-Type>",               //float
    "ttax": "<Total-Taxable-Amount-Per-Tax-Type>",           //float
    "reference0": "<Reference-0>",                           //string
    "reference1": "<Reference-1>",                           //string
    "reference2": "<Reference-2>",                           //string
    "reference3": "<Reference-3>",                           //string
    "reference4": "<Reference-4>",                           //string
    "reference5": "<Reference-5>",                           //string
    "reference6": "<Reference-6>",                           //string
    "reference7": "<Reference-7>",                           //string
    "reference8": "<Reference-8>",                           //string
    "reference9": "<Reference-9>",                           //string
}

Fields Details:

Field NameDescriptionData TypeLength
adisInvoice Additional Discount AmountFloat20
afeeInvoice Additional Fee AmountFloat20
anumAuthorisation Number for Certified ExporterString300
bedtBilling Period End DateDate10
brefBill-Reference-NumberString150
bsdtBilling Period Start DateDate10
buy_adrsBuyer AddressString9
ccurInvoice Currency CodeString3
compSupplier CodeInteger4
cvatTax TypeString9
datasetDatasetString3
doctInvoice TypeString2
dshpDropshipmentBoolean1
dtrmIncotermsString3
estaLHDN StatusString10
etimLHDN Validated Date & TimeDateTime25
fbilFrequency of BillingString50
frm1Reference No of Customs form No 1, 9, etcString12
frm2Reference Number of Customs Form No.2String12
ftrdFree Trade Agreement(FTA) InformationString300
idocInvoice NumberInteger8
inv_bpBuyer CodeString9
lineLineInteger4
line_cntLine CountInteger4
amtiLine Invoice AmountFloat20
amttAmount Exempted from TaxFLoat20
ccdeProduct TariffString25
cctyCountry of OrginString3
cenoTax Exemption Certificate NumberString300
clasClassificationString3
compSupplier CodeInteger4
cuniUnit of Measurestring3
cvatTax TypeString3
discDiscount RateFloat6
dquaQuantityFloat20
feeaFee / Charge AmountFloat20
feerFee / Charge RateFloat20
idocInvoice NumberInteger8
itemItem CodeString47
item_descItem DescriptionString300
ldaiDiscount AmountFloat20
lineLineInteger4
pricPriceFloat20
pvatTax RateFloat10
stotSub TotalFloat20
tranFinance TypeString3
txaiTax AmountFloat20
reference0Reference 0String100
reference1Reference 1String100
reference2Reference 2String100
reference3Reference 3String100
reference4Reference 4String100
reference5Reference 5String100
reference6Reference 6String100
reference7Reference 7String100
reference8Reference 8String100
reference9Reference 9String100
ochgDetails of other chargesBoolean1
paymPayment ModeString3
prefPrePayment Reference NumberString150
pydtPrePayment DateDate10
pytmPrePayment TimeDateTime25
ramtRounding AmountFloat20
rateCurrency Exchange RateFloat20
sadrShipper Address CodeString9
src_typeSales TypeString10
stbpShipper CodeString9
stypSales CategoryString10
tdisTotal Discount ValueFloat20
termPayment TermString120
tfeeTotal Fee / Charge AmountFloat20
tnatTotal Net AmountFloat20
toteTotal Excluding TaxFloat20
totiTotal Including TaxFloat20
tottTotal Tax AmountFloat20
tpatTotal Payable AmountFloat20
tranFinance TypeString3
ttatTotal Tax Amount Per Tax TypeFloat20
ttaxTotal Taxable Amount Per Tax TypeFloat20
reference0Reference 0String100
reference1Reference 1String100
reference2Reference 2String100
reference3Reference 3String100
reference4Reference 4String100
reference5Reference 5String100
reference6Reference 6String100
reference7Reference 7String100
reference8Reference 8String100
reference9Reference 9String100

Response Body: (Status: 200)

json
{
    "adis": "<Invoice-Additional-Discount-Amount>",          
    "afee": "<Invoice-Additional-Fee-Amount>",               
    "anum": "<Authorisation-Number-for-Certified-Exporter>", 
    "bedt": "<Billing-Period-End-Date>",                     
    "bref": "<Bill-Reference-Number>",                       
    "bsdt": "<Billing-Period-Start-Date>",                   
    "buy_adrs": "<Buyer-Address>",                           
    "ccur":"<Invoice-Currency-Code>",                                                            
    "comp": "<Supplier-Code>",                               
    "cvat": "<Tax-Type>",                                   
    "dataset": "<Dataset>",                                
    "doct": "<Invoice-Type>",                                
    "dshp": false,                                           
    "dtrm":"<Incoterms>",                                           
    "esta": "<LHDN-Status>",                                 
    "etim": "<LHDN-Validated-Date & Time>",                 
    "fbil": "<Frequency-of-Billing>",                        
    "frm1": "<Reference-No-of-Customs-form No 1, 9, etc>",   
    "frm2": "<Reference-Number-of-Customs-Form No.2>",       
    "ftrd": "<Free-Trade-Agreement-Information>",            
    "idoc": "<Invoice-Number>",                              
    "inv_bp": "<Buyer-Code>",                                
    "line": "<Line>",                                        
    "line_cnt": "<Line-Count>",                              
    "lines": [
        {
            "amti": "<Line-Invoice-Amount>",                
            "amtt": "<Amount-Exempted-from-Tax>",            
            "ccde": "<Product-Tariff>",                      
            "ccty": "<Country-of-Orgin>",                   
            "ceno": "<Tax-Exemption-Certificate-Number>",    
            "clas": "<Classification>",                      
            "comp": "<Supplier-Code>",                      
            "cuni": "<Unit-of-Measure>",                     
            "cvat": "<Tax-Type>",                            
            "disc": "<Discount-Rate>",                       
            "dqua": "<Quantity>",                            
            "feea": "<Fee / Charge-Amount>",                 
            "feer": "<Fee / Charge-Rate>",                   
            "idoc": "<Invoice-Number>",                      
            "item": "<Item-Code>",                           
            "item_desc": "<Item-Description>",               
            "ldai": "<Discount-Amount>",                    
            "line": "<Line>",                                
            "pric": "<Price>",                               
            "pvat": "<Tax-Rate>",                            
            "stot": "<Sub-Total>",                          
            "tran": "<Finance-Type>",                        
            "txai": "<Tax-Amount>"                           
        }
    ],
    "ochg": false,                                           
    "paym": "<Payment-Mode>",                                
    "pref": "<PrePayment-Reference-Number>",                 
    "pydt": "<PrePayment-Date>",                             
    "pytm": "<PrePayment-Time>",                             
    "ramt": "<Rounding-Amount>",                             
    "rate": "<Currency-Exchange-Rate>",                      
    "sadr":"<Shipper-Address-Code>", 
    "src_type": "<Sales-Type>",                              
    "stbp": "<Shipper-Code>",                                
    "styp": "<Sales-Category>",                              
    "tdis": "<Total-Discount-Value>",                       
    "term": "<Payment-Term>",                               
    "tfee": "<Total-Fee / Charge-Amount>",                   
    "tnat": "<Total-Net-Amount>",                            
    "tote": "<Total-Excluding-Tax>",                         
    "toti": "<Total-Including-Tax>",                         
    "tott": "<Total-Tax-Amount>",                            
    "tpat": "<Total-Payable-Amount>",                        
    "tran": "<Finance-Type>",                                
    "ttat": "<Total-Tax-Amount-Per-Tax-Type>",               
    "ttax": "<Total-Taxable-Amount-Per-Tax-Type>"            
},
    "result": {
        "Lines": [
            {
                "Message": {
                    "amti": "<Line-Invoice-Amount>",
                    "amtt": "<Amount-Exempted-from-Tax>",
                    "ccde": "<Product-Tariff>",
                    "ccty": "<Country-of-Orgin>",
                    "ceno": "<Tax-Exemption-Certificate-Number>",
                    "clas": "<Classification>",
                    "clas_grp": "<Classification-Group>",
                    "created_timestamp": "<Created-timestamp>",
                    "created_user": "<Created-user>",
                    "cuni": "<Unit-of-Measure>",
                    "cvat": "<Tax-Type>",
                    "disc": "<Discount-Rate>",
                    "disc_reason": "<Discount-reason>",
                    "dqua": "<Quantity>",
                    "e_inv_no": "<E-Invoice-Number>",
                    "einv_lines_id": "<E-Invoice-Line-Id>",
                    "err_msg": "<Invoice-Line-Error>",
                    "fee_reason": "<Fees-Reason>",
                    "feea": "<Fee / Charge-Amount>",
                    "feer": "<Fee / Charge-Rate>",
                    "item": "<Item-Code>",
                    "item_desc": "<Item-Description>",
                    "ldai": "<Discount-Amount>",
                    "line": "<Line>",
                    "lsta": "<Invoice-Line-Status>",
                    "modi_lsta": "<Line-Modification-Status>",
                    "pric": "<Price>",
                    "pvat": "<Tax-Rate>",
                    "reference0": "<Reference-0>",
                    "reference1": "<Reference-1>",
                    "reference2": "<Reference-2>",
                    "reference3": "<Reference-3>",
                    "reference4": "<Reference-4>",
                    "reference5": "<Reference-5>",
                    "reference6": "<Reference-6>",
                    "reference7": "<Reference-7>",
                    "reference8": "<Reference-8>",
                    "reference9": "<Reference-9>",
                    "stot": "<Sub-Total>",
                    "txai": "<Tax-Amount>",
                    "updated_timestamp": "<Updated-timestamp>",
                    "updated_user":"<Updated-user>"
                },
                "Success": true 
            }
        ],
        "Message": {
            "adis": "<Invoice-Additional-Discount-Amount>",
            "adis_reason": "<Invoice-Additional-Discount-Amount-Reason>",
            "afee": "<Invoice-Additional-Fee-Amount>",
            "afee_reason": "<Invoice-Additional-Fee-Amount-Reason>",
            "amnt_ex": "<Amount-Exemption-from-Tax>",
            "anum": "<Authorisation-Number-for-Certified-Exporter>",
            "bedt": "<Billing-Period-End-Date>",
            "bref": "<Bill-Reference-Number>",
            "bsdt": "<Billing-Period-Start-Date>",
            "buy_adrs": "<Buyer-Address>",
            "buy_adrs_line0": "<Buyer-Address-Line-0>",
            "buy_adrs_line1": "<Buyer-Address-Line-1>",
            "buy_adrs_line2": "<Buyer-Address-Line-2>",
            "buy_city": "<Buyer-City>",
            "buy_cont_num": "<Buyer-Contact-Number>",
            "buy_country": "<Buyer-Country-Code>",
            "buy_cste": "<Buyer-State-Code>",
            "buy_email": "<Buyer-Mail>",
            "buy_name": "<Buyer-name>",
            "buy_postal_zone": "<Buyer-Postal-Code>",
            "buy_reg_army": "<Buyer-Army>",
            "buy_reg_brn": "<Buyer-Registration-Number>",
            "buy_reg_nric": "<Buyer-NRIC>",
            "buy_reg_passport": "<Buyer-Passport>",
            "buy_sst_reg": "<Buyer-SST-Registration>",
            "buy_tin": "<Buyer-TIN>",
            "ccur": "<Invoice-Currency-Code>",
            "comp": "<Supplier-Code>",
            "created_timestamp": "<Created-timestamp>",
            "created_user": "<Created-user>",
            "cvat": "<Tax-Type>",
            "dataset": "<Dataset>",
            "det_tax": "<Detail-of-Tax-Exemption>",
            "doc_uuid": "<LHDN-UUID>",
            "doct": "<Invoice-Type>",
            "dshp": false,
            "dtrm": "<Incoterms>",
            "e_inv_no": "<E-Invoice-Number>",
            "e_invdt": "<E-Invoice-Date & Time>",
            "einv_header_id": "<E-Invoice-header-Id>",
            "einv_stat": "<E-Invoice-Status>",
            "err_msg": "<Error-Message>",
            "esta": "<LHDN-Status>",
            "etim": "<LHDN-Validated-Date & Time>",
            "fbil": "<Frequency-of-Billing>",
            "frm1": "<Reference-No-of-Customs-form No 1, 9, etc>",
            "frm2": "<Reference-Number-of-Customs-Form No.2>",
            "ftrd": "<Free-Trade-Agreement-Information>",
            "idoc": "<Invoice-Number>",
            "inv_bp": "<Buyer-Code>",
            "inv_pdf": "<PDF-Resource-ID>",
            "line_cnt": "<Line-Count>",
            "modi_stat": "<Header-Modification-Status>",
            "ochg": false,
            "ochg_amnt": "<Details-of-other-charges - Amount>",
            "ochg_reason": "<Details-of-other-charges - Reason>",
            "org_e_inv_no": "<Original-E-Invoice-Reference-Number>",
            "pamt": "<PrePayment-Amount>",
            "paym": "<Payment-Mode>",
            "pref": "<PrePayment-Reference-Number>",
            "pydt": "<PrePayment-Date>",
            "pytm": "<PrePayment-Time>",
            "ramt": "<Rounding-Amount>",
            "rate": "<Currency-Exchange-Rate>",
            "reference0": "<Reference-0>",
            "reference1": "<Reference-1>",
            "reference2": "<Reference-2>",
            "reference3": "<Reference-3>",
            "reference4": "<Reference-4>",
            "reference5": "<Reference-5>",
            "reference6": "<Reference-6>",
            "reference7": "<Reference-7>",
            "reference8": "<Reference-8>",
            "reference9": "<Reference-9>",
            "s_line_cnt": "<Source-Line-Count>",
            "sctg": "<Sales-Category>",
            "ship_adrs": "<Shipper-Address-Code>",
            "ship_adrs_line0": "<Shipper-Address-Line-0>",
            "ship_adrs_line1": "<Shipper-Address-Line-1>",
            "ship_adrs_line2": "<Shipper-Address-Line-2>",
            "ship_bp": "<Shipper-Code>",
            "ship_city": "<Shipper-City>",
            "ship_country": "<Shipper-Country-Code>",
            "ship_cste": "<Shipper State Code>",
            "ship_name": "<Shipper-Name>",
            "ship_postal_zone": "<Shipper-Postal-Code>",
            "ship_reg_army": "<Shipper-Army>",
            "ship_reg_brn": "<Shipper-Registration-Number>",
            "ship_reg_nric": "<Shipper-NRIC>",
            "ship_reg_passport": "<Shipper-Passport>",
            "ship_tin": "<Shipper-TIN>",
            "src_type": "<Sales-Type>",
            "submission_uid": "<LHDN-Submission-UID>",
            "sup_adrs": "<Supplier-Address-Code>",
            "sup_adrs_line0": "<Supplier-Address-Line-0>",
            "sup_adrs_line1": "<Supplier-Address-Line-1>",
            "sup_adrs_line2": "<Supplier-Address-Line-2>",
            "sup_badsca": "<Supplier-Business-Activity>",
            "sup_bank_acc": "<Supplier-Bank-Account-Number>",
            "sup_city": "<Supplier-City>",
            "sup_cont_num": "<Supplier-Contact-Number>",
            "sup_country": "<Supplirer-Country>",
            "sup_cste": "<Supplier-State-Code>",
            "sup_email": "<Supplier-Mail>",
            "sup_msic": "<Supplier-MSIC-Code>",
            "sup_name": "<Supplier-Name>",
            "sup_postal_zone": "<Supplier-Postal-Code>",
            "sup_reg_army": "<Supplier-Army-Identification>",
            "sup_reg_brn": "<Supplier-Registration-Number>",
            "sup_reg_nric": "<Supplier-NRIC>",
            "sup_reg_passport": "<Supplier-Passport-Number>",
            "sup_sst_reg": "<Supplier-SST-Registration>",
            "sup_tin": "<Supplier-TIN>",
            "sup_ttx_no": "<Supplier-Tourism-Tax-Number>",
            "tdis": "<Total-Discount-Value>",
            "term": "<Payment-Term>",
            "tfee": "<Total Fee / Charge Amount>",
            "tnat": "<Total Net Amount>",
            "tote": "<Total-Excluding-Tax>",
            "toti": "<Total-Including-Tax>",
            "tott": "<Total-Tax-Amount>",
            "tpat": "<Total-Payable-Amount>",
            "tran": "<Finance-Type>",
            "ttat": "<Total-Tax-Amount-Per-Tax-Type>",
            "ttax": "<Total-Taxable-Amount-Per-Tax-Type>",
            "updated_timestamp": "Updated-timestamp",
            "updated_user": "<Updated-user>"
        },
        "Success": true
    }

Fields Details:

Field NameDescriptionData TypeExample
amtiLine Invoice AmountFloat1234.56
amttAmount Exempted from TaxFloat0.00
ccdeProduct TariffString"123456"
cctyCountry of OriginString"USA"
cenoTax Exemption Certificate NumberString"CERT123456"
clasClassificationString"A"
clas_grpClassification GroupString"GRP"
created_timestampCreated TimestampString"2024-07-11T12:34:56Z"
created_userCreated UserString"user1"
cuniUnit of MeasureString"KG"
cvatTax TypeString"VAT"
discDiscount RateFloat10.5
disc_reasonDiscount ReasonString"Seasonal Sale"
dquaQuantityFloat100.0
e_inv_noE-Invoice NumberString"INV123456"
einv_lines_idE-Invoice Line IdString"LINE123456"
err_msgInvoice Line ErrorString"Error in line 3"
fee_reasonFees ReasonString"Service Charge"
feeaFee / Charge AmountFloat50.0
feerFee / Charge RateFloat5.0
itemItem CodeString"ITEM123"
item_descItem DescriptionString"Item Description"
ldaiDiscount AmountFloat20.0
lineLineInteger1
lstaInvoice Line StatusString"Approved"
modi_lstaLine Modification StatusString"Modified"
pricPriceFloat100.0
pvatTax RateFloat7.5
reference0Reference 0String"REF0"
reference1Reference 1String"REF1"
reference2Reference 2String"REF2"
reference3Reference 3String"REF3"
reference4Reference 4String"REF4"
reference5Reference 5String"REF5"
reference6Reference 6String"REF6"
reference8Reference 8String"REF8"
reference9Reference 9String"REF9"
stotSub TotalFloat5000.0
txaiTax AmountFloat375.0
updated_timestampUpdated TimestampString"2024-07-11T12:34:56Z"
updated_userUpdated UserString"user2"
adisInvoice Additional Discount AmountFloat15.0
adis_reasonInvoice Additional Discount Amount ReasonString"Special Offer"
afeeInvoice Additional Fee AmountFloat30.0
afee_reasonInvoice Additional Fee Amount ReasonString"Extra Service"
amnt_exAmount Exemption from TaxString"EX123"
anumAuthorisation Number for Certified ExporterString"AUTH123"
bedtBilling Period End DateDate"2024-12-31"
brefBill-Reference-NumberString"BR123456"
bsdtBilling Period Start DateDate"2024-01-01"
buy_adrsBuyer AddressString"123 Main St"
buy_adrs_line0Buyer Address Line 0String"123 Main St"
buy_adrs_line1Buyer Address Line 1String"Apt 4B"
buy_adrs_line2Buyer Address Line 2String"Floor 5"
buy_cityBuyer CityString"New York"
buy_cont_numBuyer Contact NumberString"1234567890"
buy_countryBuyer Country CodeString"US"
buy_csteBuyer State CodeString"NY"
buy_emailBuyer EmailString"buyer@example.com"
buy_nameBuyer NameString"John Doe"
buy_postal_zoneBuyer Postal ZoneString"10001"
buy_reg_armyBuyer ArmyString"ARMY123"
buy_reg_brnBuyer Registration NumberString"BRN123456"
buy_reg_nricBuyer NRICString"NRIC123456"
buy_reg_passportBuyer PassportString"P1234567"
buy_sst_regBuyer SST RegistrationString"SST123456"
buy_tinBuyer TINString"TIN123456"
ccurInvoice Currency CodeString"USD"
compSupplier CodeInteger101
created_timestampCreated TimestampString"2024-07-11T12:34:56Z"
created_userCreated UserString"user1"
cvatTax TypeString"VAT"
datasetDatasetString"DS1"
det_taxDetail of Tax ExemptionString"Detailed Info"
doc_uuidLHDN UUIDString"UUID123456"
doctInvoice TypeString"IT"
dshpDropshipmentBooleantrue
dtrmIncotermsString"CIF"
e_inv_noE-Invoice NumberString"INV123456"
e_invdtE-Invoice Date & TimeDateTime"2024-07-11T12:34:56Z"
einv_header_idE-Invoice Header IdString"HDR123456"
einv_statE-Invoice StatusString"Approved"
err_msgError MessageString"Error in line 3"
estaLHDN StatusString"Validated"
etimLHDN Validated Date & TimeDateTime"2024-07-11T15:30:00Z"
fbilFrequency of BillingString"Monthly"
frm1Reference No of Customs Form No 1, 9, etc.String"CUST123456"
frm2Reference Number of Customs Form No. 2String"CUST789012"
ftrdFree Trade Agreement (FTA) InformationString"FTA Details Here"
idocInvoice NumberInteger123456
inv_bpBuyer CodeString"BUY123456"
inv_pdfPDF Resource IDString"PDF123456"
line_cntLine CountInteger5
modi_statHeader Modification StatusString"Modified"
ochgDetails of Other ChargesBooleantrue
org_e_inv_noOriginal E-Invoice Reference NumberString"ORGINV123456"
pamtPrePayment AmountString"500.00"
paymPayment ModeString"Credit Card"
prefPrePayment Reference NumberString"PRE123456"
pydtPrePayment DateDate"2024-07-10"
pytmPrePayment TimeDateTime"2024-07-10T14:00:00Z"
ramtRounding AmountFloat0.05
rateCurrency Exchange RateFloat1.25
reference0Reference 0String"REF0001"
reference1Reference 1String"REF0002"
reference2Reference 2String"REF0003"
reference3Reference 3String"REF0004"
reference4Reference 4String"REF0005"
reference5Reference 5String"REF0006"
reference6Reference 6String"REF0007"
reference7Reference 7String"REF0008"
reference8Reference 8String"REF0009"
reference9Reference 9String"REF0010"
s_line_cntSource Line CountInteger3
sctgSales CategoryString"Category A"
ship_adrsShipper Address CodeString"SHIP123456"
ship_adrs_line0Shipper Address Line 0String"123 Main St"
ship_adrs_line1Shipper Address Line 1String"Apt 4B"
ship_adrs_line2Shipper Address Line 2String"Floor 5"
ship_bpShipper CodeString"SHIPBP123"
ship_cityShipper CityString"New York"
ship_countryShipper CountryString"USA"
ship_csteShipper State CodeString"NY"
ship_nameShipper NameString"John Doe Shipping"
ship_postal_zoneShipper Postal CodeString"10001"
ship_reg_armyShipper ArmyString"ARMY123"
ship_reg_brnShipper Registration NumberString"BRN123456"
ship_reg_nricShipper NRICString"NRIC123456"
ship_reg_passportShipper PassportString"P1234567"
ship_tinShipper TINString"TIN123456"
src_typeSales TypeString"Type A"
submission_uidLHDN Submission UIDString"UID123456"
sup_adrsSupplier Address CodeString"SUP123456"
sup_adrs_line0Supplier Address Line 0String"456 Main St"
sup_adrs_line1Supplier Address Line 1String"Suite 10"
sup_adrs_line2Supplier Address Line 2String"Building 2"
sup_badscaSupplier Business ActivityString"Business Activity A"
sup_bank_accSupplier Bank Account NumberString"ACC123456"
sup_citySupplier CityString"Los Angeles"
sup_cont_numSupplier Contact NumberString"9876543210"
sup_countrySupplier CountryString"USA"
sup_csteSupplier State CodeString"CA"
sup_emailSupplier EmailString"supplier@example.com"
sup_msicSupplier MSIC CodeString"MSIC123456"
sup_nameSupplier NameString"ABC Supplies"
sup_postal_zoneSupplier Postal CodeString"90001"
sup_reg_armySupplier Army IdentificationString"SUPARMY123"
sup_reg_brnSupplier Registration NumberString"SUPBRN123456"
sup_reg_nricSupplier NRICString"SUPNRIC123456"
sup_reg_passportSupplier Passport NumberString"SUPP1234567"
sup_sst_regSupplier SST RegistrationString"SST123456"
sup_tinSupplier TINString"TIN123456"
sup_ttx_noSupplier Tourism Tax NumberString"TTX123456"
tdisTotal Discount ValueFloat50.00
termPayment TermString"Net 30"
tfeeTotal Fee / Charge AmountFloat15.00
tnatTotal Net AmountFloat1000.00
toteTotal Excluding TaxFloat950.00
totiTotal Including TaxFloat1050.00
tottTotal Tax AmountFloat100.00
tpatTotal Payable AmountFloat1100.00
tranFinance TypeString"C"
ttatTotal Tax Amount Per Tax TypeFloat25.00
ttaxTotal Taxable Amount Per Tax TypeFloat80.00
updated_timestampUpdated TimestampString"2024-07-11T16:45:00Z"
updated_userUpdated UserString"user123"

When a particular sequence value of Supplier code,Invoice number,Sales type and Finance type is already present in the database:

json
{
    "message": "Record already exists!",
    "Success": false
}

When an invalid data type is passed:

json
{
    "Message": "ERROR: invalid input syntax for type [data type]",
    "Success": false,
}

When you pass the invalid company number other than the existing company:

json
{
    "Message": "ERROR: duplicate key value violates unique constraint [Company code]",
    "Success": false
}

When you pass the invalid buyer code:

json
{
    "error": "ReferenceError: buyer_address is not defined at insert_header"
}

Response Body: (Status: 401 - Unauthorized)

When there is no token or invalid token passed:

json
{
    "message": "Unauthorized!"
}