The 2017 MBP is considered vintage by Apple.
- Vintage: Apple considers a product to be vintage when the company stopped selling it more than 5 and less than 7 years ago. During this 2-year window, Apple says that service and parts may be obtained, subject to parts availability.
So, Apple may or may not be able to replace the battery. If they do, it will be an Apple sourced battery and carry an Apple warranty, whatever that may be.
You can make a Genius Bar appointment for hardware/software service and support using this link:
Contact Apple for support and service - Apple Support
Get your Mac repaired and see how much will it cost:
Mac Repair & Service - Apple Support
Call Customer Support (800) MY–APPLE (800–692–7753)
or on line https://getsupport.apple.com/
or call AppleCare Support at 1-800-APLCARE (800-275-2273)
If Apple or an Apple Authorized Service Provider cannot provide an Apple branded replacement party, there are third-party batteries available, which likely aren’t as robust as the real deal. You might check the offerings here at macsales: https://eshop.macsales.com/shop/laptop-batteries/macbook-pro