{"id":"ismn-validate","version":"1.0.0","description":"Validate an ISMN's EAN mod 10 check digit in M-form or 979-0 form and return the canonical 13-digit form.","supported_operations":["validate an ismn","check ismn check digit","convert m-form ismn to 979-0","is this music publication number valid","ismn checksum validator","verify sheet music identifier","is 979-0 a valid isbn prefix"],"unsupported_operations":["looking up which publication an ISMN actually identifies","validating an ISBN or ISSN (see isbn-validate / issn-validate)","accepting a 979-0 form with the M-form prefix mixed in"],"semantics":["Normalization: remove every '-' and ' ' from ismn first; the 17-byte limit and 1-byte minimum apply to the original, unstripped ismn.","Character counting: every length, position and 'character' counts Unicode code points, not UTF-16 code units, so the echoed ismn13 and check_digit never split a surrogate pair.","Two stripped lengths are accepted: 10 (M-form: character 1 must be literal 'M', characters 2-10 are 9 digits including the check digit) or 13 (all digits, current form). Any other stripped length is reason wrong_length, checked first.","13-digit-form only: once the charset passes, characters 1-4 must be '9790', else reason unknown_prefix.","ismn13 and check_digit are always reconstructed from the raw positions whenever the stripped length is 10 or 13, regardless of charset, prefix or check-digit validity; both are null only when length already failed. For M-form, ismn13 is 9790 + characters 2-9 + a freshly computed check digit (computable once characters 2-9 are digits); for the 13-digit form, ismn13 is simply the stripped input.","Check digit (evaluated only once the charset, and for the 13-digit form the prefix, both pass): weight the first 12 digits (of the 13-digit form, or of 9790+characters2-9 for M-form) alternately 1,3,... (the isbn13/EAN-13 rule); a mismatch with the actual 13th digit (or M-form character 10) is reason check_digit_mismatch.","valid is true only when length, charset, (for the 13-digit form) the prefix, and the check digit all pass, in that order; only one reason is ever returned."],"limits":{"max_ismn_bytes":17},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["ismn"],"properties":{"ismn":{"type":"string","minLength":1,"maxLength":17}}},"output_schema":{"type":"object","additionalProperties":false,"required":["valid","reason","ismn13","check_digit"],"properties":{"valid":{"type":"boolean"},"reason":{"type":["string","null"],"enum":[null,"wrong_length","invalid_character","unknown_prefix","check_digit_mismatch"]},"ismn13":{"type":["string","null"],"minLength":13,"maxLength":13},"check_digit":{"type":["string","null"],"minLength":1,"maxLength":1}}},"examples":[{"input":{"ismn":"M-2306-7118-7"},"output":{"valid":true,"reason":null,"ismn13":"9790230671187","check_digit":"7"}},{"input":{"ismn":"979-0-060-11561-5"},"output":{"valid":true,"reason":null,"ismn13":"9790060115615","check_digit":"5"}}],"execute_url":"/v1/tools/ismn-validate/versions/1.0.0/execute"}