How to request a PDF:
There are two ways we can render the invoice as PDF, we can either pass this as a header or in the URL:
Header: Accept: Application/PDF
or
URL request:?format=pdf
We need to tell the API we want to access the pdf format, this can be achieved in two different ways, you can pass an additional HEADERAccept: 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.
Supported method: GET
Supported Layouts: Item, Service, TimeBilling and Professional layout types. The miscellaneous order type does not have printing capabilities in AccountRight Live.
NOT Supported:/Sale/Order/{uid}, Sale/Invoice or Purchase/Order, /Purchase/Bill/{uid}
is not supported because a template can only be uniquely identified using the order layout type.
Default and custom form templates
A template parametertemplatename=
can be passed to explicitly tell the API which custom form to render the order with i.e.templatename=Pre-Printed Invoice
. This is not mandatory to include as the sale layout and printed form set on the customer contact card will default instead.
If the customer contact card does not contain a default sale layout and printed form, the template will default to the standard AccountRight Live Plain Paper Invoice for the layout type the sale belongs to.
Updated: To retrieve a list of sale custom form templates (AccountRight) please refer to the /Company/FormTemplate endpoint documented here
Each sale layout type has its own specific set of templates and forms that are unique to it, therefore if you create a custom form template for a layout type of item, you cannot use this to print or render a service or professional sale, only item.
Sales:
HTTP GETis the only supported method, to make a request your URL should look like{cf_uri}/Sale/Invoice/{type}/{uid}/?format=pdf&templatename=Pre-Printed Invoice
Purchase:
HTTP GETis 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
If you have any questions, feel to log a ticket with the Customisation & Integration Team.
Comments
0 comments
Article is closed for comments.