If you can read German,
good info here.
It's more to do with the use than the purchase - but check with your local council.
Basically for the Average Joe, only two categories of fireworks can be used from January 2nd - 30th December each year: Class I (sparklers, small Catherine Wheels) and T1 (technical purpose fireworks with certain limitations as marked on the packaging).
Only on December 31st from 6pm until January 1st at 1am each year is it allowed to let off fireworks to celebrate New Year (stuff like rockets, bangers, fountains, battery fires...), whether on private grounds or not unless done so by a licenced pryotechnic specialist.
Should there be a big specific party (e.g. golden wedding anniversary, big birthday etc.), a private individual can get a permit from the local applicable council (exception to § 24(1) of 1. SprengV). Costs vary, must be applied for in advance and you need this document to buy fireworks for use outside of the New Year period.
Using imported bangers etc can incur a criminal prosecution, not just a civil one.
So get a permit if you need one.