Companies API
Complete API reference for managing company information and settings
Companies API
This section covers all company-related endpoints for managing company information, settings, and validation in the E-Invoice system.
Authentication
All endpoints require authentication via API key:
X-API-Key: your-api-key-hereBase URL
/apiGet Company Information
Retrieve the current company's information and settings.
Endpoint
GET /api/companiesHeaders
X-API-Key: your-api-key-hereResponse Example
{
"data": {
"id": 2,
"user_id": 4,
"client_id": "80e766cd-fed8-46df-bdf0-d72b97391b70",
"client_secret": "2690aec0-4b91-42da-acdf-51c4424ffa04",
"scope": "InvoicingAPI",
"access_token": "eyJhbGci...",
"token_expires_in": 3600,
"token_expires_at": "2025-09-17T04:58:26.320+00:00",
"name": "Gaincue Retail",
"tin_code": "IG12345678901",
"registration_number": "991021081111",
"registration_type": "NRIC",
"sst_registration_number": null,
"tourism_tax_registration_number": null,
"business_activity_description": "sell pc parts test",
"msic_code": "46510",
"country": "Malaysia",
"state": "Pulau Pinang",
"city": "Bukit Mertajam",
"zip_code": "14000",
"address": "Company address full dummy 1",
"phone": "+60 12345678",
"email": "gaincueRetail@gmail.com",
"bank_account": null,
"exporter_certified_number": null,
"setting": {
"INVOICE_PREFIX": "25-",
"DEBIT_NOTE_PREFIX": "DN-",
"CREDIT_NOTE_PREFIX": "CN-",
"PREFIX_DIGIT_COUNT": 5,
"REFUND_NOTE_PREFIX": "RN-",
"AUTO_SUBMIT_INVOICE": false,
"CONSOLIDATE_INVOICE_PREFIX": "CINV-",
"SELF_BILLED_INVOICE_PREFIX": "SBINV-",
"CONSOLIDATE_SELF_BILLED_INVOICE_PREFIX": "CSBINV-"
},
"created_at": "2025-08-19T03:03:35.345+00:00",
"updated_at": "2025-09-23T04:10:17.488+00:00",
"default_tax_types_and_rates": [
{
"tax_rate": 10,
"tax_type": "01",
"factor_type": "percentage"
},
{
"tax_rate": 5,
"tax_type": "02",
"factor_type": "percentage"
}
],
"is_company_ready": true,
"as_buyer": {
"contactNumber": "+60 12345678",
"name": "Gaincue Retail",
"partyType": "LOCAL_INDIVIDUAL",
"registrationType": "NRIC",
"registrationNumber": "991021081111",
"sstRegistrationNumber": "NA",
"tin": "IG12345678901",
"address": {
"addressLine0": "Company address full dummy 1",
"cityName": "Bukit Mertajam",
"country": "MYS",
"state": "07",
"postalZone": "14000"
},
"email": "gaincueRetail@gmail.com"
},
"as_supplier": {
"contactNumber": "+60 12345678",
"name": "Gaincue Retail",
"partyType": "LOCAL_INDIVIDUAL",
"registrationType": "NRIC",
"registrationNumber": "991021081111",
"sstRegistrationNumber": "NA",
"tin": "IG12345678901",
"address": {
"addressLine0": "Company address full dummy 1",
"cityName": "Bukit Mertajam",
"country": "MYS",
"state": "07",
"postalZone": "14000"
},
"email": "gaincueRetail@gmail.com",
"businessActivityDescription": "sell pc parts test",
"msic": "46510",
"tourismTaxRegistrationNumber": "NA"
}
}
}Update Company Settings
Update company settings including invoice prefixes and configurations.
Endpoint
PUT /api/companiesHeaders
X-API-Key: your-api-key-here
Content-Type: application/jsonRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
setting | object | Yes | Company settings object |
Setting Object
| Field | Type | Required | Description |
|---|---|---|---|
INVOICE_PREFIX | string | Yes | Prefix for invoice numbers |
DEBIT_NOTE_PREFIX | string | Yes | Prefix for debit note numbers |
CREDIT_NOTE_PREFIX | string | Yes | Prefix for credit note numbers |
PREFIX_DIGIT_COUNT | number | Yes | Number of digits in the prefix |
REFUND_NOTE_PREFIX | string | Yes | Prefix for refund note numbers |
AUTO_SUBMIT_INVOICE | boolean | Yes | Whether to automatically submit invoices |
CONSOLIDATE_INVOICE_PREFIX | string | Yes | Prefix for consolidated invoices |
SELF_BILLED_INVOICE_PREFIX | string | Yes | Prefix for self-billed invoices |
CONSOLIDATE_SELF_BILLED_INVOICE_PREFIX | string | Yes | Prefix for consolidated self-billed invoices |
Request Example
{
"setting": {
"INVOICE_PREFIX": "25-",
"DEBIT_NOTE_PREFIX": "DN-",
"CREDIT_NOTE_PREFIX": "CN-",
"PREFIX_DIGIT_COUNT": 5,
"REFUND_NOTE_PREFIX": "RN-",
"AUTO_SUBMIT_INVOICE": false,
"CONSOLIDATE_INVOICE_PREFIX": "CINV-",
"SELF_BILLED_INVOICE_PREFIX": "SBINV-",
"CONSOLIDATE_SELF_BILLED_INVOICE_PREFIX": "CSBINV-"
}
}Response
Success (200)
Returns the updated company object with the same structure as the GET endpoint.
Validation Error (422)
{
"errors": [
{
"message": "The CONSOLIDATE_SELF_BILLED_INVOICE_PREFIX field must be defined",
"rule": "required",
"field": "setting.CONSOLIDATE_SELF_BILLED_INVOICE_PREFIX"
}
]
}Validate TIN
Validate a Tax Identification Number (TIN) against the MyInvois system.
Endpoint
POST /api/validation/tinHeaders
X-API-Key: your-api-key-here
Content-Type: application/jsonRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
registration_type | string | Yes | Type of registration: NRIC, BRN, PASSPORT |
registration_number | string | Yes | Registration number |
tin | string | Yes | Tax Identification Number to validate |
Request Example
{
"registration_type": "NRIC",
"registration_number": "991021081111",
"tin": "IG12345678901"
}Response
Success (200)
{
"data": {
"is_valid": true,
"message": "TIN validation successful"
}
}Invalid TIN (200)
{
"data": {
"is_valid": false,
"message": "TIN validation failed"
}
}Validate Company Name
Validate a company name for uniqueness and compliance.
Endpoint
POST /api/validation/company-nameHeaders
X-API-Key: your-api-key-here
Content-Type: application/jsonRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Company name to validate |
Request Example
{
"name": "My Company Sdn Bhd"
}Response
Success (200)
{
"data": {
"is_valid": true,
"message": "Company name is available"
}
}Company Data Structure
Main Company Object
| Field | Type | Description |
|---|---|---|
id | number | Unique company identifier |
user_id | number | Associated user ID |
client_id | string | MyInvois client ID |
client_secret | string | MyInvois client secret |
scope | string | API scope permissions |
access_token | string | Current access token |
token_expires_in | number | Token expiration time in seconds |
token_expires_at | string | Token expiration timestamp |
name | string | Company name |
tin_code | string | Tax Identification Number |
registration_number | string | Company registration number |
registration_type | string | Type of registration |
sst_registration_number | string|null | SST registration number |
tourism_tax_registration_number | string|null | Tourism tax registration |
business_activity_description | string | Description of business activities |
msic_code | string | Malaysian Standard Industrial Classification code |
country | string | Country name |
state | string | State/province |
city | string | City name |
zip_code | string | Postal code |
address | string | Full address |
phone | string | Contact phone number |
email | string | Contact email |
bank_account | string|null | Bank account details |
exporter_certified_number | string|null | Exporter certification number |
setting | object | Company settings |
created_at | string | Creation timestamp |
updated_at | string | Last update timestamp |
default_tax_types_and_rates | array | Default tax configurations |
is_company_ready | boolean | Whether company setup is complete |
as_buyer | object | Company information formatted for buyer role |
as_supplier | object | Company information formatted for supplier role |
Default Tax Types and Rates
Each item in the default_tax_types_and_rates array contains:
| Field | Type | Description |
|---|---|---|
tax_rate | number | Tax rate value |
tax_type | string | Tax type code |
factor_type | string | Type of factor (usually "percentage") |
Company as Buyer/Supplier
The as_buyer and as_supplier objects format the company information for use in invoices:
| Field | Type | Description |
|---|---|---|
contactNumber | string | Contact phone number |
name | string | Company name |
partyType | string | Party type classification |
registrationType | string | Registration type |
registrationNumber | string | Registration number |
sstRegistrationNumber | string | SST registration number |
tin | string | Tax Identification Number |
address | object | Address information |
address.addressLine0 | string | Address line |
address.cityName | string | City name |
address.country | string | Country code (e.g., "MYS") |
address.state | string | State code |
address.postalZone | string | Postal code |
email | string | Contact email |
Additional fields for as_supplier:
| Field | Type | Description |
|---|---|---|
businessActivityDescription | string | Business activity description |
msic | string | MSIC code |
tourismTaxRegistrationNumber | string | Tourism tax registration |
Common Error Codes
| Status Code | Description |
|---|---|
200 | OK - Request successful |
400 | Bad Request - Invalid request data |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - Insufficient permissions |
404 | Not Found - Company not found |
422 | Unprocessable Entity - Validation errors |
Error Response Format
{
"errors": [
{
"message": "Error description",
"rule": "validation_rule_name",
"field": "field.path"
}
]
}Important Notes
-
Registration Types:
NRIC: National Registration Identity Card (for Malaysian individuals)BRN: Business Registration Number (for businesses)PASSPORT: Passport number (for foreign individuals)
-
Party Types:
LOCAL_INDIVIDUAL: Local Malaysian individualLOCAL_EXEMPTED_ENTITY: Local exempted entityLOCAL_BUSINESS_AGENT_DEALER_DISTRIBUTOR: Local business/agent/dealer/distributorFOREIGNER_BUSINESS: Foreign business entityFOREIGNER_INDIVIDUAL: Foreign individual
-
State Codes: Use Malaysian state codes (e.g., "07" for Perak, "14" for Penang)
-
Country Code: Use "MYS" for Malaysia (ISO 3166-1 alpha-3)
-
MSIC Codes: Use Malaysian Standard Industrial Classification codes to categorize business activities
-
Token Management: The API automatically manages MyInvois access tokens. The
token_expires_atfield indicates when the current token expires. -
Company Readiness: The
is_company_readyfield indicates whether the company has completed all required setup steps for e-invoicing.