The money donated is used by the non-profit to purchase products that are then given away to needy kids. This is donation whichever way you look at it.
Amazon will let you do this but people generally specify who they want the product to go to which makes it a gift purchased for friends/family. So it qualifies as a purchase there.