{"id":"upc-ean-convert","version":"1.0.0","description":"Convert a validated UPC-A, UPC-E, EAN-13 or GTIN-14 number to another symbol format, recomputing the check digit.","supported_operations":["convert upc-e to upc-a","expand a compressed upc barcode","convert ean-13 to gtin-14","compress a upc-a to upc-e","upc to ean converter","pad a barcode number to gtin-14"],"unsupported_operations":["validating a key and reporting its GS1 prefix meaning (use gs1-key-validate)","parsing a GS1 AI element string (use gs1-element-string-parse)","converting to or from EAN-8 or ISBN Bookland forms"],"semantics":["value is taken exactly as given; no trimming. from_format is chosen by value.length: 8 -> upc-e, 12 -> upc-a, 13 -> ean-13, 14 -> gtin-14; any other length, a non-digit character, or a mismatched source check digit throws invalid_input.","upc-e source: value[0] (number system) must be '0' or '1'; the 6-digit body is expanded to an 11-digit UPC-A payload by its last digit's pattern (0-2, 3, 4, or 5-9), then its GS1 mod-10 check digit is verified against value[7].","upc-a/ean-13/gtin-14 source: value's own trailing GS1 mod-10 check digit is verified over the whole value.","The canonical GTIN-14 form is always computed first (left-zero-padding upc-a/ean-13, or expanding upc-e through UPC-A); to selects the output: gtin-14 returns it unchanged; ean-13/upc-a/upc-e each throw not_computable if the leading indicator digit(s) that would be dropped are non-zero, or, for upc-e, if the UPC-A number system is not 0/1 or none of the 4 zero-suppression patterns (checked in order, first match wins) apply.","check_digit is always the last character of result. Pure string parsing and GS1 mod-10 arithmetic; no locale, clock, or randomness."],"limits":{"max_value_bytes":14},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["value","to"],"properties":{"value":{"type":"string","minLength":1,"maxLength":14},"to":{"type":"string","enum":["upc-a","upc-e","ean-13","gtin-14"]}}},"output_schema":{"type":"object","additionalProperties":false,"required":["result","from_format","check_digit"],"properties":{"result":{"type":"string","minLength":8,"maxLength":14},"from_format":{"type":"string","enum":["upc-a","upc-e","ean-13","gtin-14"]},"check_digit":{"type":"string","pattern":"^[0-9]$"}}},"examples":[{"input":{"value":"042100005264","to":"upc-e"},"output":{"result":"04252614","from_format":"upc-a","check_digit":"4"}},{"input":{"value":"04252614","to":"upc-a"},"output":{"result":"042100005264","from_format":"upc-e","check_digit":"4"}},{"input":{"value":"4006381333931","to":"gtin-14"},"output":{"result":"04006381333931","from_format":"ean-13","check_digit":"1"}}],"execute_url":"/v1/tools/upc-ean-convert/versions/1.0.0/execute"}