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
Code | Examples | Acceptable Values |
---|---|---|
01 | Invoice | INV |
02 | Credit Note | CRD |
03 | Debit Note | DBT |
04 | Refund Note | RFD |
11 | Self-billed Invoice | SLF_INV |
12 | Self-billed Credit Note | SLF_CRD |
13 | Self-billed Debit Note | SLF_DBT |
14 | Self-billed Refund Note | SLF_REF |
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.,non-peppol
).Content-Type
: Set asapplication/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",
"buyerTinNumber": "C21540299050",
"buyerRegistrationIdType": "BRN",
"buyerRegistrationId": "200901037548",
"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
ObjectName | Field Name | Conditionality | Informatics | Field Max Length | Sample Value |
---|---|---|---|---|---|
Invoice Details | |||||
documentType | e-Invoice Type Code | Mandatory | Identifies the document type (e.g., INV, CRD, DBT, RFD, SLF_INV, SLF_CRD, SLF_DBT, SLF_REF.) | 2 | INV |
documentId | e-Invoice Code / Number | Mandatory | Document reference number used by Supplier for internal tracking purpose | 50 | INV12345 |
documentIssueDate | e-Invoice Date | Mandatory | Date of issuance of the e-Invoice (Note that the date must be the current date) | 10 | 2017-11-26 |
documentIssueTime | e-Invoice Time | Mandatory | Time of issuance of the e-Invoice (Note that the time must be the current time) | 12 | 15:30:00.0Z |
documentCurrencyCode | Invoice Currency Code | Mandatory | Specific currency that is used to represent the monetary value stated in the e-Invoice | 3 | MYR |
invoiceFrequency | Frequency of Billing | Optional | Frequency of the invoice (e.g., Daily, Weekly, Monthly, Bimonthly, Quarterly, Half-yearly, Yearly, Others) | 50 | Monthly |
invoiceStartDate | Billing Period Start Date | Optional | Interval of the transaction | 10 | 2017-11-26 |
invoiceEndDate | Billing Period End Date | Optional | End date of the transaction interval | 10 | 2017-11-30 |
Supplier Details
ObjectName | Field Name | Conditionality | Informatics | Field Max Length | Sample Value |
---|---|---|---|---|---|
Supplier Details | |||||
supplierId | Supplier ID | Optional | Identification Number of a Specific Supplier in an Invoice | 20 | 1 |
supplierSstRegistrationNumber | supplierSstRegistrationNumber | Mandatory | Sales tax / service tax (SST) registration number of the Supplier (input "NA" if not registered for SST) | A01-2345-67891012 | |
supplierDetails.organizationName | Supplier’s Name | Mandatory | Name of business or individual who will be the issuer of the e-Invoice in a commercial transaction | 300 | AMS Setia Jaya Sdn. Bhd. |
sellerTinNumber | Supplier’s TIN | Mandatory | Supplier’s (i.e., issuer’s) TIN assigned by IRBM | 14 | C2584563202 |
sellerRegistrationIdType | Supplier’s Registration scheme ID | Mandatory | Business registration number / MyKad / Passport number depending on entity | 12 | BRN |
sellerRegistrationId | Supplier’s Registration / Identification Number / Passport Number | Mandatory | Business registration number / MyKad / Passport number depending on entity | 20 | BRN: 202001234567 |
supplierDetails.email | Supplier’s e-mail | Optional | E-mail address of the Supplier (Provide "NA" if unavailable) | 320 | general.ams@supplier.com |
supplierDetails.industryCode | Supplier’s MSIC Code | Mandatory | 5-digit numeric code representing the Supplier’s business nature and activity | 5 | 1111 |
supplierDetails.industryDescription | Supplier’s Business Activity Description | Mandatory | Description of the Supplier’s business activity | 300 | Growing of maize |
supplierDetails.phoneNumber | Supplier’s Contact Number | Mandatory | The telephone number of the Supplier | 15 | -123456729 |
Supplier’s Address
ObjectName | Field Name | Conditionality | Informatics | Field Max Length | Sample Value |
---|---|---|---|---|---|
sellerAddress.addressLine1 | Address Line 1 | Mandatory | The main address line in an address structure. Input "NA" if unavailable | 150 | Lot 66 |
sellerAddress.addressLine2 | Address Line 2 | Optional | An additional address line for further details | 150 | Bangunan Merdeka |
sellerAddress.addressLine3 | Address Line 3 | Optional | An additional address line for further details | 150 | Persiaran Jaya |
sellerAddress.postalCode | Postal Zone | Optional | The identifier for a postal zone | 50 | 50480 |
sellerAddress.city | City Name | Mandatory | The common name of the city | 50 | Kuala Lumpur |
sellerAddress.state | State | Mandatory | The state of a country | 50 | 14 |
sellerAddress.country | Country | Mandatory | A code identifying the country | 3 | MYS |
Buyer Details
ObjectName | Field Name | Conditionality | Informatics | Field Max Length | Sample Value |
---|---|---|---|---|---|
Buyer Details | |||||
buyerId | Buyer ID | Optional | Identification Number of a Specific Buyer in an Invoice | 20 | 1 |
buyerDetails.organizationName | Buyer’s Name | Mandatory | Name of the recipient of the e-Invoice in a commercial transaction | 300 | Full Formal Buyer Name BHD. |
buyerTinNumber | Buyer’s TIN | Mandatory | Buyer’s (i.e., issuer’s) TIN assigned by IRBM | 14 | C2584563202 |
buyerRegistrationIdType | Buyer’s Registration / Identification Number / Passport Scheme ID | Mandatory | Business registration number / MyKad / Passport number depending on entity | 12 | BRN |
buyerRegistrationId | Buyer’s Registration / Identification Number / Passport Number | Optional | Business registration number / MyKad / Passport number depending on entity | 20 | BRN: 202001234567 |
buyerDetails.email | Buyer’s e-mail | Optional | E-mail address of the Buyer (Provide "NA" if unavailable) | 320 | name@buyer.com |
buyerDetails.phoneNumber | Buyer’s Contact Number | Mandatory | The telephone number of the Buyer | 15 | -123456729 |
Buyer’s Address
ObjectName | Field Name | Conditionality | Informatics | Field Max Length | Sample Value |
---|---|---|---|---|---|
buyerAddress.addressLine1 | Address Line 1 | Mandatory | The main address line in an address structure. Input "NA" if unavailable | 150 | Lot 66 |
buyerAddress.addressLine2 | Address Line 2 | Optional | An additional address line for further details | 150 | Bangunan Merdeka |
buyerAddress.addressLine3 | Address Line 3 | Optional | An additional address line for further details | 150 | Persiaran Jaya |
buyerAddress.postalCode | Postal Zone | Optional | The identifier for a postal zone | 50 | 50480 |
buyerAddress.city | City Name | Mandatory | The common name of the city | 50 | Kuala Lumpur |
buyerAddress.state | State | Mandatory | The state of a country | 50 | 14 |
buyerAddress.country | Country | Mandatory | A code identifying the country | 3 | MYS |
Invoice Line Item
ObjectName | Field Name | Conditionality | Informatics | Field Max Length | Sample Value |
---|---|---|---|---|---|
documentLineItems.lineItemId | Line ID | Mandatory | Identification of a Specific Line in an Invoice | 20 | 1 |
documentLineItems.commodityClassificationCode | Classification | Mandatory | Category of products or services being billed | 3 | 1 |
documentLineItems.description | Description of Product or Service | Mandatory | Details of products or services being billed | 300 | Laptop Peripherals |
documentLineItems.unitPrice | Unit Price | Mandatory | Price assigned to a single unit of a product or service | 17 | |
documentLineItems.quantity | Quantity | Optional | Number of units of a product or service | 1 | |
documentLineItems.lineItemSubtotal | Subtotal | Mandatory | Amount of each individual item, excluding any taxes or charges | 100 | |
documentLineItems.lineTotalExcludingTax | Total Excluding Tax | Mandatory | Sum of amount payable excluding any applicable taxes | 1436.5 | |
documentLineItems.taxType | Tax Type | Mandatory | Type of taxes that will be applicable | 2 | 1 |
documentLineItems.taxPercentage | Tax Rate | Mandatory | The appropriate tax rate that is applicable | 6 | |
documentLineItems.totalTax | Tax Amount | Mandatory | The amount of tax payable | 292.2 | |
documentLineItems.taxCode | Details of Tax Exemption | Optional | Description of tax exemption applicable | 300 | SST exemption |
documentLineItems.taxExemptionReason | Amount Exempted from Tax | Conditional Mandatory | Total amount of tax exempted for SST purposes | 1460.5 | |
documentLineItems.chargeAmount | Charge Amount | Optional | Charge associated with the product or service imposed after tax | 1000 | |
documentLineItems.discountAmount | Discount Amount | Optional | Amount deducted from the original price of a product | 1000 |
Summary
ObjectName | Field Name | Conditionality | Informatics | Field Max Length | Sample Value |
---|---|---|---|---|---|
invoiceAdditionalChargeAmount | Charge Amount | Optional | Additional Discount at Invoice Level | 1000 | |
invoiceAdditionalDiscountAmount | Discount Amount | Optional | Additional Charges at Invoice Level | 1000 | |
totalExcludingTax | Total Excluding Tax | Mandatory | Sum of amount payable excluding any applicable taxes | 1436.5 | |
usedTaxTypes.taxType | Tax Type | Mandatory | Type of taxes that will be applicable (e.g., sales tax, service tax, etc.) | 2 | 1 |
usedTaxTypes.taxableAmount | Total Taxable Amount Per Tax Type | Optional | Sum of amount chargeable for each tax type | 1460.5 | |
usedTaxTypes.taxAmount | Total Tax Amount Per Tax Type | Mandatory | Sum of amount chargeable for each tax type | 1460.5 | |
usedTaxTypes.taxExemptionReason | Details of Tax Exemption | Optional | Description of tax exemption applicable at invoice level | SST exemption | |
taxTotal | Total Tax Amount | Mandatory | Total amount of tax payable | 1234 | |
documentTotal | Invoice Total Amount Including Tax | Mandatory | Sum of amount payable inclusive of total taxes chargeable | 1436.5 | |
totalPayableAmount | Total Payable Amount | Mandatory | Sum of amount payable excluding any amount paid in advance and rounding | 1436.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 Code | Description |
---|---|
400 | Bad Request – Invalid data in the request. |
401 | Unauthorized – Invalid or missing API key. |
500 | Internal 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 Code | Description |
---|---|
200 | Success – The request was processed successfully. |
202 | Accepted – 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.