{"id":"gs1-key-validate","version":"1.0.0","description":"Validate a GTIN-8/12/13/14, GLN, SSCC or GSIN's GS1 mod-10 check digit and look up its 3-digit GS1 prefix meaning.","supported_operations":["validate a gtin barcode number","check digit for an sscc pallet label","is this gln location number valid","gs1 mod 10 check digit validator","what does this gtin prefix mean","validate a gsin shipment number"],"unsupported_operations":["a bare gs1-mod10 algorithm over an arbitrary payload (use checkdigit-validate)","converting between UPC/EAN/GTIN symbol formats (use upc-ean-convert)","parsing a full GS1 AI element string (use gs1-element-string-parse)","a live GEPIR company/product lookup"],"semantics":["key is taken exactly as given; no trimming. Allowed lengths per key_type: gtin -> 8, 12, 13 or 14; gln -> 13; sscc -> 18; gsin -> 17.","A length outside those for key_type returns {valid:false, reason:'wrong_length'} with gtin14/gs1_prefix/prefix_usage/member_organisation null; a right-length non-digit value returns reason 'invalid_character' with the same null fields.","gtin14 is key left-zero-padded to 14 characters when key_type is gtin, else null. gs1_prefix is a 3-digit slice: gtin14[1:4] for a gtin of length 12, 13 or 14; key[0:3] (the GS1-8 Prefix, never the zero padding) for a gtin of length 8; key[1:4] for sscc (skips the extension digit); key[0:3] for gln and gsin.","prefix_usage and member_organisation use the GS1 central allocation snapshot dated 2026-10-01. A GTIN-8 whose GS1-8 Prefix starts with 0 or 2 is restricted_circulation (RCN-8); 050-059 -> reserved; GTIN-8 960, 961, 9620-9624 -> GS1 UK; 9625-9626 -> GS1 Poland; remaining 960-969 -> GS1 Global Office only for GTIN-8; 981-983 -> coupon. Otherwise the pinned prefix table applies: 950 -> GS1 Global Office, 951 -> epc, 952 -> demonstration, 977 -> issn, 978-979 -> bookland_isbn except 9790 -> ismn. Unlisted allocations return reserved in this snapshot, independent of check-digit validity.","The check digit is the GS1 mod-10 check over key (weights 3,1 alternating from the rightmost digit); a mismatch returns reason check_digit_mismatch with all other fields still populated.","data_version identifies the dated partial prefix-table audit and the explicitly unknown syntax-dictionary release, returned on every call."],"limits":{"max_key_bytes":18},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["key","key_type"],"properties":{"key":{"type":"string","minLength":1,"maxLength":18},"key_type":{"type":"string","enum":["gtin","gln","sscc","gsin"]}}},"output_schema":{"type":"object","additionalProperties":false,"required":["valid","reason","key_type","length","gtin14","gs1_prefix","prefix_usage","member_organisation","data_version"],"properties":{"valid":{"type":"boolean"},"reason":{"type":["string","null"],"enum":[null,"wrong_length","invalid_character","check_digit_mismatch"]},"key_type":{"type":"string","enum":["gtin","gln","sscc","gsin"]},"length":{"type":"integer","minimum":1,"maximum":18},"gtin14":{"type":["string","null"],"pattern":"^[0-9]{14}$"},"gs1_prefix":{"type":["string","null"],"pattern":"^[0-9]{3}$"},"prefix_usage":{"type":["string","null"],"enum":[null,"member_organisation","restricted_circulation","coupon","bookland_isbn","ismn","issn","refund_receipt","reserved","demonstration","epc"]},"member_organisation":{"type":["string","null"]},"data_version":{"type":"string","const":"gs1-central-prefix-snapshot-2026-10-01.gs1-syntax-dictionary-unknown-release"}}},"examples":[{"input":{"key":"4006381333931","key_type":"gtin"},"output":{"valid":true,"reason":null,"key_type":"gtin","length":13,"gtin14":"04006381333931","gs1_prefix":"400","prefix_usage":"member_organisation","member_organisation":"GS1 Germany","data_version":"gs1-central-prefix-snapshot-2026-10-01.gs1-syntax-dictionary-unknown-release"}},{"input":{"key":"0200000000004","key_type":"gln"},"output":{"valid":true,"reason":null,"key_type":"gln","length":13,"gtin14":null,"gs1_prefix":"020","prefix_usage":"restricted_circulation","member_organisation":null,"data_version":"gs1-central-prefix-snapshot-2026-10-01.gs1-syntax-dictionary-unknown-release"}},{"input":{"key":"123456789","key_type":"gtin"},"output":{"valid":false,"reason":"wrong_length","key_type":"gtin","length":9,"gtin14":null,"gs1_prefix":null,"prefix_usage":null,"member_organisation":null,"data_version":"gs1-central-prefix-snapshot-2026-10-01.gs1-syntax-dictionary-unknown-release"}}],"execute_url":"/v1/tools/gs1-key-validate/versions/1.0.0/execute"}