Skip to content

Compare a bank/card export with a ledger

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

Read-only. Compares an uploaded bank or credit-card export (CSV/Excel) with the transactions one ledger already holds and reports which rows of the file are missing from the ledger — the rows to upload.

Each file row is paired with at most one ledger transaction:

  • exact — same amount, date and description;
  • strong — same amount, dated within date_tolerance_days (default 3), and the descriptions share a word or the counterparty agrees (catches Plaid-synced and renamed rows);
  • ambiguous (amount_only) — same amount within the window, nothing else agrees. Listed for review; never uploaded automatically.

Pairing is one-to-one, so two identical legitimate charges need two ledger rows. Amounts are compared in cash-flow sign (negative = money out): a credit-card file's positive charge matches the stored charge.

Upload the result with POST /transactions/bulk-upload and only_missing_from_diff: true (re-runs this diff), or pass missing_row_numbers (plus any ambiguous rows you checked) as include_row_numbers.

Operation ID: ledger_diff_bulk_upload_export·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/Excel export (from file upload or /bulk-upload/paste)

ledger_idstringrequired

Ledger (bank account or credit card) to compare against

start_datestring · date

Only compare file rows on or after this date; also bounds the ledger rows reported missing from the file. Defaults to the file's first date.

end_datestring · date

Only compare file rows on or before this date. Defaults to the file's last date.

column_mappingobject

Mapping from DayZero field names to CSV headers: 'date', 'amount', 'description', optional 'category' and 'counterparty'. Auto-detected when omitted (see /bulk-upload/headers).

date_tolerance_daysinteger

How many days a ledger date may differ from the file's and still match (bank vs posted date).

status_columnstring

Header of the file's settled/pending column. Auto-detected (status, transaction_status, state, posting_status) when omitted.

exclude_statusesarray · string

File rows whose status is one of these (case-insensitive, e.g. ['Pending']) are left out of the comparison and listed separately.

invert_transaction_amountsboolean

The file signs amounts the opposite way from usual (bank: deposits positive; credit card: charges positive).

Responses

200Successful Response

successboolean
messagestring
codestring
dataLedgerDiffResponse

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.

404Not Found - Resource does not exist

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.