Skip to main content

Unify

Overview

The Unify API allows you to validate and process both Business-to-Business (B2B) and Business-to-Consumer (B2C) invoices. The API supports various document types such as invoices, credit notes, and debit notes, and ensures compliance with relevant tax and invoicing regulations.

e-Invoice Types

CodeExamplesAcceptable Values
01InvoiceINV
02Credit NoteCRD
11Self-billed InvoiceSLF_INV
12Self-billed Credit NoteSLF_CRD

Unify API Endpoint

Endpoint:

malaysia-sandbox.complyance.io/unify

This endpoint validates and processes invoice data, including seller and buyer details, line items, and tax information.

Headers:

  • x-api-key: Your API key.
  • invoiceMethod: Specify the invoice method (e.g., peppol).
  • Content-Type: Set as application/json.

curl --location 'https://malaysia.complyance.io/dev/unify' \
--header 'x-api-key: k4PW_J0s8DtBSdvYnadXn' \
--header 'Content-Type: application/json'

Example Request:

{
"invoiceDataList": [
{
"documentId": 1236743,
"documentIssueDate": "2024-07-10",
"documentIssueTime": "02:30:00Z",
"invoiceStartDate": "2024-06-01",
"invoiceEndDate": "2024-06-01",
"invoiceFrequency": "DAILY",
"currency": "MYR",
"documentType": "INV",
"sellerTinNumber": "C21540299050",
"sellerRegistrationIdType": "BRN",
"sellerRegistrationId": "200901037548",
"supplierParticipantId":"0230:05TESTPARTICIPANTID",
"supplierTradingName":"Supplier Company Sdn. Bhd.",
"sellerPointOfContact":"",
"buyerAccountingLedgerReference":"",
"deliveryDate":"",
"buyerTinNumber": "C21540299050",
"buyerRegistrationIdType": "BRN",
"buyerRegistrationId": "200901037548",
"buyerParticipantId":"0230:05TESTPARTICIPANTID",
"buyerPointOfContact":"John",
"buyerAddress": {
"addressLine1": "123 Supplier Street",
"addressLine2": "Suite 100",
"city": "Kuala Lumpur",
"postalCode": "50480",
"state": "149",
"country": "MYS"
},
"sellerAddress": {
"addressLine1": "123 Supplier Street",
"addressLine2": "Suite 100",
"city": "Kuala Lumpur",
"postalCode": "50480",
"state": "14",
"country": "MYS"
},
"supplierDetails": {
"industryCode": "01111",
"industryDescription": "Growing of maize",
"organizationName": "Supplier Company",
"phoneNumber": "+60 123-456-789",
"email": "supplier@example.com"
},
"buyerDetails": {
"organizationName": "Buyer Company",
"phoneNumber": "+60 987-654-321",
"email": "aaf@complyance.io"
},
"documentLineItems": [
{
"lineItemId": 1,
"lineNote": "Note for the line item",
"linePOReference": "PO123456",
"lineSupplyStartDate": "2024-06-01",
"lineSupplyEndDate": "2024-06-10",
"description": "Product 1",
"unitPrice": 100,
"quantity": 2,
"lineTotalExcludingTax": 200,
"totalTax": 20,
"lineItemSubtotal": 200,
"taxPercentage": 10,
"taxType": "05",
"commodityClassificationCode": "001"
}
],
"usedTaxTypes": [
{
"taxableAmount": 200,
"taxAmount": 0,
"taxType": "05",
"taxExemptionReason": "Exempt New Means of Transport",
"taxCode": "05"
}
],
"totalExcludingTax": 200.00,
"taxTotal": 20.00,
"documentTotal": 220.00,
"amountToPay": 220.00,
"originalEInvoiceReferenceNumber": "INV123456",
"paymentMeans": "01"
}
]
}

Request Parameter Fields

