Please define “doesn’t last long” in quantifiable terms - such as ten hours when browsing, seven hours when watching streamed video etc.
Be aware that if purchased directly from Apple, you have 14-days within which to unconditional return the iPad for exchange or refund. If you have any concerns at all, you would be well advised to make use of this opportunity while it remains available to you. Upon expiry of 14-days, Apple reserve the right to offer replacement for a reconditioned/renewed iPad of the same model and specification - although, depending upon your region/country, you may have additional statutory rights of remedy.
If contacted, Apple Support can perform remote diagnostics for your iPad. Similarly, the Genius Bar at your local Apple Store or Apple Authorised Service Provider (AASP) can also perform hands-on testing. That said, the reiterate my earlier comment, if you have any concerns at all - unconditional exchange is the better option while you remain able to do so.
You can contact the Support Team using the Support link at top-right or bottom-left of this page. Alternatively and perhaps easier, you can initiate and manage your support cases using the excellent Apple Support App. If not already installed on your iPad, the App can be downloaded from the App Store:
https://apps.apple.com/gb/app/apple-support/id1130498044
If visiting the Genius Bar at your local Apple Store or Apple Authorised Service Provider (AASP) an appointment is recommended:
Genius Bar Reservation and Apple Support Options - Apple