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-documentsHeaders
| Header | Value |
|---|---|
X-API-Key | Your API key |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number |
per_page | number | 10 | Items 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/exportHeaders
| Header | Value |
|---|---|
X-API-Key | Your API key |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | integer | Submitted 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"
}| Field | Type | Description |
|---|---|---|
status | string | Document status (e.g., Valid, Invalid, Cancelled) |
failReason | string|null | Reason for submission failure, if any |
failDetails | array|null | Detailed failure information from LHDN |
type | string | Document type (e.g., INVOICE, CREDIT_NOTE, DEBIT_NOTE) |
submissionUid | string|null | Submission UID from the linked document submission |
adjustmentNoteCode | string|null | Linked adjustment note code with prefix, if applicable |
consolidatedInvoiceCode | string|null | Linked consolidated invoice code with prefix, if applicable |
code | string | Document code identifier |
documentDetails | object | Full UBL XML JSON snapshot as submitted to LHDN MyInvois |
longId | string|null | LHDN long ID for the document |
cancelReason | string|null | Reason for cancellation, if cancelled |
createdAt | string | Record 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.jsonJavaScript
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-allHeaders
| Header | Value |
|---|---|
X-API-Key | Your 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.jsonJavaScript
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');