The new law, known as AB 485, takes effect on 1 January. Any businesses violating it face a $500 (£400) fine.
The change means cats, dogs and rabbits sold by retailers cannot be sourced from breeders, only from animal shelters.
Animal rights groups have heralded it as a step forward against so-called "kitten factories" and "puppy mills".
They say the current "high-volume" industries, where pets are bred for profit, can lead to inhumane treatment and long-term emotional and physical health problems in some animals.
The new state-wide law, approved in late 2017, will now require shops to maintain sufficient records of where they sourced each animal, for periodic checks by authorities.