BizCARE MyInvois
API Reference

Submitted Documents

API endpoint for listing all submitted documents

Submitted Documents API

List all documents that have been submitted to LHDN's MyInvois system across all invoices, consolidated invoices, and adjustment notes.

For submitted documents associated with a specific invoice or adjustment note, see the respective endpoints:


List Submitted Documents

Endpoint

GET /api/submitted-documents

Headers

HeaderValue
X-API-KeyYour API key

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number
per_pagenumber10Items per page

Response

{
  "meta": {
    "total": 4,
    "per_page": 10,
    "current_page": 1,
    "last_page": 1,
    "first_page": 1,
    "first_page_url": "/?page=1",
    "last_page_url": "/?page=1",
    "next_page_url": null,
    "previous_page_url": null
  },
  "data": [
    {
      "id": 16,
      "document_submission_id": 16,
      "adjustment_note_id": null,
      "invoice_id": 20,
      "consolidated_invoice_id": null,
      "company_id": 7,
      "user_id": 80,
      "code": "INV-7",
      "uuid": "F5Y7MVEV04QDJ45EAGVD07JK10",
      "status": "Valid",
      "fail_reason": null,
      "fail_details": null,
      "document_details": { "...": "UBL XML JSON snapshot (see below)" },
      "type": "INVOICE",
      "cancel_reason": null,
      "long_id": "XN1SYJT77XKV9F856JCV7G3K10lyrOOY1756112990",
      "created_at": "2025-08-25T09:09:49.982+00:00",
      "updated_at": "2025-08-25T09:10:51.128+00:00"
    }
  ]
}

The document_details field contains the full UBL XML JSON snapshot of the document as submitted to LHDN's MyInvois system. This is a large nested object following the OASIS UBL 2.1 Invoice schema and is not typed — treat it as an opaque JSON value.

Code Examples

cURL

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

JavaScript

const response = await fetch(
  'https://api.bizcare-einvoice.com/api/submitted-documents?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/submitted-documents',
    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/submitted-documents', [
    'page' => 1,
    'per_page' => 10,
]);

Export Submitted Document

Export a single submitted document's data as a downloadable JSON file, including the full UBL document details and linked entity codes.

Endpoint

GET /api/submitted-documents/:id/export

Headers

HeaderValue
X-API-KeyYour API key

Path Parameters

ParameterTypeDescription
idintegerSubmitted document ID

Response

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

{
  "status": "Valid",
  "failReason": null,
  "failDetails": null,
  "type": "INVOICE",
  "submissionUid": "F5Y7MVEV04QDJ45EAGVD07JK10",
  "adjustmentNoteCode": null,
  "consolidatedInvoiceCode": null,
  "code": "INV-7",
  "documentDetails": { "...": "UBL XML JSON snapshot" },
  "longId": "XN1SYJT77XKV9F856JCV7G3K10lyrOOY1756112990",
  "cancelReason": null,
  "createdAt": "2025-08-25T09:09:49.982+00:00"
}
FieldTypeDescription
statusstringDocument status (e.g., Valid, Invalid, Cancelled)
failReasonstring|nullReason for submission failure, if any
failDetailsarray|nullDetailed failure information from LHDN
typestringDocument type (e.g., INVOICE, CREDIT_NOTE, DEBIT_NOTE)
submissionUidstring|nullSubmission UID from the linked document submission
adjustmentNoteCodestring|nullLinked adjustment note code with prefix, if applicable
consolidatedInvoiceCodestring|nullLinked consolidated invoice code with prefix, if applicable
codestringDocument code identifier
documentDetailsobjectFull UBL XML JSON snapshot as submitted to LHDN MyInvois
longIdstring|nullLHDN long ID for the document
cancelReasonstring|nullReason for cancellation, if cancelled
createdAtstringRecord creation timestamp (ISO 8601)

Code Examples

cURL

curl -X GET https://api.bizcare-einvoice.com/api/submitted-documents/16/export \
  -H "X-API-Key: your-api-key-here" \
  -o submitted-document-export.json

JavaScript

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

Python

response = requests.get(
    'https://api.bizcare-einvoice.com/api/submitted-documents/16/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/submitted-documents/16/export');

Export All Submitted Documents

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

Endpoint

GET /api/submitted-documents/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 submitted document export objects.

[
  {
    "status": "Valid",
    "failReason": null,
    "failDetails": null,
    "type": "INVOICE",
    "submissionUid": "F5Y7MVEV04QDJ45EAGVD07JK10",
    "adjustmentNoteCode": null,
    "consolidatedInvoiceCode": null,
    "code": "INV-7",
    "documentDetails": { "...": "UBL XML JSON snapshot" },
    "longId": "XN1SYJT77XKV9F856JCV7G3K10lyrOOY1756112990",
    "cancelReason": null,
    "createdAt": "2025-08-25T09:09:49.982+00:00"
  }
]

See Export Submitted Document for field descriptions.

Code Examples

cURL

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

JavaScript

const response = await fetch(
  'https://api.bizcare-einvoice.com/api/submitted-documents/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/submitted-documents/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/submitted-documents/export-all');