Appearance
Prepare a CSV file
Choose a complete header below, then fill only the cells allowed for each record. The CSV import guide covers upload, review, confirmation and results. JSON source schemas define the field values and business rules; the mapping here explains how to express those same facts as CSV rows.
Choose an exact header
Every row has the same number of cells as the header, including trailing empty cells. Header spelling, case and order must match exactly. Do not remove unused columns, reorder them or add a column from a wider header.
| Columns | Exact header | Records available | CSV and matching JSON source |
|---|---|---|---|
| 36 | First row of legacy water CSV | bill, line, vat, measurement | Three bills: first, second, third |
| 77 | Rich header | Base records plus graph and attachment records | CSV · JSON |
| 80 | Relationship header | Rich records plus relationship | CSV · JSON |
| 88 | Balance header | Relationship records plus adjustment; balance cells on bill | CSV · JSON |
| 100 | Transfer header | Balance records plus child payment_instruction | CSV · JSON |
| 103 | Service total header | Transfer records, with extra service_component cells | CSV · JSON |
| 104 | Native header | Service total records, with explicit obligation presence on bill | CSV · JSON |
The 36-column header produces a legacy bill, with no format column. For the 77/80/88/100/103 headers, set format on every bill row to racun-canonical-rich-1; the result has format and a bill body as in the rich source schema. The 104-column header requires format=native-document and follows the native source schema. The provider's prepared intake mapping must support the chosen input.
Each wider header includes the earlier columns, but its additional record kinds and cells are available only from that header onward. Empty extension cells do not supply extra source facts. Native input always uses the 104-column header. The JSON downloads are source documents for comparison, not API batch envelopes.
File and cell rules
Use UTF-8 without a BOM, comma separators and LF or CRLF row endings. Quote a cell containing a comma or a quote; represent a quote inside a quoted cell as "". Blank physical lines are ignored. A bare CR at the end of the file is refused.
Do not put CR or LF inside any populated cell, even inside quotes. A quoted multiline description is refused as line_break for that document. Keep source line breaks intact if you use the JSON API instead; do not silently replace them with spaces. For example, the single cell "Water, September" is valid CSV text; a quoted cell spanning two physical lines is not supported.
Values are kept as written, including spaces; nothing is trimmed, inferred or converted to fit. Money and quantities are decimal strings with a dot, dates are YYYY-MM-DD, and revisions are integers. The source schema supplies the accepted values, required fields, money precision and reference rules. Zero such as 0.00 is a supplied value, not absence.
An empty optional cell means absent. If one cell of an optional object is filled, that object is present and its required fields must be supplied. This applies to periods, bank instructions, payees and balance snapshots. Required cells left blank are rejected; blank never supplies zero or false. In rich/native input, optional totals and issue dates can remain absent where the source schema allows it; legacy input requires its issue date and all three document totals.
Group records into documents
A bill row starts a document; all rows until the next bill belong to it. Child records may be interleaved, and each output array retains the order of its own rows. A child before the first bill is an orphan structural error.
record is filled on every row. All other cells must be empty unless they are listed for that record below and exist in the chosen header. Prefix notation in the tables means full header names: line.description, never just description. There are no JSON cells, packed lists or implicit attachment to the previous row.
Cells on the bill row
| Header availability | Allowed cells on record=bill | Meaning |
|---|---|---|
| All | source_document_id, revision, revision_kind, document_number, issue_date, currency | Document identity and source facts |
| All | period.start, period.end, customer.provider_account | Document service period and customer routing key |
| All | totals.net, totals.vat, totals.gross, obligation.amount_due, obligation.due_date | Source document totals and the separate amount due |
| All | payment_instruction.iban, .model, .reference, .purpose_code, .description | One singular bank instruction |
| All | payment_instruction.payee.name, .street, .postcode, .city | Optional payee details for that singular instruction |
| 77 onward | format, document_type, completeness.level, .pages_received, .pages_expected, language | Explicit source format and completeness |
| 77 onward | period.endpoints, dates.service_performed_on, .meter_read_on, .tax_point_on | Additional source dates and interval meaning |
| 77 onward | customer.provider_account_ref, payment_instruction.payee_party_ref | References inside this document's graph |
| 88 onward | balance_snapshot.as_of, .prior_due, .included_in_amount_due, .source_fact_id | One optional balance snapshot, never a separate record |
| 104 only | obligation.presence | Required literal present or absent |
For native input, absent requires both obligation cells to be blank and is allowed only for an explicit statement without payment instructions. present requires the exact amount, including a stated zero. See document and amount semantics for totals, obligations and payment eligibility.
Base child records
record | Allowed cells | Output |
|---|---|---|
line | line.description, .quantity, .unit, .net | One lines[] item |
vat | vat.rate, .base, .vat | One vat_summary[] item |
measurement | measurement.service, .unit, .quantity, .period.start, .period.end | One measurements[] item |
From the 77-column header onward, line also allows line.semantic_class and line.service_component_ref. Rich/native lines require semantic_class; legacy lines require net. A rich/native line can omit net where its schema allows that absence. A measurement also allows measurement.period.endpoints, measurement.service_component_ref and measurement.device_ref. Line quantity is not automatically consumption; use explicit measurement rows when the source provides consumption.
Graph and attachment records
These records are available from the 77-column header onward.
record | Allowed cells | Output or attachment |
|---|---|---|
party | party.id, .display_name | One parties[] object |
party_role | party_role.party_ref, .role | Append one role to the named party |
identifier | identifier.owner_ref, .scheme, .value | Append one identifier to its named owner |
provider_account | provider_account.id, .account_holder_party_ref | One provider_accounts[] object |
contract | contract.id, .type, .provider_account_ref | One contracts[] object |
billing_point | billing_point.id, .type, .contract_ref | One billing_points[] object |
device | device.id, .type, .billing_point_ref | One devices[] object |
service_component | service_component.id, .service_type, .provider_account_ref, .contract_ref, .billing_point_ref, .operator_party_ref | One service_components[] object |
Use lowercase urn:uuid: local IDs, unique across the graph and alternative instructions in this document. References resolve only within the same document snapshot. A party's roles come from its party_role rows; put each role in its own row and use a role allowed by the rich/native source schema. Roles are not inferred from a name or an identifier.
party_role.party_ref must name a party. identifier.owner_ref may name a party, provider account, contract, billing point or device; it cannot name a service component or a payment instruction. Both attachment kinds may precede their owner rows within the document. An unresolved attachment produces a reference problem for that document. Other references must also have the correct target class and role required by the source schema. None of these references grants customer access to a bill.
From the 103-column header onward, only service_component rows may fill service_component.totals.net, .tax and .gross. All three blank means no service totals; partial, zero and negative amounts are preserved when valid. They use the document currency and do not change the amount due or create a reconciliation calculation.
Relationship and balance records
Availability and record | Allowed cells | Meaning |
|---|---|---|
80 onward: relationship | relationship.type, .target_source_document_id, .target_revision | One ordered relationship assertion; blank optional target revision means absent |
88 onward: adjustment | adjustment.type, .amount, .included_in_amount_due, .source_fact_id | One ordered source explanation |
Relationship types and same-document revision restrictions come from the source schema and document rules. A relationship does not import its target or grant access to it; target availability is checked when an authorized reader uses it.
Balance snapshot cells stay on bill; there is no balance_snapshot record. If any snapshot cell is supplied, provide the complete object. Both adjustment.included_in_amount_due and balance_snapshot.included_in_amount_due accept only literal lowercase true or false. Blank is missing; TRUE, 0 and 1 do not become booleans. Source fact IDs identify these assertions: duplicate adjustment IDs or inconsistent adjustment/snapshot views of one fact are rejected. These facts do not add charges already included in obligation.amount_due.
Alternative payment instructions
From the 100-column header onward, each record=payment_instruction row creates one ordered payment_instructions[] alternative. The allowed cells are:
- Required:
payment_instruction.id,.type,.currency,.amount,.destination.scheme,.destination.value,.reference.scheme,.reference.value,.partial_payment. - Optional:
payment_instruction.preferred,.valid_from,.valid_until,.payee_party_ref,.purpose_code,.description, pluspayment_instruction.payee.name,.street,.postcode,.city.
The old payment_instruction.iban, .model and .reference cells are not allowed on these child rows. The new child-only cells are not allowed on bill. If child alternatives are supplied, leave the singular instruction cells on bill empty; singular and plural instructions cannot coexist.
preferred accepts literal true or false; blank leaves it absent. Alternatives must each describe the full EUR obligation, use the supported bank transfer destination/reference rules, and resolve their local IDs and payee roles correctly. Dates are inclusive, ordered calendar bounds. partial_payment is a source assertion, not a change to the amount payable. Use the paired JSON example and source schema for the supported enum values and bank formats.
Understand file errors and document errors
| Scope | Codes and examples | What to correct |
|---|---|---|
| File structure | header, syntax, record, orphan | Wrong header/order, wrong number of cells, malformed quoting, unknown record kind, child before a bill or bare final CR |
| One document's mapping | cell_not_allowed, encoding, line_break, too_large, reference, format, obligation_presence | A disallowed cell, invalid UTF-8, multiline text, per-document size, attachment, format or presence problem |
| One document's content | Source schema or business rejection | Required values, exact money, calendar dates, bank checks, revision rules or graph semantics |
The adapter stops at a structural failure. Upload/preview check the whole file: a structural failure or a file without any bill returns 400 invalid_import; confirmation has not begun processing it. If a previously confirmed run cannot reproduce its reviewed file interpretation, it stops with existing results preserved.
A mapping or content problem belongs to its document. It appears in the preview or recorded results while valid neighbours can proceed after confirmation. Error reports give positions and safe codes/line/column information; they do not quote cell values. Keep the source identity and revision rules when correcting a rejected document; do not re-label a conflicting revision as a new document.
Each document is limited to 1,048,576 bytes (1 MiB) in both the collected CSV cells and the derived JSON. The collected size counts the UTF-8 bytes of every decoded cell, including empty cells, plus one byte per cell separator. It includes all rows of that document and differs from raw file size because quoting and row endings are decoded. Exceeding either size yields too_large for that document; this is not a promise that an API envelope and a CSV document have identical usable capacity. The upload limits apply to the complete file separately.