Skip to content

Legacy presentment receiver ​

racun-development-presentment is the profile selected by a bills:read grant. Read selection and compatibility and current-access transport first.

The complete invented message is an output from this profile, not provider input. The response model in the OpenAPI reference describes its structure; the decoding and identity rules below are additional receiver requirements. Shape validation alone cannot check an identity digest, duplicate JSON keys or safe receiver state transitions.

The bill body is the legacy canonical bill. This profile does not flatten rich/native data: a document with any rich revision is outside the legacy grant, and authorized native content is explicitly refused. It carries no customer ownership proof, account ID, raw original, card status, bank settlement, partial-payment allocation or downstream deletion feed.

A PDF descriptor is an immutable version-bound supplement. Download its bytes through the existing authorized PDF route; check its digest and size before use. An attached PDF is not an independently verified original or a source of totals.

Message identity ​

message_id is the lowercase hexadecimal SHA-256 of five netstrings in this order: profile, issuer.market, issuer.provider, bill.source_document_id, and bill.revision in decimal. A netstring is the decimal byte length of the UTF-8 value, :, the value and ,. For the worked example:

sh
printf '29:racun-development-presentment,2:hr,17:invented-provider,22:invented-water-2026-09,1:1,' | shasum -a 256
# 3878ce1469d2b0ae85868387c6201292f821643454799c5bb76ca3c293de2253

The same stored version therefore always has the same message_id. A later PDF attachment does not change it. A new revision has a new one. message_id identifies the version; it is not a secret, and knowing it grants nothing.

Decoding rules ​

Accept a message only when all of these rules hold.

These rules decide only whether a message is syntactically valid under this profile. They do not decide whether the message's operation is allowed in its market. For example, a message with issuer.market ba, currency EUR and an HR instruction is valid here. Whether a market may issue it is the issuing instance's responsibility under its market rules. The market is bound to the issuing instance; a partner cannot select it through a query or message. A receiver must not read validity as proof that a market allows the content.

JSON text. The input is UTF-8 JSON holding exactly one object, with nothing after it. Member names match exactly, including case, and appear at most once in every object. No member is null. No object has a member this page does not list. No text contains U+0000 or U+FFFD; the second also catches invalid escapes such as a lone surrogate.

Envelope.

  • profile is required and is exactly racun-development-presentment.
  • message_id is required: 64 lowercase hexadecimal characters equal to the computed identity.
  • issuer is required, with both members: market is two lowercase ASCII letters; provider is nonempty text.
  • bill is required (rules below).
  • pdf is optional; when present, all three members are required. sha256 is 64 lowercase hexadecimal characters. size_bytes is a JSON integer of at least 1 written without a fraction or exponent. source is provider or staff.

Bill. These restate the canonical bill schema and its intake checks.

  • Text fields are nonempty strings. They are source_document_id, document_number, customer.provider_account, line description and unit, measurement service and unit, and every payee field and the instruction description.
  • Required: source_document_id, revision, revision_kind, document_number, issue_date, currency, customer (only provider_account, required), totals (net, vat, gross, all required) and obligation (amount_due required, due_date optional).
  • revision is a JSON integer from 1 to 2147483647, without a fraction or exponent.
  • revision_kind is original, correction, replacement or cancellation.
  • currency is EUR or BAM.
  • A date is a real calendar date written YYYY-MM-DD, with a year from 0001. A period has start and end, both required, and start is not after end. This applies to period and each measurement's period.
  • Money is a string matching ^-?(0|[1-9][0-9]*)\.[0-9]{2}$, never -0.00 and never a JSON number. Exponents, a leading +, commas and other scales are invalid. Money is never converted to binary floating point.
  • Quantity is a string matching ^(0|[1-9][0-9]*)(\.[0-9]+)?$.
  • For both money and quantity, the whole part has at most 131072 digits and the fraction at most 16383, the stored numeric limits.
  • A VAT rate matches ^0\.[0-9]{2}$; 0.25 is 25 %.
  • lines, measurements and vat_summary are optional; a present list has at least one entry.
    • A line has description and net (required), and quantity and unit (optional).
    • A measurement has service, unit, quantity and period, all required.
    • A VAT entry has rate, base and vat (money), all required.
  • payment_instruction is optional and allowed only with currency EUR.
    • iban matches ^HR[0-9]{19}$.
    • model is HR01 or HR05.
    • reference matches ^[0-9]{1,12}(-[0-9]{1,12}){0,2}$ and has at most 22 characters.
    • purpose_code (optional) matches ^[A-Z]{4}$.
    • description is optional text.
    • payee is optional; when present it has at least one of name, street, postcode and city.
    • The IBAN and reference check digits are not part of this profile; they belong to payment generation (HUB3).

Byte spelling is not content. Whitespace, member order and string escapes may differ between two encodings of the same message. The codec encodes the same stored version to the same bytes, but a receiver compares decoded values, not bytes.

Receiver semantics ​

One source at a time. A receiver keeps separate state for each reliably configured source instance and environment: the Račun instance it pulls from, identified by its configuration (the origin it calls and the key it signs with). It never separates sources by the issuer.market or issuer.provider text of a message. The same business identity from two separate sources (for example a staging and a production instance of the same market) is never a replay or conflict between them. Never combine the state of separately configured sources.

Within one source, the receiver keys a version by message_id and a document by issuer.market, issuer.provider and bill.source_document_id. A message's content is everything except pdf.

Receiver stateMessageOutcome
Unknown message_idValidaccepted; becomes current when its revision is the document's highest
Same message_id, same contentPDF equal, or absentreplay; a stored PDF stays
Same message_id, same content, no PDF storedPDF presentpdf_attached
Same message_id, different contentAnyconflict; the stored version stays
Same message_id, PDF storedDifferent sha256, size_bytes or sourceconflict; the first PDF stays
AnyInvalid under the decoding rulesrejected; nothing changes

Current revision. The current version of a document is its highest accepted revision. It is offered for payment only when its revision_kind is not cancellation and its amount_due is greater than zero. A lower revision that arrives later becomes history and never replaces the current one.

payable describes these bill facts only. It does not establish an available payment method, market capability or settlement.

No payment truth. Being offered for payment depends only on the bill facts. The message never states that a bill was paid or posted. A presenter's own payment needs its own agreed authority and evidence.

Documentation for providers and partners.