Appearance
Rich and signed presentment receiver
racun-rich-presentment, wire revision 1, is the profile for an explicitly confirmed bills:read-rich grant. It supports legacy and supported rich snapshots, with the source kind named by canonical_format. See profile selection and compatibility and current-access pull. Neither this profile nor its signed wrapper supports native documents; an authorized unsupported document is refused, never silently converted to legacy content.
Download the actual invented rich message, legacy body in a rich message, signed rich message, signed PDF supplement and fixture public trust keys. The signed fixture uses its own relay/document identities; it is not the signed form of the separate unsigned fixture. These public keys verify invented vectors only and must never be treated as production trust.
Message
The envelope has exactly the required members profile, integer wire_revision, message_id, issuer, document_id, version_id, canonical_format, bill_sha256 and bill, with optional pdf. profile is exactly racun-rich-presentment and wire_revision is the integer 1, without a fraction or exponent. issuer has exactly relay_id, market and provider: the relay is a lowercase UUID URN, the market is two lowercase ASCII letters and the provider is nonempty text. Both document/version IDs are lowercase UUID URNs. Message and body digests are 64 lowercase hexadecimal characters. Apply the strict JSON text rules to every nested object; the generated response models define the permitted minimized body fields.
Use the complete rich message to inspect a valid envelope. canonical_format names the source format: legacy or racun-canonical-rich-1. Treat document/version URNs as opaque stable identities. Source document IDs, revisions and graph Local IDs remain in bill unchanged. Graph Local IDs are version-scoped; they do not identify application accounts or authorize reads.
message_id is lowercase SHA-256 of the concatenated UTF-8 netstrings of: profile, decimal wire revision, relay ID, market, provider, document URN, version URN, in that order. A netstring is byte length, colon, exact bytes, comma. Persisted identities survive process restart and PDF attachment. Two relays with the same market/provider/source document remain distinct.
Minimized body and digest
The profile omits protected rich source fields: Party display_name and identifiers, and identifiers on provider accounts, contracts, billing points and devices. It retains graph IDs/roles/references, lines, measurements, source relationships, balance explanations and all supported alternative transfer instructions in source order. customer.provider_account and instruction payee remain as in the legacy profile. Monetary and quantity strings, zero, negative amounts and explicit false booleans stay lossless. No sums or payment decisions are added.
The body is not the complete canonical source. A missing protected field means omitted by this profile, not absent from the source. It contains no application account IDs, raw originals or payment status/report, and makes no document-signature or OCR claim. relationship_targets and payment_instruction_validity are not members of this profile.
bill_sha256 hashes the minimized body only, using this lossless canonical JSON boundary: UTF-8 canonical serialization (JCS-compatible within the safe integer domain), object keys sorted by UTF-16 units, array order retained, no insignificant whitespace, quote/backslash/control escaping without HTML escaping or Unicode normalization. The rich integer domain also admits values whose retained decimal spelling differs from binary64 JCS. Preserve their decimal spelling; general binary64 JCS processing is insufficient for those values. Decimal values remain exact strings; the only JSON numbers are contract integers with their normal decimal spelling. Case variants, unknown members, duplicate names, nulls, invalid UTF-8/surrogates, NUL/U+FFFD and any fields that cannot read back losslessly are rejected. Equivalent whitespace, object order or valid string escapes do not change the digest. This is neither the stored full-source canonical fingerprint nor a raw receipt digest.
pdf has exactly sha256 (64 lowercase hex), positive integer size_bytes, and source (provider or staff). It may arrive after the first export; it never enters bill_sha256. Fetch the exact version through the authorized PDF endpoint; access is checked again before its bytes are sent.
The receiver keeps immutable bill content by message ID. A relay/provider/document revision already bound to one message ID rejects any second version/message identity as conflict without changing stored/current state. Same ID and same bill is replay. A first absent PDF followed by a descriptor is an attachment supplement. Different bill content (even with a recomputed digest) or a different already-known PDF is conflict. An absent PDF on a later message does not remove the known one. Message/document/version IDs and body digest are stable; whole-envelope bytes are not stable across PDF attachment.
Body validation beyond field shapes
For canonical_format=legacy, apply the legacy bill rules. For racun-canonical-rich-1, the generated minimized response models define the exact supported members, required fields, string formats and enum values. Apply these cross-field rules as well; a schema or successful digest is not a substitute:
- Money uses exact scale-two strings, with no negative zero; quantities use unsigned decimal strings. Never calculate an amount due from lines or add a balance to the already stated obligation. Missing optional totals stay absent.
- Dates must be real calendar dates. Each period's start is no later than its end. Supplied page counts are positive integers; omit an unspecified count rather than encoding zero. Received cannot exceed expected when both are supplied. Preserve the declared completeness, endpoints and source language; do not infer missing pages or translations.
- Graph IDs are lowercase UUID URNs and unique across all graph classes within this version. Every nonempty reference resolves to the required class in the same version. A provider account's holder has role
account_holder; a service operator has roleservice_operator; an instruction payee has rolepayee. - The contract and account explicitly named by a service must agree with the parent billing-point/contract path when both specify those facts. A measurement's service and device must refer to the same billing point when both specify one. Graph references never grant account access or identify an application user.
- A relationship's target source identity is nonempty. An explicit revision is in the supported positive revision range; a relationship to this same source document must name an earlier revision. It cannot target its current/future revision or omit the revision for that self-reference. It does not grant read access to the target document.
- Supported adjustments are
prior_balancefacts with uniquesource_fact_id. If a balance snapshot and adjustment share that ID, both their amount andincluded_in_amount_duemust agree. Those are explanations of the stated amount, not charges to add again. - A singular payment instruction and an alternatives array cannot coexist. Supported alternatives are EUR
credit_transferinstructions usingHR:IBAN; each currency matches the document and each amount equals its obligation.valid_frommust not be aftervalid_until. Preserve the explicit partial payment value; unspecified never silently becomes allowed. These instructions do not prove that a payment rail is enabled or that a payment happened. payment_onlycompleteness excludes totals, lines, measurements, VAT summary and service components. Absence means not supplied, not zero. Present data must survive lossless decoding: do not coerce a numeric string, accept null as omission, or drop unknown/empty data to make a message fit.
The profile retains the historical integer domain of rich messages. A receiver must preserve integer spelling/range without first rounding through an unsafe binary64 value. The provided fixtures exercise ordinary safe integers; their successful decode is not proof for every possible numeric boundary.
Explicit signed relay transport
The optional query presentation=relay-signed is accepted only on the existing partner list and single-message GETs, under a bills:read-rich grant. The exact raw query remains part of the partner request HMAC. On a list it may accompany after and limit, each once; on a single read it is the only query. The PDF endpoint still accepts no query. An omitted presentation preserves the existing unsigned profiles and bytes. Unsupported/empty/duplicate selection or signed selection under a legacy grant is 400 invalid_partner_request.
Each selected message is a closed transport wrapper with exactly profile="racun-rich-presentment-signed", integer wire_revision=1 and a nonempty jws string. List items carries these wrappers; ordering and next_after use the unchanged inner message IDs. This is not a revision of the inner rich profile and does not duplicate its JSON alongside the JWS.
jws is standard compact JWS with an embedded payload (RFC 7515), signed by JOSE ES256 (P-256/SHA-256, RFC 7518). It has three nonempty base64url segments separated by dots, with no whitespace or padding. The protected header has exactly alg="ES256", nonempty kid and typ="racun-rich-presentment-signed". No other algorithm, unprotected header, embedded/remote key, crit or b64 extension is part of this profile. The payload is the exact UTF-8 bytes returned by the rich encoder, from opening to closing brace, without a trailing newline: all inner envelope fields, minimized bill and any present PDF descriptor. There is no new canonicalization. The outer HTTP JSON encoder cannot change those base64url-encoded payload bytes. The inner body digest keeps its existing scope and is not the JWS signature or a transport digest.
The operator configures the signing key separately from provider/partner HMAC and login keys. Missing signing configuration returns 503 internal_error, even for an empty list, with no unsigned fallback. Current account, grant, partner/key, read-right and bound relay checks still apply before signing.
Configure receiver trust as {relay_id,keys:[public JWK,…]} with unique nonempty kid, use="sig", alg="ES256", curve P-256 and no private material or network lookup. Each public JWK has exactly kty, crv, x, y, kid, use and alg; private, symmetric, URL and certificate key mechanisms are refused. It accepts only the selected wrapper/revision and compact JWS, matching protected typ and verified inner profile/revision/relay, before changing state. An unsigned response in a signed pull is a refusal, not a downgrade.
For rotation, distribute the new public key to the receiver before the relay starts signing with its new key and kid. Retain the old public key while earlier copies must verify; removing it refuses their signatures. No IDs or bill digest change. ES256 signature bytes may differ on repeated reads: replay/conflict compare the verified inner content, never the JWS. A later PDF descriptor needs a fresh signature over the supplemented inner message, with the same inner IDs and body digest. Base64url payload adds roughly one third to response size; account for it within your response budget.
This explicit key binding and signature establish relay integrity only. They prove no issuer document signature, customer ownership, payment, freshness or read permission. Revocation still stops future server reads and cannot erase copies already obtained. Agree the relay/key binding before accepting real messages.
Receive a message safely
- Preserve the raw UTF-8 input. Reject duplicate member names, invalid text, unknown fields, nulls and an unsupported profile/revision before accepting it.
- If signed presentation was selected, require the signed wrapper, check the exact protected header and verify the embedded payload with the configured relay public key. Do not decode a signature and call that verification.
- Validate the inner rich envelope and the selected minimized body using the generated response contract. Check
message_id,bill_sha256and supported semantic references as described above. Shape and signature validation are separate; neither replaces the other. - Bind state to the configured source/environment and accepted relay. Retain immutable messages, apply replay/conflict and PDF-supplement rules, and select the highest accepted revision as current regardless of arrival order.
- Preserve previous verified evidence on any refusal. A cancellation is a bill revision, not a refund or proof of payment; no message declares settlement.
Coordinate changes before sending them to an older receiver: see compatibility.