BizCARE MyInvois
API Reference

Consolidated Invoices

API endpoints for managing consolidated invoices

Consolidated Invoices API

Retrieve consolidated invoices and create adjustment notes for them. Consolidated invoices group multiple invoices into a single submission to MyInvois.


List Consolidated Invoices

Endpoint

GET /api/consolidated-invoices

Headers

HeaderValue
X-API-KeyYour API key

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number
per_pagenumber10Items per page

Response

{
  "meta": {
    "total": 3,
    "per_page": 10,
    "current_page": 1,
    "last_page": 1
  },
  "data": [
    {
      "id": 1,
      "company_id": 2,
      "invoice_code": 1,
      "type": "CONSOLIDATED_INVOICE",
      "buyer": { "...": "..." },
      "supplier": { "...": "..." },
      "line_items": [],
      "status": "Valid",
      "legal_monetary_total": {
        "excludingTax": 500,
        "includingTax": 530,
        "payableAmount": 530
      },
      "created_at": "2025-09-01T00:00:00.000+00:00",
      "updated_at": "2025-09-01T00:00:00.000+00:00"
    }
  ]
}

Code Examples

cURL

curl -X GET "https://api.bizcare-einvoice.com/api/consolidated-invoices?page=1&per_page=10" \
  -H "X-API-Key: your-api-key-here"

JavaScript

const response = await fetch(
  'https://api.bizcare-einvoice.com/api/consolidated-invoices?page=1&per_page=10',
  { headers: { 'X-API-Key': 'your-api-key-here' } }
);
const data = await response.json();

Python

response = requests.get(
    'https://api.bizcare-einvoice.com/api/consolidated-invoices',
    headers={'X-API-Key': 'your-api-key-here'},
    params={'page': 1, 'per_page': 10},
)

PHP

$response = Http::withHeaders([
    'X-API-Key' => 'your-api-key-here',
])->get('https://api.bizcare-einvoice.com/api/consolidated-invoices', [
    'page' => 1,
    'per_page' => 10,
]);

Get Consolidated Invoice

Endpoint

GET /api/consolidated-invoices/:id

Headers

HeaderValue
X-API-KeyYour API key

Path Parameters

ParameterTypeDescription
idintegerConsolidated invoice ID

Response

Returns a single ConsolidatedInvoice object, including nested invoices, submitted_documents, and adjustment_notes arrays.

Code Examples

cURL

curl -X GET https://api.bizcare-einvoice.com/api/consolidated-invoices/1 \
  -H "X-API-Key: your-api-key-here"

JavaScript

const response = await fetch(
  'https://api.bizcare-einvoice.com/api/consolidated-invoices/1',
  { headers: { 'X-API-Key': 'your-api-key-here' } }
);

Python

response = requests.get(
    'https://api.bizcare-einvoice.com/api/consolidated-invoices/1',
    headers={'X-API-Key': 'your-api-key-here'},
)

PHP

$response = Http::withHeaders([
    'X-API-Key' => 'your-api-key-here',
])->get('https://api.bizcare-einvoice.com/api/consolidated-invoices/1');

Export Consolidated Invoice

Export a single consolidated invoice's data as a downloadable JSON file, including the codes of all linked invoices.

Endpoint

GET /api/consolidated-invoices/:id/export

Headers

HeaderValue
X-API-KeyYour API key

Path Parameters

ParameterTypeDescription
idintegerConsolidated invoice ID

Response

The response is returned as a downloadable JSON file with Content-Disposition: attachment header.

{
  "invoiceCodeWithPrefixAndDigits": "CINV-0001",
  "invoiceCode": "1",
  "buyer": { "...": "..." },
  "supplier": { "...": "..." },
  "lineItems": [ "..." ],
  "invoiceDateTime": "2025-09-01T00:00:00.000Z",
  "invoiceLevelAllowanceCharge": null,
  "invoiceCodesIncluded": ["INV-0001", "INV-0002", "INV-0003"],
  "createdAt": "2025-09-01T00:00:00.000+00:00"
}
FieldTypeDescription
invoiceCodeWithPrefixAndDigitsstringFull consolidated invoice code with prefix
invoiceCodestringRaw invoice code number
buyerobjectBuyer information
supplierobjectSupplier information
lineItemsarrayArray of line items
invoiceDateTimestringInvoice issue date and time (ISO 8601)
invoiceLevelAllowanceChargeobject|nullInvoice-level discounts or charges
invoiceCodesIncludedstring[]Array of linked invoice codes with prefix
createdAtstringRecord creation timestamp (ISO 8601)

Code Examples

cURL

curl -X GET https://api.bizcare-einvoice.com/api/consolidated-invoices/1/export \
  -H "X-API-Key: your-api-key-here" \
  -o consolidated-invoice-export.json

JavaScript

const response = await fetch(
  'https://api.bizcare-einvoice.com/api/consolidated-invoices/1/export',
  { headers: { 'X-API-Key': 'your-api-key-here' } }
);
const data = await response.json();

Python

response = requests.get(
    'https://api.bizcare-einvoice.com/api/consolidated-invoices/1/export',
    headers={'X-API-Key': 'your-api-key-here'},
)

PHP

$response = Http::withHeaders([
    'X-API-Key' => 'your-api-key-here',
])->get('https://api.bizcare-einvoice.com/api/consolidated-invoices/1/export');

Export All Consolidated Invoices

Export all consolidated invoices for the authenticated company as a downloadable JSON file. No pagination — returns the full dataset.

Endpoint

GET /api/consolidated-invoices/export-all

Headers

HeaderValue
X-API-KeyYour API key

Response

The response is returned as a downloadable JSON file with Content-Disposition: attachment header. Contains an array of consolidated invoice export objects.

