Skip to main content

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​

FlagTypeDefaultExampleDescription
--max-resultsinteger25Maximum number of imports to return, from 1. Values above 50 are treated as 50.
--page-tokenstringThe 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.

FieldTypeDescription
invoiceImportsarray of object
invoiceImports[].idstring
invoiceImports[].statusstringprocessing is the only non-final status. See getDatahubInvoiceImport for what each final status means. One of: "processing", "needsReview", "imported", "duplicate", "failed".
invoiceImports[].errorCodestringWhy 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[].errorMessagestringHuman-readable detail for errorCode.
invoiceImports[].datasetstringThe dataset the records were written to. Present when status is imported.
invoiceImports[].datasetCreatedbooleantrue when the import created dataset. Present when status is imported.
invoiceImports[].recordCountintegerNumber of records written. Present when status is imported.
invoiceImports[].existingImportIdstringThe earlier import of the same invoice. Present when status is duplicate.
invoiceImports[].retryAfterstring (date-time)When a forced replace becomes allowed. Present with errorCode replace_not_yet_available.
invoiceImports[].invoiceobjectThe invoice as extracted from the PDF, or as confirmed when the import completed.
invoiceImports[].invoice.vendorstring
invoiceImports[].invoice.invoiceNumberstring
invoiceImports[].invoice.invoiceDatestring (date)
invoiceImports[].invoice.currencystringISO 4217 currency code of the invoice.
invoiceImports[].invoice.totalnumber
invoiceImports[].invoice.linesarray of object
invoiceImports[].invoice.lines[].descriptionstring
invoiceImports[].invoice.lines[].typestringOne of: "charge", "discount", "credit", "tax".
invoiceImports[].invoice.lines[].amountnumberAmount in the invoice currency. Discounts and credits are negative.
invoiceImports[].invoice.lines[].includedInOtherLinesbooleantrue for a tax or levy already included in the other lines' prices. Such a line is shown but not imported.
invoiceImports[].suggestedIntegrationstringKey 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[].createdAtstring (date-time)
invoiceImports[].createdBystringEmail of the user, or identifier of the service account, that uploaded the invoice.
pageTokenstringPass 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",
"createdBy": "[email protected]"
}
],
"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.",
"example": "[email protected]"
}
}
}
},
"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 statusExit codeError codeMeaning
40030VALIDATION_ERRORThe arguments or request body were rejected. Review the command's flags and payload.
40110AUTHENTICATION_FAILEDNot signed in, or the API token is invalid. Run dci login or check DCI_API_KEY.
40311PERMISSION_DENIEDThe DoiT user or the active customer context does not have access.
40420RESOURCE_NOT_FOUNDThe requested resource does not exist. Check the identifier argument.
50040API_SERVER_ERRORThe API failed to process the request. Retryable; contact DoiT support if it persists.

Aliases: listdatahubinvoiceimports