Invoice Details

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
Invoice Details
documentTypee-Invoice Type CodeMandatoryIdentifies the document type (e.g., INV, CRD,SLF, SLF_CRD.)2INV
documentIde-Invoice Code / NumberMandatoryDocument reference number used by Supplier for internal tracking purpose50INV12345
documentIssueDatee-Invoice DateMandatoryDate of issuance of the e-Invoice (Note that the date must be the current date)102017-11-26
documentIssueTimee-Invoice TimeMandatoryTime of issuance of the e-Invoice (Note that the time must be the current time)1215:30:00.0Z
documentCurrencyCodeInvoice Currency CodeMandatorySpecific currency that is used to represent the monetary value stated in the e-Invoice3MYR
invoiceFrequencyFrequency of BillingOptionalFrequency of the invoice (e.g., Daily, Weekly, Monthly, Bimonthly, Quarterly, Half-yearly, Yearly, Others)50Monthly
invoiceStartDateBilling Period Start DateOptionalInterval of the transaction102017-11-26
invoiceEndDateBilling Period End DateOptionalEnd date of the transaction interval102017-11-30

Supplier Details

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
Supplier Details
supplierIdSupplier IDOptionalIdentification Number of a Specific Supplier in an Invoice201
supplierSstRegistrationNumbersupplierSstRegistrationNumberMandatorySales tax / service tax (SST) registration number of the Supplier (input "NA" if not registered for SST)A01-2345-67891012
supplierDetails.organizationNameSupplier’s NameMandatoryName of business or individual who will be the issuer of the e-Invoice in a commercial transaction300AMS Setia Jaya Sdn. Bhd.
sellerTinNumberSupplier’s TINMandatorySupplier’s (i.e., issuer’s) TIN assigned by IRBM14C2584563202
sellerRegistrationIdTypeSupplier’s Registration scheme IDMandatoryBusiness registration number / MyKad / Passport number depending on entity12BRN
sellerRegistrationIdSupplier’s Registration / Identification Number / Passport NumberMandatoryBusiness registration number / MyKad / Passport number depending on entity20BRN: 202001234567
supplierDetails.emailSupplier’s e-mailOptionalE-mail address of the Supplier (Provide "NA" if unavailable)320general.ams@supplier.com
supplierDetails.industryCodeSupplier’s MSIC CodeMandatory5-digit numeric code representing the Supplier’s business nature and activity51111
supplierDetails.industryDescriptionSupplier’s Business Activity DescriptionMandatoryDescription of the Supplier’s business activity300Growing of maize
supplierDetails.phoneNumberSupplier’s Contact NumberMandatoryThe telephone number of the Supplier15-123456729

Supplier’s Address

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
sellerAddress.addressLine1Address Line 1MandatoryThe main address line in an address structure. Input "NA" if unavailable150Lot 66
sellerAddress.addressLine2Address Line 2OptionalAn additional address line for further details150Bangunan Merdeka
sellerAddress.addressLine3Address Line 3OptionalAn additional address line for further details150Persiaran Jaya
sellerAddress.postalCodePostal ZoneOptionalThe identifier for a postal zone5050480
sellerAddress.cityCity NameMandatoryThe common name of the city50Kuala Lumpur
sellerAddress.stateStateMandatoryThe state of a country5014
sellerAddress.countryCountryMandatoryA code identifying the country3MYS

Buyer Details

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
Buyer Details
buyerIdBuyer IDOptionalIdentification Number of a Specific Buyer in an Invoice201
buyerDetails.organizationNameBuyer’s NameMandatoryName of the recipient of the e-Invoice in a commercial transaction300Full Formal Buyer Name BHD.
buyerTinNumberBuyer’s TINMandatoryBuyer’s (i.e., issuer’s) TIN assigned by IRBM14C2584563202
buyerRegistrationIdTypeBuyer’s Registration / Identification Number / Passport Scheme IDMandatoryBusiness registration number / MyKad / Passport number depending on entity12BRN
buyerRegistrationIdBuyer’s Registration / Identification Number / Passport NumberOptionalBusiness registration number / MyKad / Passport number depending on entity20BRN: 202001234567
buyerDetails.emailBuyer’s e-mailOptionalE-mail address of the Buyer (Provide "NA" if unavailable)320name@buyer.com
buyerDetails.phoneNumberBuyer’s Contact NumberMandatoryThe telephone number of the Buyer15-123456729

