Digital products (buy once) and services (subscriptions) will be listed for the Apple ID account that was used.
View your purchase history for the App Store and other Apple media services - Apple Support
For my account, I can scroll back far more than 2 years.
Additionally, active subscriptions and their current pricing will be listed in the subscriptions overview for a given Apple ID account.
See your subscriptions overview - Apple
Hardware is a bit more spread out. Online purchases through the apple.com website will be listed for 18 months, through the shopping bag icon in the upper right corner of any web page on apple.com. Then navigate to Orders. Again, specific for the Apple ID account with which you signed in.