Skip to main content

bulkImportInvoices

Requires at least one of the permissions payments:invoice:import or purchase:purchase_invoice:import.

Imports many invoices from a file in one call. The result reports how many rows succeeded and failed and lists the errors, so you can correct and resubmit the failed rows. Needs the invoice import permission for sales invoices, or the purchase invoices import permission for purchase invoices.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation BulkImportInvoices($input: BulkImportInvoicesInput!) {
bulkImportInvoices(input: $input) {
failed
success
errors {
invoiceNumber
errors
row
}
}
}

Variables:

{
"input": {
"fileContent": "string",
"format": "CSV",
"invoiceType": "PURCHASE_INVOICE",
"updateExisting": true,
"validateOnly": true
}
}

Response:

{
"data": {
"bulkImportInvoices": {
"failed": 0,
"success": 0,
"errors": [
{
"invoiceNumber": "string",
"errors": [
"string"
],
"row": 0
}
]
}
}
}
bulkImportInvoices(
input: BulkImportInvoicesInput!
): BulkImportResult!

Arguments​

bulkImportInvoices.input ● BulkImportInvoicesInput! non-null input​

The import file and options.

Type​

BulkImportResult object​

The outcome of a bulk invoice import.