Retrieving purchase bills in PDF format
Retrieve purchase bills in PDF format, customers using your application can now use the same Purchase Orders PDF in AccountRight Live. Templates can either be custom designed or default ones held inside AccountRight Live. What are custom forms?
Firstly we need to tell the API we want to access the pdf format, this can be achieved two different ways, you can pass an additional HEADER Accept: Application/PDF
or explicitly tell the API to return the PDF format at the end of your URL request ?format=pdf
You only need to use one of these methods to complete successful requests.
HTTP GET is the only supported method, to make a request your URL should look like {cf_uri}/Purchase/Bill/{type}/{uid}/?format=pdf&templatename=Pre-Printed P.O.&title=PO_0001
Rendering purchase bills into pdf format can be processed for the Item, Service and Professional layout types. The miscellaneous bill type does not have printing capabilities in AccountRight Live.
Please note: /Purchase/Bill/{uid}
is not supported because a template can only be uniquely identified using the purchase bill layout type.
A template parameter templatename=
can be passed to explicitly tell the API which custom form to render the bill with i.e. templatename=Pre-Printed P.O.
. This is not mandatory to include as the purchase layout and printed form set on the supplier contact card will default instead.
If the supplier contact card does not contain a default purchase layout and printed form, the template will default to the standard AccountRight Live Plain Paper P.O. for the layout type the purchase belongs to.
Updated: To retrieve a list of purchase custom form templates (AccountRight 2014.4 cloud and desktop only) please refer to the new /Company/FormTemplate endpoint documented hereEach purchase type has it's own specific set of templates and forms that are unique to it, therefore if you create a custom form template for a purchase layout type of item, you cannot use this to print or render a service or professional purchase, only item.
Note: custom form template names are not case sensitive when passing through.