Usual format for Ahrefs invoice URL is https://sites.fastspring.com/ahrefs/order/invoice/AHR170558-6947-36115B.
You can easily transform it into pdf by adding /pdf at the end of your invoice URL:
Please, mind that /pdf should be added to an invoice URL without any additional parameters, so if it shows up as https://sites.fastspring.com/ahrefs/order/invoice/AHR170935-9867-32591B?_ga=2.3792496.119599640.150758280-1238830524.1497862705, remove the part that comes after order ID:
P.S. Examples of order IDs are taken for demonstration purposes and do not pick up any live orders.