Skip to content

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.

ColumnsExact headerRecords availableCSV and matching JSON source
36First row of legacy water CSVbill, line, vat, measurementThree bills: first, second, third
77Rich headerBase records plus graph and attachment recordsCSV · JSON
80Relationship headerRich records plus relationshipCSV · JSON
88Balance headerRelationship records plus adjustment; balance cells on billCSV · JSON
100Transfer headerBalance records plus child payment_instructionCSV · JSON
103Service total headerTransfer records, with extra service_component cellsCSV · JSON
104Native headerService total records, with explicit obligation presence on billCSV · 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 availabilityAllowed cells on record=billMeaning
Allsource_document_id, revision, revision_kind, document_number, issue_date, currencyDocument identity and source facts
Allperiod.start, period.end, customer.provider_accountDocument service period and customer routing key
Alltotals.net, totals.vat, totals.gross, obligation.amount_due, obligation.due_dateSource document totals and the separate amount due
Allpayment_instruction.iban, .model, .reference, .purpose_code, .descriptionOne singular bank instruction
Allpayment_instruction.payee.name, .street, .postcode, .cityOptional payee details for that singular instruction
77 onwardformat, document_type, completeness.level, .pages_received, .pages_expected, languageExplicit source format and completeness
77 onwardperiod.endpoints, dates.service_performed_on, .meter_read_on, .tax_point_onAdditional source dates and interval meaning
77 onwardcustomer.provider_account_ref, payment_instruction.payee_party_refReferences inside this document's graph
88 onwardbalance_snapshot.as_of, .prior_due, .included_in_amount_due, .source_fact_idOne optional balance snapshot, never a separate record
104 onlyobligation.presenceRequired 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 ​

recordAllowed cellsOutput
lineline.description, .quantity, .unit, .netOne lines[] item
vatvat.rate, .base, .vatOne vat_summary[] item
measurementmeasurement.service, .unit, .quantity, .period.start, .period.endOne 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.

recordAllowed cellsOutput or attachment
partyparty.id, .display_nameOne parties[] object
party_roleparty_role.party_ref, .roleAppend one role to the named party
identifieridentifier.owner_ref, .scheme, .valueAppend one identifier to its named owner
provider_accountprovider_account.id, .account_holder_party_refOne provider_accounts[] object
contractcontract.id, .type, .provider_account_refOne contracts[] object
billing_pointbilling_point.id, .type, .contract_refOne billing_points[] object
devicedevice.id, .type, .billing_point_refOne devices[] object
service_componentservice_component.id, .service_type, .provider_account_ref, .contract_ref, .billing_point_ref, .operator_party_refOne 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 recordAllowed cellsMeaning
80 onward: relationshiprelationship.type, .target_source_document_id, .target_revisionOne ordered relationship assertion; blank optional target revision means absent
88 onward: adjustmentadjustment.type, .amount, .included_in_amount_due, .source_fact_idOne 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, plus payment_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 ​

ScopeCodes and examplesWhat to correct
File structureheader, syntax, record, orphanWrong header/order, wrong number of cells, malformed quoting, unknown record kind, child before a bill or bare final CR
One document's mappingcell_not_allowed, encoding, line_break, too_large, reference, format, obligation_presenceA disallowed cell, invalid UTF-8, multiline text, per-document size, attachment, format or presence problem
One document's contentSource schema or business rejectionRequired 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.

Documentation for providers and partners.