That's what law enforcement does all the time: when there are illegal goods for sale, and a chance to catch the seller, they will go in, make the purchase and arrest the seller.
Sorry for the stupid question, but isn’t it illegal to buy illegal stuff? How does the police get away with that?
For instance in Denmark it is technically illegal to buy stolen goods, even if you genuinely aren’t aware of it being stolen. Im sure this applies to most countries.
LEOs often seem to be exempt when acting in an official capacity. I’m not sure what the restrictions are—do they need a court order in a situation like this?—but LEOs are definitely allowed to break laws and buy illegal wares.
Illegal is defined by law and laws applied to a subset of people.
What do you think the police does with illegal substances? Not confiscating them because "owning" it is illegal? No, the police does not take ownership the state does and the laws do not apply to the state. There is nothing out there in the world that is illegal for everyone to handle. not drugs, not nukes, not illegal media etc. someone has to have the right to handle it somehow.
This would not be a classics sting operation. The seller already committed the crime(s) by offering it.
Sting operation usually are the reason someone could commit a crime by creating a bait crime opportunity.