Skip to content

Preview bulk transaction upload

POST/api/v1/transactions/bulk-upload/preview

Preview and validate a CSV/Excel file before uploading transactions.

This endpoint allows you to:

  • Validate the file format and structure
  • See how many transactions will be uploaded
  • Preview sample transactions
  • Check for duplicate transactions (optional)
  • Apply date range filtering

Supported File Formats: .csv, .xlsx, .xls

Unknown categories: a category that matches no ledger is reported in row_errors ({row, field, value, suggestions}, nearest ledger names first) and in errors; the upload refuses the file until it is fixed or sent with allow_unmatched_categories.

Returns: Validation results, statistics, and sample transactions without actually uploading.

Operation ID: preview_bulk_transaction_upload·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_keystringrequired

S3 key of the CSV file containing transactions

start_datestring · date

Optional: Only preview transactions on or after this date (YYYY-MM-DD).

end_datestring · date

Optional: Only preview transactions on or before this date (YYYY-MM-DD).

check_duplicatesboolean

If true, checks for duplicate transactions against existing database records.

ledger_idstring

Optional: Ledger ID to check duplicates against. If not provided, checks all ledgers for the business.

financial_account_typestring

Financial account type selected for a new ledger. Used by preview to show the same signed amount DayZero will store after import.

column_mappingobject

User-supplied mapping from DayZero field names to CSV column names. Keys: 'date', 'amount', 'description', and optional 'category' (aliases: ledger, ledger_name, account, account_name, category_name). Values: the CSV header to use. When provided, auto-detection is skipped.

Responses

201Successful Response

successboolean
messagestring
codestring
dataBulkTransactionUploadPreviewResponse

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.