Skip to content

Review and confirm CSV imports ​

CSV uses the same bill intake, identities and revision rules as API delivery. Upload prepares a stored file; preview explains its interpretation; confirmation starts processing. Upload or preview alone publishes no bill.

Use a known mapping ​

Use the complete header for the source facts you need:

ColumnsUse it for
36Legacy bills, lines, VAT and measurements
77Rich documents, source completeness and a local party/service graph
80Rich documents with relationships to other documents
88Adjustments and a balance snapshot
100Alternative payment instructions
103Service component totals
104Native documents with explicit obligation presence

The CSV format reference contains the exact downloadable headers, CSV/JSON pairs, allowed cells for every record and attachment rules. Use one complete header in its declared order; do not hand-write a subset or rename an arbitrary export. A different source structure needs an agreed mapping.

A bill row starts a document. Child rows belong to it until the next bill, and each list keeps its row order. Blank optional cells mean absent, not zero or false. customer.provider_account is your routing reference, not proof that the customer owns the account. The amount due is a source fact, separate from line totals. See document semantics.

Limits ​

LimitValue
Complete CSV upload80 MiB (83,886,080 bytes)
Receiving and saving the uploadFive minutes; this does not include or promise processing time
One CSV document1 MiB (1,048,576 bytes), for decoded cells plus separators and for derived JSON

These are application limits. Confirm whether your approved environment has a lower transport limit before preparing a large file; they are not operator-set application options. A per-document excess is recorded as too_large for that document, so valid neighbours can proceed after confirmation.

Use UTF-8 without a BOM, commas and LF or CRLF row endings. CR or LF inside a cell is refused, including quoted multiline text (line_break for that document). A cell such as "Water, September" is supported; a quoted description spanning two physical lines is not. The format reference explains structural file errors, document problems and exact size counting.

Provider workspace authority ​

The public CSV operations below are for a signed-in provider member on the portal host. The operator first assigns the active account to this provider in this instance's market. Both view and csv permit reading; csv is required for upload and confirmation. A provider code in a path never grants access, and a provider's machine HMAC key does not establish interactive membership. Use the portal's current access token and the approved environment base URL; never place a token in a download, shared example, source file or log.

Complete the workflow ​

Every step below is included in the generated reference. {provider} is the explicitly assigned provider code. Reuse the same input_id returned as the preview's id; do not create a new identifier after a timeout. In the table, BASE means /v1/provider-portal/providers/{provider}/imports. The example below constructs that same base URL and follows one input through every step.

StepExisting operationResult to preserve
Discover own scopegetOwnProviders, then getOwnProviderExplicit memberships and metadata; no keys or staff role
Upload exact bytesPOST BASE (uploadOwnImport), Content-Type: text/csvImportPreview.id, file_sha256, interpretation; full-file counts and bounded sample
Refresh the previewGET BASE/{input_id}/preview (previewOwnImport)Review the currently returned digest, interpretation and problems
Confirm explicitlyPOST BASE/{input_id}/confirm (confirmOwnImport)Send exactly the reviewed file_sha256 and interpretation; save confirmation id and confirmed_at
Read progressGET BASE/{input_id} (getOwnImport)Latest run, input.state, input.document_count, publication/rejection/duplicate counts
Read per-position resultsGET BASE/{input_id}/items?run={run} (getOwnImportItems)items, and total across all pages of this run
Download error reportGET BASE/{input_id}/errors.csv?run={run} (exportOwnImportErrors)The selected run's error report, not the original upload

Upload or preview alone never starts processing. Initial confirmation commits the first run and its processing request together. The confirmation response has id and confirmed_at, not run; get the run from detail or a refreshed preview. Before confirmation it is absent. Use that exact run for items and error export: run is required. The generated operations define its positive-integer range and the item page's limit/offset defaults and bounds. Do not add run to detail, preview or confirmation URLs. Error export accepts only run, without item pagination parameters.

The upload response's preview counts the whole file and returns a bounded sample as defined by ImportPreview in the generated contract. It reports mapping, source schema and market problems; replay/conflict results are decided during processing. The limits above apply to the upload and each document separately. A response must be successfully received and reviewed before confirming.

One resource from upload to outcome ​

This example uses sh, curl and jq; the environment values are supplied privately. The file is the invented rich CSV and the selected provider must have its matching configured adapter. Each command exits on an HTTP failure. Review preview.json before executing the separate confirm step; it is not a script that automatically confirms unreviewed bills.

sh
set -eu
# API_BASE is the approved portal origin, PROVIDER the assigned code,
# ACCESS_TOKEN the current portal access token. Do not print it.
BASE="$API_BASE/v1/provider-portal/providers/$PROVIDER/imports"
curl --fail-with-body --silent --show-error \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: text/csv' --data-binary @rich-invoice.csv \
  "$BASE" > upload.json
INPUT_ID=$(jq -er '.id' upload.json)
curl --fail-with-body --silent --show-error \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  "$BASE/$INPUT_ID/preview" > preview.json
# Stop here to review counts, problems, file_sha256 and interpretation.

After review, confirm exactly that pair of returned digests, then read the same resource. No synthetic digest or locally guessed interpretation is substituted:

sh
jq -e '{file_sha256, interpretation}' preview.json > confirm.json
curl --fail-with-body --silent --show-error \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' --data-binary @confirm.json \
  "$BASE/$INPUT_ID/confirm" > confirmation.json
