Skip to content

Bulk create invoices

POST/api/v1/invoices/bulk

Create multiple invoices from CSV data in a single request.

Operation ID: create_bulk_invoices·View as markdown·OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Request body

s3_keystring

S3 key of the uploaded CSV file containing invoice data.

finalizeboolean

If true, finalize the created invoices. Needs a connected Stripe account, except with historical: then every row is finalized locally (no Stripe, no email), its entry dated on the row's invoice_date, which every invoice must then have.

allow_duplicatesboolean

By default a row that matches an invoice a previous import already created (same customer, due date, total, description and line items) is skipped and reported under duplicates, so uploading the same file twice is safe. Set true to import those rows anyway — they are created without a fingerprint and will not be deduplicated against on future uploads.

historicalboolean

The file holds invoices that were already issued elsewhere — a books migration rather than new billing. Every row is written locally and none reach Stripe, even if the business has an account connected, so nothing can be sent to or charged to a customer. Past due dates are accepted, which they otherwise are not. Use the invoice_date and invoice_number columns to keep each invoice's original date and number. The invoices are never chased by the AR dunning emails. With finalize, each is finalized locally and its entry (debiting the customer's AR) posts on its invoice_date, floored at the books' start date.

previewboolean

Run every check (customers, SKUs, projects, dates, amounts, duplicates, invoice numbers) and report what would be imported, without creating anything or calling Stripe. would_create counts the invoices that pass; failed lists the rest with suggestions.

allow_partialboolean

By default a row that fails validation refuses the whole file (400 VALIDATION_574, nothing created). Set true to import the invoices that validate and report the failed rows for a retry.

Responses

201Successful Response

successboolean
messagestring
codestring
dataInvoiceBulkCreateResponse

400Bad Request - Invalid input

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

401Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

403Forbidden - Insufficient permissions

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

422Validation Error

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.