Will I earn Nintendo Points for digital purchases outside the eShop?
Normally when you buy a digital game on the Nintendo Switch eShop, you receive 5% credit back as My Nintendo Gold Points.
If I purchase a digital copy of a Switch game outside of the eShop, (ie: Amazon or GameStop), will I still earn Nintendo Gold Points?
Yes, you will earn Gold Points if you buy a digital copy from retailers like Amazon or Gamestop.
Gold Points can be earned by purchasing eligible digital games for Nintendo Switch [...] from the official Nintendo website, Nintendo eShop, or by redeeming a retailer-issued download code.
Source
You will get the usual 5% (of the undiscounted eShop price at the time of redemption) for download codes as well.
Source