Every Build-A-Bear ID and key code is unique—even two furry friends of the exact same type will have different codes. There's no shortcut or generator to get one; the only way to obtain a code for a furry friend is to purchase the bear itself.
These codes are meant to unlock the online companion that goes with your specific plush, which is why they can't be shared or reused.