Create your first template
Start from a ready-made invoice, packing slip, product data sheet, customer summary or a blank page, in the visual builder or in code, make it yours and save it.
A template is the design of one kind of document. This walkthrough creates one from a ready-made starting point, checks it against a real order and saves it, so a Flow workflow can use it.
Step 1: Pick a starting point
Open Templates and select Create template. The New template page asks for an optional Name, the Editor you want to work in and the ready-made template to start from.
Under Editor, pick the Visual builder (arrange ready-made blocks such as a header, addresses, line items and totals, no code needed) or Code (HTML, CSS and Liquid by hand). Both start from the very same page: the Code version of every ready-made template is generated from its Visual builder version, so the thumbnails do not change when you switch, and the PDFs are identical.
The ready-made templates are listed under Start from a template. Select Use this template on the one you want.
| Template | Renders | What it contains |
|---|---|---|
| Invoice | An order | Line items, taxes and totals of an order |
| Packing slip | An order | What to pack and where it goes, without prices |
| Product data sheet | A product | Description, options and every variant with SKU and price |
| Customer summary | A customer | Contact details, totals and the most recent orders of a customer |
| Blank | Your choice: an order, a product or a customer | A page with only a header, to start from scratch |
The template is created at once and the editor opens. If you left the name empty and a template with the starter's name already exists, the new one gets a number, for example Invoice 2.
Step 2: Look at it with your own data
The right half of the editor is the Preview. It shows the template with your latest order, product or customer, depending on what the template renders. On a store without any, it shows sample data.
Use Preview with to switch to a specific order, product or customer, and Preview PDF to open the real PDF. See The template editor.
Step 3: Make it yours
The ready-made templates already use your branding. Before you change anything, open Settings in the app navigation and add your logo, colors, fonts and company details. They appear in the preview of every template. See Branding your documents.
Then adjust the template itself. In the Code editor:
- HTML - the content. Change texts, add or remove columns, print more fields. See Template variables and Liquid.
- CSS - the look: sizes, spacing, table lines.
- Branding - colors and fonts for this template only.
- Settings - name, file name, paper size, margin and more. See Paper size, margins and file name.
In the Visual builder, select a block in the page to change it, and use Add block in the panel to add one.
Step 4: Name it and save
On the Settings tab, check the Name. The Generate document action in Shopify Flow finds the template by this exact name, so choose a name you will not need to change later.
Select Save in the bar at the top. A template is only saved when it renders: if the Liquid has an error, the save is refused and the error is shown with its line, so a broken template never reaches a workflow.
Start from scratch
Pick Blank for a page with only a header. On its card, choose what the template renders: an order, a product or a customer. The thumbnail, the header and the file name follow your choice, and the variables of that resource apply in the editor. In the Code editor you can still change Renders on the Settings tab later; a Visual builder template keeps what it renders.
Create a document right away
You do not need a workflow to get a PDF out of a template: Create document at the top of the editor makes one for your latest order, product or customer, a specific one, or with sample data, and downloads it. See Document history and downloads.
Turn a template off
Clear Template is live on the Settings tab to stop a template without deleting it. While it is off, Flow and the API refuse to generate documents with it.
Deleting a template is permanent. Workflows and API calls that name it stop working, and the documents it generated stay in the history.
Next steps
- The template editor - the editor in detail.
- Set up the Generate document action in Shopify Flow - generate the document from a workflow.
- Templates in several languages - add a second language to the template.
