{"id":"isin-compute-from-nsin","version":"1.0.0","description":"Build a 12-character ISIN from a country prefix and a CUSIP/SEDOL national number, computing its Luhn check digit.","supported_operations":["convert cusip to isin","convert sedol to isin","build an isin from a national security number","compute isin check digit from cusip","turn a uk sedol into an isin","generate isin from nsin","pad a sedol into an isin nsin slot"],"unsupported_operations":["validating an already-complete 12-character ISIN (see isin-validate)","computing an ISIN for a country outside US, CA, GB, IE, IM, JE, GG","computing the CUSIP or SEDOL check digit for the caller (the national number must already be self-consistent)"],"semantics":["nsin_padded is nsin left-padded with '0' to exactly 9 characters (a no-op when nsin is already 9 characters); this covers both a 9-character CUSIP unchanged and a 7-character SEDOL gaining exactly two leading zeros.","Only country_prefix values US, CA, GB, IE, IM, JE, GG are supported; any other well-formed 2-letter value throws unsupported_input.","For US/CA, nsin_padded must be a self-consistent CUSIP that is ISIN-eligible: its first 8 characters must each be a digit 0-9 or an uppercase letter A-Z (the CUSIP private-placement characters '*', '@' and '#' are valid in a CUSIP but never in an ISIN NSIN) and its own 9th character must equal the ANSI X9.6 check digit computed from those 8 characters; a charset violation throws invalid_input with details.reason 'cusip_invalid_character', a check-digit mismatch throws invalid_input with details.reason 'cusip_check_digit_mismatch'.","For GB/IE/IM/JE/GG, nsin_padded's first two characters must be '00' and the remaining 7 characters must be a self-consistent SEDOL (weights 1,3,1,7,3,9 over the first 6, no vowels); a padding, charset or check-digit failure throws invalid_input.","Once nsin_padded is accepted, check_digit is computed exactly as in isin-validate: expand country_prefix+nsin_padded (11 characters, A=10 ... Z=35) then apply Luhn (double every digit at an odd 1-based position from the right, sum, check = (10 - sum mod 10) mod 10).","isin is country_prefix + nsin_padded + check_digit (12 characters, no case folding)."],"limits":{"max_country_prefix_bytes":2,"max_nsin_bytes":9},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["country_prefix","nsin"],"properties":{"country_prefix":{"type":"string","minLength":2,"maxLength":2,"pattern":"^[A-Z]{2}$"},"nsin":{"type":"string","minLength":1,"maxLength":9}}},"output_schema":{"type":"object","additionalProperties":false,"required":["isin","check_digit","nsin_padded","data_version"],"properties":{"isin":{"type":"string","minLength":12,"maxLength":12},"check_digit":{"type":"string","minLength":1,"maxLength":1},"nsin_padded":{"type":"string","minLength":9,"maxLength":9},"data_version":{"type":"string"}}},"examples":[{"input":{"country_prefix":"US","nsin":"037833100"},"output":{"isin":"US0378331005","check_digit":"5","nsin_padded":"037833100","data_version":"isin-nsin-schemes-2026-09-28"}},{"input":{"country_prefix":"GB","nsin":"0263494"},"output":{"isin":"GB0002634946","check_digit":"6","nsin_padded":"000263494","data_version":"isin-nsin-schemes-2026-09-28"}}],"execute_url":"/v1/tools/isin-compute-from-nsin/versions/1.0.0/execute"}