Secret codes for the Littlest Pet Shop online world are typed in on the official website, not inside a downloaded game or a mobile app. You will normally find the code entry field in the area of your account page that deals with redeemable codes or special offers, and you need to be logged in before it will accept anything.
Codes are usually handed out through packaging, promotional partners or events, and most of them expire or can only be used once. If a code is rejected, that is the most common reason rather than a typing mistake.