If it’s the latest iPad, that’s the 8th generation.
When your purchase is registered through Apple the Apple online store will let you know if any accessories are compatible with your device.
Heres an example of the Magic Keyboard for my iPad Pro.
View attachment 91137