Buyer’s Address

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
buyerAddress.addressLine1Address Line 1MandatoryThe main address line in an address structure. Input "NA" if unavailable150Lot 66
buyerAddress.addressLine2Address Line 2OptionalAn additional address line for further details150Bangunan Merdeka
buyerAddress.addressLine3Address Line 3OptionalAn additional address line for further details150Persiaran Jaya
buyerAddress.postalCodePostal ZoneOptionalThe identifier for a postal zone5050480
buyerAddress.cityCity NameMandatoryThe common name of the city50Kuala Lumpur
buyerAddress.stateStateMandatoryThe state of a country5014
buyerAddress.countryCountryMandatoryA code identifying the country3MYS

Invoice Line Item

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
documentLineItems.lineItemIdLine IDMandatoryIdentification of a Specific Line in an Invoice201
documentLineItems.commodityClassificationCodeClassificationMandatoryCategory of products or services being billed31
documentLineItems.descriptionDescription of Product or ServiceMandatoryDetails of products or services being billed300Laptop Peripherals
documentLineItems.unitPriceUnit PriceMandatoryPrice assigned to a single unit of a product or service17
documentLineItems.quantityQuantityOptionalNumber of units of a product or service1
documentLineItems.lineItemSubtotalSubtotalMandatoryAmount of each individual item, excluding any taxes or charges100
documentLineItems.lineTotalExcludingTaxTotal Excluding TaxMandatorySum of amount payable excluding any applicable taxes1436.5
documentLineItems.taxTypeTax TypeMandatoryType of taxes that will be applicable21
documentLineItems.taxPercentageTax RateMandatoryThe appropriate tax rate that is applicable6
documentLineItems.totalTaxTax AmountMandatoryThe amount of tax payable292.2
documentLineItems.taxCodeDetails of Tax ExemptionOptionalDescription of tax exemption applicable300SST exemption
documentLineItems.taxExemptionReasonAmount Exempted from TaxConditional MandatoryTotal amount of tax exempted for SST purposes1460.5
documentLineItems.chargeAmountCharge AmountOptionalCharge associated with the product or service imposed after tax1000
documentLineItems.discountAmountDiscount AmountOptionalAmount deducted from the original price of a product1000

Peppol Data

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
supplierIdPeppol Id of the supplierConditional MandatorySupplier or Seller's participant id in the Peppol network0230:05TESTID
buyerIdPeppol Id of the buyerConditional MandatoryBuyer's participant id in the Peppol network0230:05TESTID
supplierTradingNameRegistered business nameConditional MandatorySupplier business name registered in SSMCompany Name Sdn. Bhd.
sellerPointOfContactSeller nameConditional MandatorySeller point of contact nameJohn
buyerPointOfContactBuyer NameConditional MandatoryBuyer point of contact nameJohn
shippingRecipientLocationIdShipping location IDConditional MandatoryAn identifier for the location at which the goods and services are delivered
buyerAccountingLedgerReferenceLedger referenceConditional MandatoryBuyer Accounting or Ledger Reference
deliveryDateDelivery DateConditional MandatoryThe date on which the supply of goods or services was made or completed

Summary

ObjectNameField NameConditionalityInformaticsField Max LengthSample Value
invoiceAdditionalChargeAmountCharge AmountOptionalAdditional Discount at Invoice Level1000
invoiceAdditionalDiscountAmountDiscount AmountOptionalAdditional Charges at Invoice Level1000
totalExcludingTaxTotal Excluding TaxMandatorySum of amount payable excluding any applicable taxes1436.5
usedTaxTypes.taxTypeTax TypeMandatoryType of taxes that will be applicable (e.g., sales tax, service tax, etc.)21
usedTaxTypes.taxableAmountTotal Taxable Amount Per Tax TypeOptionalSum of amount chargeable for each tax type1460.5
usedTaxTypes.taxAmountTotal Tax Amount Per Tax TypeMandatorySum of amount chargeable for each tax type1460.5
usedTaxTypes.taxExemptionReasonDetails of Tax ExemptionOptionalDescription of tax exemption applicable at invoice levelSST exemption
taxTotalTotal Tax AmountMandatoryTotal amount of tax payable1234
documentTotalInvoice Total Amount Including TaxMandatorySum of amount payable inclusive of total taxes chargeable1436.5
totalPayableAmountTotal Payable AmountMandatorySum of amount payable excluding any amount paid in advance and rounding1436.5

