I have build a new pole shed. I installed 20 amp switch with 12/2 wire from the switch to 20 amp outlets in the ceiling to power plug in LED lights. I can plug up to 8 LED lights on a 15 amp circuit (according to the packaging). My question: will plugin light fixtures with corded plugs meet code?
Corded lights are legal to be plugged into outlets. Although your LED lights are wired for a 15 amp circuit the lamp draws much less, the directions state 8 fixtures for a 15 amp circuit, I would guess the 8 lamps draw a total of 1200w or less, but in any case the NEC allows manufacturer instructions to override code in some cases as long as the product is listed. NEC 400.8 provides the locations that can't be used but if the outlet is visible (not concealed) it is legal .
It is easier to seek forgiveness than to seek permission! Codes vary with location. The important thing here is you are on the right track with wiring the outlets with #12 wire but does it include a ground wire? I never can keep that straight! If'n you have a white, black and a bare wire in your 12-2 then you are good. If'n you are gonna put up 8 lights or less you are good. Both have a comfortable safety factor. Should satisfy any reasonable code. Best you read the code yourself since many "code experts" are like General Aviation mechanics fresh out of A&P school: full of themselves!