I'm just reading this off the Bulbapedia article. Please tell me if I've mis-interpreted something.
Items can be obtained by redeeming prize tickets. There are four kinds of prize tickets, with different obtaining methods.
Prize ticket: recycle 4 items after Spinda's Cafe opens
Silver ticket: recycle 6 items after the player reaches Silver Rank and Project P has been announced
Gold ticket: recycle 8 items after reaching gold rank
Prism ticket: recycle 10 items or get from sky gift after reaching hyper rank and beating primal Dialga
When redeeming a ticket, the items you get depend on whether you get a loss, win, or big win. I really don't want to copy the item tables here, so I hope you'll be okay with reading some of this article.