Validations
API endpoints for validating TIN numbers, invoice codes, and adjustment note codes
Validations API
Validate tax identification numbers (TIN), invoice codes, and adjustment note codes before creating documents.
Validate TIN
Validate a tax identification number against LHDN's MyInvois records. This endpoint forwards the request to LHDN's API and returns their response.
Endpoint
POST /api/validation/tinHeaders
| Header | Value |
|---|---|
X-API-Key | Your API key |
Content-Type | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
registration_type | string | Yes | Registration type: NRIC, BRN, PASSPORT, or ARMY |
registration_number | string | Conditional | Registration number (requires tin if provided) |
tin | string | Conditional | Tax identification number (required when registration_number is provided) |
At least one of tin or registration_number must be provided.
Response
Valid TIN (200)
{
"data": {
"valid": true
},
"message": "TIN is valid"
}Invalid Registration Type (400)
{
"success": false,
"message": "Invalid registration type"
}TIN Required (400)
When registration_number is provided without tin:
{
"success": false,
"message": "TIN is required when only registration number is provided"
}Missing Fields (400)
When neither tin nor registration_number is provided:
{
"success": false,
"message": "TIN or registration number is required"
}TIN Not Found (404)
When the TIN does not exist in LHDN's records:
{
"error": {
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.5",
"title": "Not Found",
"status": 404,
"traceId": "00-2e7bc66033170bd65716ea5a0d790462-5d81cc5bbb1c6d33-00"
}
}Code Examples
cURL
curl -X POST https://api.bizcare-einvoice.com/api/validation/tin \
-H "X-API-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"registration_type": "NRIC",
"registration_number": "000229070243",
"tin": "IG40125832070"
}'JavaScript
const response = await fetch('https://api.bizcare-einvoice.com/api/validation/tin', {
method: 'POST',
headers: {
'X-API-Key': 'your-api-key-here',
'Content-Type': 'application/json',
},
body: JSON.stringify({
registration_type: 'NRIC',
registration_number: '000229070243',
tin: 'IG40125832070',
}),
});
const data = await response.json();Python
response = requests.post(
'https://api.bizcare-einvoice.com/api/validation/tin',
headers={'X-API-Key': 'your-api-key-here'},
json={
'registration_type': 'NRIC',
'registration_number': '000229070243',
'tin': 'IG40125832070',
},
)PHP
$response = Http::withHeaders([
'X-API-Key' => 'your-api-key-here',
])->post('https://api.bizcare-einvoice.com/api/validation/tin', [
'registration_type' => 'NRIC',
'registration_number' => '000229070243',
'tin' => 'IG40125832070',
]);Validate Invoice Code
Check whether an invoice code is already used for the current year.
Endpoint
POST /api/validation/invoice-codeHeaders
| Header | Value |
|---|---|
X-API-Key | Your API key |
Content-Type | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
invoice_code | number | Yes | Invoice code to check |
invoice_id | number | No | Existing invoice ID (for update scenarios — excludes this invoice from the uniqueness check) |
Response
Available (200)
The code is not yet used and can be assigned to a new invoice.
{
"data": {
"success": true
}
}Already Used (200)
The code is already taken by another invoice for the current year.
{
"data": {
"success": false
}
}Code Examples
cURL
curl -X POST https://api.bizcare-einvoice.com/api/validation/invoice-code \
-H "X-API-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{ "invoice_code": 9999 }'JavaScript
const response = await fetch(
'https://api.bizcare-einvoice.com/api/validation/invoice-code',
{
method: 'POST',
headers: {
'X-API-Key': 'your-api-key-here',
'Content-Type': 'application/json',
},
body: JSON.stringify({ invoice_code: 9999 }),
}
);
const data = await response.json();
// data.data.success === true means the code is availablePython
response = requests.post(
'https://api.bizcare-einvoice.com/api/validation/invoice-code',
headers={'X-API-Key': 'your-api-key-here'},
json={'invoice_code': 9999},
)PHP
$response = Http::withHeaders([
'X-API-Key' => 'your-api-key-here',
])->post('https://api.bizcare-einvoice.com/api/validation/invoice-code', [
'invoice_code' => 9999,
]);Validate Adjustment Note Code
Check whether an adjustment note code is already used for a given type.
Endpoint
POST /api/validation/adjustment-note-codeHeaders
| Header | Value |
|---|---|
X-API-Key | Your API key |
Content-Type | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
adjustment_note_code | number | Yes | Adjustment note code to check |
adjustment_note_type | string | Yes | CREDIT_NOTE, DEBIT_NOTE, or REFUND_NOTE |
adjustment_note_id | number | No | Existing adjustment note ID (for update scenarios — excludes this note from the uniqueness check) |
Response
Available (200)
{
"data": {
"success": true
}
}Already Used (200)
{
"data": {
"success": false
}
}Invalid Adjustment Note Type (400)
{
"success": false,
"message": "Invalid adjustment note type"
}Code Examples
cURL
curl -X POST https://api.bizcare-einvoice.com/api/validation/adjustment-note-code \
-H "X-API-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"adjustment_note_code": 9999,
"adjustment_note_type": "CREDIT_NOTE"
}'JavaScript
const response = await fetch(
'https://api.bizcare-einvoice.com/api/validation/adjustment-note-code',
{
method: 'POST',
headers: {
'X-API-Key': 'your-api-key-here',
'Content-Type': 'application/json',
},
body: JSON.stringify({
adjustment_note_code: 9999,
adjustment_note_type: 'CREDIT_NOTE',
}),
}
);
const data = await response.json();
// data.data.success === true means the code is availablePython
response = requests.post(
'https://api.bizcare-einvoice.com/api/validation/adjustment-note-code',
headers={'X-API-Key': 'your-api-key-here'},
json={
'adjustment_note_code': 9999,
'adjustment_note_type': 'CREDIT_NOTE',
},
)PHP
$response = Http::withHeaders([
'X-API-Key' => 'your-api-key-here',
])->post('https://api.bizcare-einvoice.com/api/validation/adjustment-note-code', [
'adjustment_note_code' => 9999,
'adjustment_note_type' => 'CREDIT_NOTE',
]);