curl --fail-with-body --silent --show-error \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  "$BASE/$INPUT_ID" > detail.json
RUN=$(jq -er '.run' detail.json)
curl --fail-with-body --silent --show-error \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  "$BASE/$INPUT_ID/items?run=$RUN&limit=100&offset=0" > items.json
curl --fail-with-body --silent --show-error \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  "$BASE/$INPUT_ID/errors.csv?run=$RUN" > errors.csv

Read status again while processing continues. Increase offset through the same run to read all recorded facts; items.total tells how many positions have facts now. Pages read during processing are not a frozen result: once input.state is processed, traverse that run again from offset=0 to collect its complete position results. A complete run has a fact for each document; final facts include accepted, replay, conflict, rejected and adapter problems. input.state tracks awaiting_confirmation, received, processing, processed or abandoned; separately inspect input.needs_attention and input.interpretation_changed. Resolve those conditions instead of treating missing items as success. A later staff reprocess creates a different run; read it explicitly rather than combining facts from two runs.

Processed is not published. published requires the document's current revision and an active account with a matching current read right. A valid stored bill can be processed successfully before a customer is connected. Publication counts can change after the import; neither count proves payment.

Error export requires read membership and run; it needs no audit reason. It has the columns position,line,column,code,reason,assessment; adapter errors carry their source line/column, while intake refusals carry their outcome and reason. Text cells that could be spreadsheet formulas are escaped. It is a report of recorded failures for that run, so an empty report during processing does not prove that all documents succeeded. Use item facts and progress too. Downloading the original is a separate POST .../{input_id}/original operation with an explicit reason. getOwnImports can recover the provider's stored history; it does not create or confirm a run.

Staff intake is a separate surface ​

Authorized staff can use the admin CSV screen and corresponding admin API, with current admin host/client and market role. Those operations remain in the application's full private contract. They are not the provider workspace API and are not required to follow this public provider flow. Provider members cannot use admin operations merely because they can upload their own CSV.

Recover without changing history ​

Processing rechecks the stored file and the run's bound interpretation before producing new facts. A changed interpretation halts that run while preserving its committed facts. A current authorization check applies to each new write; an old confirmation is not a permanent permission grant. Provider work is bound to the exact membership that confirmed it. Revoking and granting membership again does not revive that old job; authorized staff must resolve the incomplete run through the existing recovery procedure.

Automatic retry of a run continues positions with no fact. An authorized staff reprocess action creates a later run over the same file after a new preview and explicit confirmation. It does not turn the earlier run's rejected result into an accepted one. Corrected source data belongs in a new upload/revision; retain source identity so duplicates and conflicts remain visible.

Provider pause normally prevents all uploads, including exact-file retries, and new confirmations. Already confirmed work and exact confirmation replay continue. A configured CSV exception can admit a paused provider but cannot admit a draft. There is no universal duration guarantee or request to re-import a whole file whenever one item fails.

If an upload response is lost, look for the stored file in import history. While uploads are allowed, repeating the same bytes for the same provider recovers the same import. If the provider has been paused without the CSV exception, that retry returns 409 provider_paused; read the existing import and its preview instead. If a confirmation response is lost, first read detail/preview; an exact confirmation retry preserves the existing run and queued effect. An import_changed response requires a new preview and deliberate review, not automatic replacement of either digest. Missing membership or an inactive account requires authorized access repair; polling cannot restore it.

The same portal login and current provider membership apply throughout. A 401 requires a valid login; a 403 requires the correct active account and membership (csv for writes). Do not switch to staff endpoints to bypass either.

Operation and responseNext step
Upload: 400 invalid_importRemove query parameters; correct the header, file structure, file with no bills or provider unavailable for new imports. Individual document problems are shown in a successful preview instead.
Upload: 409 provider_pausedApplies to new files and exact-file retries. Read import history to recover an existing input; ask the operator to resolve intake status before another upload.
Upload: 413 request_too_largeReduce the complete file below the upload limit. Preserve document boundaries.
Preview: 400 invalid_importSend no query. If the stored file no longer parses under its mapping, ask the operator to investigate; this GET takes no CSV or confirmation body.
Preview/detail/results: 404 intake_not_foundCheck provider, input and the selected confirmed run in your membership scope. An existing run without recorded results can still have an empty result page.
Confirm: 400 invalid_importSend no query and one JSON object containing the required, correctly formatted file_sha256 and interpretation.
Confirm: 409 import_changedThe file digest does not match this import, or the interpretation differs from its existing confirmation. Read preview/detail and deliberately review the pair before retrying.
Confirm: 409 provider_pausedA new confirmation is blocked unless the CSV exception applies. An exact confirmation replay remains available.
Confirm/original: 413 request_too_largeKeep the JSON request within 1 MiB; original download takes a reason, not a file.
Results/errors: 400 invalid_intake_querySupply run in range 1–2147483647; use only that operation's query parameters and valid pagination.
Original: 400 invalid_reasonSend no query and provide a nonblank audit reason in the JSON body.
Timeout / 5xxKeep the exact file bytes, import identity and reviewed digests. Recover the existing resource before deciding on a retry; a missing response does not prove failure.

The generated reference lists the responses for each operation. not_found on an unavailable route is different from intake_not_found for an import; use the approved portal host and confirm that CSV import is available there.

Documentation for providers and partners.