Error Handling:

Error Response Example

When an error occurs during submission, the system returns a JSON response containing details of the error.

{
"submissionUid": "RX6B21HC498ZENSDT46CDD7J10",
"rejectedDocuments": [
{
"documentUlid": "01J7DDBTBYG1G5JQED12RZ2QWR",
"uuid": "3A2FR8X29FZ3H12ET46CDD7J10",
"status": "Rejected",
"errorCode": "ERR123",
"errorMessage": "Invalid Tax ID format"
}


],
"acceptedDocuments": [],
"timestamp": "2023-08-14T08:15:30Z"
}

The API may return the following error responses depending on the validation result or request issues:

Error CodeDescription
400Bad Request – Invalid data in the request.
401Unauthorized – Invalid or missing API key.
500Internal Server Error – Server encountered an error.

Success Handling:

Success Response Example

When a submission is successful, the system returns a JSON response with details of the accepted documents.

{
"submissionUid": "RX6B21HC498ZENSDT46CDD7J10",
"acceptedDocuments": [
{
"documentUlid": "01J7DDBTBYG1G5JQEDVY8C1H6S",
"uuid": "3A2FR8X29FZ3H12ET46CDD7J10",
"invoiceCodeNumber": "ML-ST-2424",
"xmlEncoded": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8SW52b2ljZSB4bWxucz0idXJuOm9hc2lzOm5hbWVzOnNwZWNpZmljYXRpb246dWJsOnNjaGVtYTp4c2Q6SW52b2ljZS0yIiB4bWxuczpjYWM9InVybjpvYXNpczpuYW1lczpzcGVjaWZpY2F0aW9uOnVibDpzY2hlbWE6eHNkOkNvbW1vbkFnZ3JlZ2F0ZUNvbXBvbmVudHMtMiIgeG1sbnM6Y2JjPSJ1cm46b2FzaXM6bmFtZXM6c3BlY2lmaWNhdGlvbnU6dWJsOnNjaGVtYTp4c2Q6Q29tbW9uQmFzaWNDb21wb25lbnRzLTIiIHhtbG5zOm5zND0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2ljIj4KCTxVQkxFeHRlbnNpb25zIHhtbG5zPSJ1cm46b2FzaXM6bmFtZXM6c3BlY2lmaWNhdGlvbnU6dWJsOnNjaGVtYTp4c2Q6Q29tbW9uRXh0ZW5zaW9uQ29tcG9uZW50cy0yIiB4bWxuczppbmZvPSJodHRwOi8vd3d3LmV4YW1wbGUuY29tL2luZm8uYXNkIj4KCQk8VGVzdERhdGE+U29tZSBkYXRhIGhlcmUuPC9UZXN0RGF0YT4KCQk8U2lnbmF0dXJlPgoJCQk8U2lnbmF0dXJlSW5mbz5EYXRhPC9TaWduYXR1cmVJbmZvPgoJCTwvU2lnbmF0dXJlPgo8L0ludm9pY2U+Cg=="
}
],
"rejectedDocuments": [],
"timestamp": "2023-08-14T08:15:30Z"
}

The API may return the following success responses depending on the validation result or submission status:

Status CodeDescription
200Success – The request was processed successfully.
202Accepted – The request has been accepted but is still processing.

  • Ensure that your document types are accepted based on the specifications of your jurisdiction.
  • Confirm that the invoice format complies with the standards to avoid any delays.