Link

How to generate invoices in PDF format?

To generate and download invoices in PDF format, one needs to enable invoicing in Settings > Invoices & Taxes and upload HTML template in Liquid syntax.

Invoice Template Variables

Name Description
user_name Name of the user in accesstype who purchased the subscription
invoice_number The sequence of invoice number for that account. Example: publisher_name/1, publiser_name/2
user_email Email of the user in accesstype who purchased the subscription
user_phone_number Phone number of the user in accesstype who purchased the subscription
date Date of purchase of subscription. Example: 11 Dec 2018
payment_method Payment gateway used by the purchaser. Example: razorpay, simpl, paytm
recurring true if it’s a recurring subscription, false if it’s a one time payment
base_price Basic price is the amount receivable by the publisher from the user for the purchase of subscription minus any tax on the product.For example if 110 is the price paid by the user and 10 % if the tax specified by the admin. The base price is calculated by the following formula (110/(1+10/100)), which equals 100
subscription_group_title The subscription group name, the subscription plan belongs to
subscription_plan_title The subscription plan name, for which the user purchases a subscription
subscription_plan_price The price of the subscription plan, specified by the admin without any discount applied
amount_paid The amount received from the user. If the user applies a discount, discount is applied on the plan amount.
discount_details It’s a hash with following fields code - which represents the discount code applied by the user discount_percentage - which represents the percentage of discount applied discount_amount - which represents the amount of the discount Example: {“code” => “UAT”,”discount_percentage” => 20,”discount_amount” => “77.97”}
taxes It’s a hash with tax objects. If multiple taxes are specified by the admin, multiple tax objects will be present in this object {“SGST” => {“percentage” => “9.0”,”amount” => “28.07”,”currency” => “INR”}, “CGST” => {“percentage” => “9.0”,”amount” => “28.07”,”currency” => “INR”} }
subscription_end_date Represents the end date of the subscription
dynamic_assets This is applicable for pay per asset type of subscriptions. Suppose if user purchases a storytitle, slug will be available in this field Example: [{id: “some_asset_id”, title: “Some title”, slug: “/some-slug”}]
amount_after_discount_before_tax This amount is arrived at, when discount is applied on the base price and does not include the tax amounts.
round_off The amount that was rounded off in calculating the amount paid by the subscriber from the calculated base price, price after discount and taxes. Unit: Rupee for INR and dollar for USD.
benefit_product This is the title of the befefit product that is added to referree, because he/she used a coupon code which has discount type unit
notes If there are any notes made during the subscription creation

The above format considers the price inclusive of taxes.

To download invoice, downloadInvoice method can be used.

If you not using AccesstypeJS(not recommended), you could use API.