Render sale orders as PDF

Retrieving sale orders in PDF format

Date Released: Oct 2014 Date Updated: Nov 2020
Supported from AccountRight Only (Cloud API only)

Retrieve sale orders in PDF format, customers using your application can now use the same Invoice PDF in AccountRight Live. Templates can either be custom designed or default ones held inside AccountRight Live. What are custom forms?

PDF Format

How to request a PDF

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}/Sale/Order/{type}/{uid}/?format=pdf&templatename=Pre-Printed Invoice

For information on templates and the templatename keyword click below.

{type} is defined as either Item, Service or Professional.
{uid} is defined as the order unique identifier in the form of a guid.

Sale order types

Which sale order types are supported?

Rendering sale orders into pdf format can be processed for the Item, Service, TimeBilling and Professional layout types. The miscellaneous order type does not have printing capabilities in AccountRight Live.

Please note: /Sale/Order/{uid} is not supported because a template can only be uniquely identified using the order layout type.

{uid} is defined as the order unique identifier in the form of a guid.

Template forms

Default and custom form templates

A template parameter templatename= 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 2014.3 cloud, Desktop 2014.4) please refer to the new /Company/FormTemplate endpoint documented here

Each sale layout 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 layout type of item, you cannot use this to print or render a service or professional sale, only item.

Note: custom form template names are not case sensitive when passing through.