[
  {
    "invoiceCodeWithPrefixAndDigits": "CINV-0001",
    "invoiceCode": "1",
    "buyer": { "...": "..." },
    "supplier": { "...": "..." },
    "lineItems": [ "..." ],
    "invoiceDateTime": "2025-09-01T00:00:00.000Z",
    "invoiceLevelAllowanceCharge": null,
    "invoiceCodesIncluded": ["INV-0001", "INV-0002"],
    "createdAt": "2025-09-01T00:00:00.000+00:00"
  }
]

See Export Consolidated Invoice for field descriptions.

Code Examples

cURL

curl -X GET https://api.bizcare-einvoice.com/api/consolidated-invoices/export-all \
  -H "X-API-Key: your-api-key-here" \
  -o all-consolidated-invoices-export.json

JavaScript

const response = await fetch(
  'https://api.bizcare-einvoice.com/api/consolidated-invoices/export-all',
  { headers: { 'X-API-Key': 'your-api-key-here' } }
);
const data = await response.json();

Python

response = requests.get(
    'https://api.bizcare-einvoice.com/api/consolidated-invoices/export-all',
    headers={'X-API-Key': 'your-api-key-here'},
)

PHP

$response = Http::withHeaders([
    'X-API-Key' => 'your-api-key-here',
])->get('https://api.bizcare-einvoice.com/api/consolidated-invoices/export-all');

Create Adjustment Note for Consolidated Invoice

Create a credit note, debit note, or refund note linked to a consolidated invoice. The consolidated invoice must have a valid submitted document.

Endpoint

POST /api/consolidated-invoices/:id/adjustment-note

Headers

HeaderValue
X-API-KeyYour API key
Content-Typeapplication/json

Path Parameters

ParameterTypeDescription
idintegerConsolidated invoice ID

Request Body

FieldTypeRequiredDescription
targetInvoiceTypestringYesType of target invoice (e.g., CONSOLIDATED_INVOICE)
typestringYesCREDIT_NOTE, DEBIT_NOTE, or REFUND_NOTE
adjustmentNoteCodenumberYesUnique adjustment note code
adjustmentNoteIssueDatestringYesISO 8601 datetime
lineItemsarrayYesArray of line items

Response

{
  "success": true,
  "message": "Successfully created adjustment note"
}

Error Responses

StatusMessage
403"The invoice has not been submitted."
403"The invoice has been submitted but not yet being validated by LHDN or latest submission result status is not valid."

Code Examples

cURL

curl -X POST https://api.bizcare-einvoice.com/api/consolidated-invoices/1/adjustment-note \
  -H "X-API-Key: your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "targetInvoiceType": "CONSOLIDATED_INVOICE",
    "type": "CREDIT_NOTE",
    "adjustmentNoteCode": 456,
    "adjustmentNoteIssueDate": "2025-09-15T00:00:00.000Z",
    "lineItems": [
      {
        "id": "item-1",
        "classifications": ["001"],
        "description": "Consolidated adjustment",
        "unit": { "price": 50, "count": 1, "code": "EA" },
        "taxDetails": [
          { "taxType": "01", "taxRate": { "percentage": 6 } }
        ],
        "originCountry": "MYS"
      }
    ]
  }'

JavaScript

const response = await fetch(
  'https://api.bizcare-einvoice.com/api/consolidated-invoices/1/adjustment-note',
  {
    method: 'POST',
    headers: {
      'X-API-Key': 'your-api-key-here',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      targetInvoiceType: 'CONSOLIDATED_INVOICE',
      type: 'CREDIT_NOTE',
      adjustmentNoteCode: 456,
      adjustmentNoteIssueDate: '2025-09-15T00:00:00.000Z',
      lineItems: [
        {
          id: 'item-1',
          classifications: ['001'],
          description: 'Consolidated adjustment',
          unit: { price: 50, count: 1, code: 'EA' },
          taxDetails: [{ taxType: '01', taxRate: { percentage: 6 } }],
          originCountry: 'MYS',
        },
      ],
    }),
  }
);

Python

response = requests.post(
    'https://api.bizcare-einvoice.com/api/consolidated-invoices/1/adjustment-note',
    headers={'X-API-Key': 'your-api-key-here'},
    json={
        'targetInvoiceType': 'CONSOLIDATED_INVOICE',
        'type': 'CREDIT_NOTE',
        'adjustmentNoteCode': 456,
        'adjustmentNoteIssueDate': '2025-09-15T00:00:00.000Z',
        'lineItems': [
            {
                'id': 'item-1',
                'classifications': ['001'],
                'description': 'Consolidated adjustment',
                'unit': {'price': 50, 'count': 1, 'code': 'EA'},
                'taxDetails': [{'taxType': '01', 'taxRate': {'percentage': 6}}],
                'originCountry': 'MYS',
            }
        ],
    },
)

PHP

$response = Http::withHeaders([
    'X-API-Key' => 'your-api-key-here',
])->post('https://api.bizcare-einvoice.com/api/consolidated-invoices/1/adjustment-note', [
    'targetInvoiceType' => 'CONSOLIDATED_INVOICE',
    'type' => 'CREDIT_NOTE',
    'adjustmentNoteCode' => 456,
    'adjustmentNoteIssueDate' => '2025-09-15T00:00:00.000Z',
    'lineItems' => [
        [
            'id' => 'item-1',
            'classifications' => ['001'],
            'description' => 'Consolidated adjustment',
            'unit' => ['price' => 50, 'count' => 1, 'code' => 'EA'],
            'taxDetails' => [['taxType' => '01', 'taxRate' => ['percentage' => 6]]],
            'originCountry' => 'MYS',
        ],
    ],
]);