list-datahub-invoice-imports
dci list-datahub-invoice-imports [flags]
Returns the customer's PDF invoice imports, newest first, including those started from the DoiT console. Each item has the same shape as getDatahubInvoiceImport. Pass the returned pageToken back to read the next page; when pageToken is absent there are no more results.
Error codes: invalid_request (400) means maxResults is not a positive integer; send a whole number of 1 or more (at most 50 are returned). not_found (404) means pageToken is not one returned by this endpoint for this customer; restart without it.
Flags
| Flag | Type | Default | Example | Description |
|---|---|---|---|---|
--max-results | integer | 25 | Maximum number of imports to return, from 1. Values above 50 are treated as 50. | |
--page-token | string | The pageToken from the previous page. Omit it to read the first page. |
Every command also accepts the CLI-wide flags for output shaping — see Output formats and Table output options.
Output
OK - A page of invoice imports.
By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.
| Field | Type | Description |
|---|---|---|
invoiceImports | array of object | |
invoiceImports[].id | string | |
invoiceImports[].status | string | processing is the only non-final status. See getDatahubInvoiceImport for what each final status means. One of: "processing", "needsReview", "imported", "duplicate", "failed". |
invoiceImports[].errorCode | string | Why the import did not complete, or why it needs review. Present for duplicate and failed, and for needsReview when the reason is known. See getDatahubInvoiceImport for the values and what to do. |
invoiceImports[].errorMessage | string | Human-readable detail for errorCode. |
invoiceImports[].dataset | string | The dataset the records were written to. Present when status is imported. |
invoiceImports[].datasetCreated | boolean | true when the import created dataset. Present when status is imported. |
invoiceImports[].recordCount | integer | Number of records written. Present when status is imported. |
invoiceImports[].existingImportId | string | The earlier import of the same invoice. Present when status is duplicate. |
invoiceImports[].retryAfter | string (date-time) | When a forced replace becomes allowed. Present with errorCode replace_not_yet_available. |
invoiceImports[].invoice | object | The invoice as extracted from the PDF, or as confirmed when the import completed. |
invoiceImports[].invoice.vendor | string | |
invoiceImports[].invoice.invoiceNumber | string | |
invoiceImports[].invoice.invoiceDate | string (date) | |
invoiceImports[].invoice.currency | string | ISO 4217 currency code of the invoice. |
invoiceImports[].invoice.total | number | |
invoiceImports[].invoice.lines | array of object | |
invoiceImports[].invoice.lines[].description | string | |
invoiceImports[].invoice.lines[].type | string | One of: "charge", "discount", "credit", "tax". |
invoiceImports[].invoice.lines[].amount | number | Amount in the invoice currency. Discounts and credits are negative. |
invoiceImports[].invoice.lines[].includedInOtherLines | boolean | true for a tax or levy already included in the other lines' prices. Such a line is shown but not imported. |
invoiceImports[].suggestedIntegration | string | Key of the DoiT integration whose provider issued this invoice, for example xai, when one exists. Connecting that integration imports this vendor's costs daily and in more detail than an invoice; if it is already connected, importing the invoice may count the same costs twice. Absent when no integration matches. The key is not filtered by the customer's entitlements, so the integration may not be available to this customer. It never affects the import. |
invoiceImports[].createdAt | string (date-time) | |
invoiceImports[].createdBy | string | Email of the user, or identifier of the service account, that uploaded the invoice. |
pageToken | string | Pass as pageToken to read the next page. Absent when there are no more results. |
Example response (--output json)
{
"invoiceImports": [
{
"id": "8f2c1a7e4b9d",
"status": "imported",
"dataset": "Example Vendor",
"datasetCreated": true,
"recordCount": 31,
"invoice": {
"vendor": "Example Vendor",
"invoiceNumber": "INV-1042",
"invoiceDate": "2026-11-01",
"currency": "EUR",
"total": 120,
"lines": [
{
"description": "Platform plan",
"type": "charge",
"amount": 100,
"includedInOtherLines": false
},
{
"description": "VAT 20%",
"type": "tax",
"amount": 20,
"includedInOtherLines": false
}
]
},
"createdAt": "2026-11-22T10:00:00Z",
}
],
"pageToken": "example-next-page-token"
}
Raw JSON schema
{
"type": "object",
"required": [
"invoiceImports"
],
"properties": {
"invoiceImports": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"status",
"createdAt",
"createdBy"
],
"properties": {
"id": {
"type": "string",
"example": "8f2c1a7e4b9d"
},
"status": {
"type": "string",
"enum": [
"processing",
"needsReview",
"imported",
"duplicate",
"failed"
],
"description": "`processing` is the only non-final status. See `getDatahubInvoiceImport` for what each final status means."
},
"errorCode": {
"type": "string",
"description": "Why the import did not complete, or why it needs review. Present for `duplicate` and `failed`, and for `needsReview` when the reason is known. See `getDatahubInvoiceImport` for the values and what to do.",
"example": "lines_do_not_reconcile"
},
"errorMessage": {
"type": "string",
"description": "Human-readable detail for `errorCode`."
},
"dataset": {
"type": "string",
"description": "The dataset the records were written to. Present when `status` is `imported`.",
"example": "Example Vendor"
},
"datasetCreated": {
"type": "boolean",
"description": "`true` when the import created `dataset`. Present when `status` is `imported`."
},
"recordCount": {
"type": "integer",
"description": "Number of records written. Present when `status` is `imported`.",
"example": 31
},
"existingImportId": {
"type": "string",
"description": "The earlier import of the same invoice. Present when `status` is `duplicate`."
},
"retryAfter": {
"type": "string",
"format": "date-time",
"description": "When a forced replace becomes allowed. Present with `errorCode` `replace_not_yet_available`."
},
"invoice": {
"type": "object",
"description": "The invoice as extracted from the PDF, or as confirmed when the import completed.",
"properties": {
"vendor": {
"type": "string",
"example": "Example Vendor"
},
"invoiceNumber": {
"type": "string",
"example": "INV-1042"
},
"invoiceDate": {
"type": "string",
"format": "date",
"example": "2026-11-01"
},
"currency": {
"type": "string",
"description": "ISO 4217 currency code of the invoice.",
"example": "EUR"
},
"total": {
"type": "number",
"example": 120
},
"lines": {
"type": "array",
"items": {
"type": "object",
"properties": {
"description": {
"type": "string",
"example": "Platform plan"
},
"type": {
"type": "string",
"enum": [
"charge",
"discount",
"credit",
"tax"
]
},
"amount": {
"type": "number",
"description": "Amount in the invoice currency. Discounts and credits are negative.",
"example": 100
},
"includedInOtherLines": {
"type": "boolean",
"description": "`true` for a tax or levy already included in the other lines' prices. Such a line is shown but not imported."
}
}
}
}
}
},
"suggestedIntegration": {
"type": "string",
"description": "Key of the DoiT integration whose provider issued this invoice, for example `xai`, when one exists. Connecting that integration imports this vendor's costs daily and in more detail than an invoice; if it is already connected, importing the invoice may count the same costs twice. Absent when no integration matches. The key is not filtered by the customer's entitlements, so the integration may not be available to this customer. It never affects the import.",
"example": "xai"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"createdBy": {
"type": "string",
"description": "Email of the user, or identifier of the service account, that uploaded the invoice.",
}
}
}
},
"pageToken": {
"type": "string",
"description": "Pass as `pageToken` to read the next page. Absent when there are no more results."
}
}
}
Errors
On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.
HTTP status to exit code mapping
| HTTP status | Exit code | Error code | Meaning |
|---|---|---|---|
| 400 | 30 | VALIDATION_ERROR | The arguments or request body were rejected. Review the command's flags and payload. |
| 401 | 10 | AUTHENTICATION_FAILED | Not signed in, or the API token is invalid. Run dci login or check DCI_API_KEY. |
| 403 | 11 | PERMISSION_DENIED | The DoiT user or the active customer context does not have access. |
| 404 | 20 | RESOURCE_NOT_FOUND | The requested resource does not exist. Check the identifier argument. |
| 500 | 40 | API_SERVER_ERROR | The API failed to process the request. Retryable; contact DoiT support if it persists. |
Related
- create-datahub-dataset — Create dataset
- create-datahub-invoice-import — Import a PDF invoice
- delete-datahub-dataset — Delete a dataset
- delete-datahub-datasets — Delete datasets
- delete-datahub-events-by-filter — Delete specific events
- export-datahub-dataset-records — Export dataset records
- get-datahub-dataset — Retrieve a dataset
- get-datahub-invoice-import — Retrieve an invoice import
- import-datahub-provider-records — Import provider-native records
- ingest-datahub-events — Ingest JSON
- ingest-datahub-events-csv — Ingest CSV file
- list-datahub-datasets — List datasets
- update-datahub-dataset — Update dataset
- API reference: GET /datahub/v1/invoice-imports
Aliases: listdatahubinvoiceimports