You have to have your whole National Dex complete, with the exception of Event Pokemon.
I don't believe you can buy it from people? But I could be wrong.
Basically what AmenFashion said. It's a Key Item, so you can't trade or give it away, and you only get it from the Professor of whichever game you're in when you complete the National Dex (except for event-only Pokemon).
It's a long shot, but if you know anyone irl with a 'living Pokedex' (they physically have every Pokemon) and Pokemon Bank, they could move all 700-ish Pokemon onto your game, you can save, and then transfer them away again. I did it for a couple of my friends, but unfortunately you can't do it over the internet, except by trading one by one.
I have the shiny charm in Alpha Sapphire If you have some old Pok?mon games and use the GTS, it's not that hard to complete the National Dex although it does take some time.