{"id":"swiss-qr-reference-validate","version":"1.0.0","description":"Validate a 27-digit Swiss QR-bill QR reference's modulo-10-recursive check digit and reject all-zero references.","supported_operations":["validate a swiss qr bill reference number","check digit for a qrr reference","is this qr-bill reference valid","verify a swiss payment slip reference before sending","modulo 10 recursive check digit for a qr reference","esr qrr reference checksum"],"unsupported_operations":["the Swiss ISR/ESR 27-character reference of the older, non-QR payment slip format documented separately (same algorithm, but this tool only accepts the QR-bill QRR 27-digit shape)","computing a new QR reference from a payload (this tool only validates)","creditor information, IBAN/QR-IBAN, amount or debtor fields printed on the same QR-bill"],"semantics":["Every ASCII space is removed from reference first; no other trimming and no case folding.","If the space-stripped string's length is not 27 code points, valid:false, reason:'wrong_length', normalized:null, check_digit:null, print:null.","Otherwise, if the space-stripped string does not match ^[0-9]{27}$, valid:false, reason:'invalid_character', normalized:null, check_digit:null, print:null.","Otherwise normalized = the 27-digit string. print = normalized split into groups of 2,5,5,5,5,5 digits joined by a single space. check_digit = normalized[26] (echoed as given, not recomputed); these three fields are populated from here on regardless of validity.","If normalized is 27 zero digits, valid:false, reason:'all_zero' (checked before the checksum, since an all-zero reference's checksum would otherwise pass).","Modulo 10 recursive check: walk the first 26 digits with the mod10-recursive carry table (shared with checkdigit-compute/validate); expected_check_digit = (10 - carry) mod 10. If check_digit differs, valid:false, reason:\"check_digit_mismatch\". Otherwise valid:true, reason:null."],"limits":{"max_reference_bytes":40},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["reference"],"properties":{"reference":{"type":"string","minLength":1,"maxLength":40}}},"output_schema":{"type":"object","additionalProperties":false,"required":["valid","reason","normalized","check_digit","print"],"properties":{"valid":{"type":"boolean"},"reason":{"type":["string","null"],"enum":[null,"wrong_length","invalid_character","all_zero","check_digit_mismatch"]},"normalized":{"type":["string","null"],"pattern":"^[0-9]{27}$"},"check_digit":{"type":["string","null"],"pattern":"^[0-9]$"},"print":{"type":["string","null"],"minLength":32,"maxLength":32}}},"examples":[{"input":{"reference":"210000000003139471430009017"},"output":{"valid":true,"reason":null,"normalized":"210000000003139471430009017","check_digit":"7","print":"21 00000 00003 13947 14300 09017"}},{"input":{"reference":"000000000000000000000000000"},"output":{"valid":false,"reason":"all_zero","normalized":"000000000000000000000000000","check_digit":"0","print":"00 00000 00000 00000 00000 00000"}},{"input":{"reference":"21000000000313947143000901"},"output":{"valid":false,"reason":"wrong_length","normalized":null,"check_digit":null,"print":null}}],"execute_url":"/v1/tools/swiss-qr-reference-validate/versions/1.0.0/execute"}