Toontown membership codes come from membership game cards. You can typically find these Toontown cards at retailers like Target.
They usually cost around $10 and grant a month of membership. Once you have a card, the code on the back is what you enter to activate your membership.