If you already tried (to no avail) all the steps provided in this support article:--> Fix issues with charging - Apple Support , it may be a hardware (Charging port? Battery? Other internal component?) failure but we, just users like you, cannot diagnose that issue remotely, sorry.
I suggest that you make an appointment (*) and have your device inspected at an Apple Store or AASP (Apple Authorized Service Provider) among this list:--> https://locate.apple.com/choose-country-region . After checking it out, they'll give you all the available options.
Regards
Giulio
(*) You can do it: