← back

rtr-iso20022

2026 · Rust, serde, typify

Rust types for Canada's Real-Time Rail payments, generated from the ISO 20022 schemas and checked with round-trip tests. Found a spec mismatch and reported it to Payments Canada.

Real-Time Rail (RTR) is Canada’s new instant payment system. Its API speaks ISO 20022 as JSON: pacs.008 to send a payment, pacs.002 for status, admi messages for administration.

This crate generates Rust types from the SWIFT MyStandards JSON schemas using a small codegen tool built on typify, then checks them with round-trip tests: JSON → struct → JSON, compared as ASTs, with serde_path_to_error so a failure names the exact field.

While building the tests I found that the spec and Payments Canada’s own sandbox scenarios disagree on how amounts are typed (string vs. integer). I documented it and asked Payments Canada directly.

Status: pacs.008 and pacs.002 are wired up. Next: generate test fixtures from every sandbox scenario.