Generate Receipt PDFs in Make.com

A receipt is not a small invoice. It is a different page size, a different typeface and a different set of lines, which is why shrinking an A4 invoice never looks right. This template renders an 80mm receipt from a Make scenario, the width a thermal printer expects.

600 free requests / month, no credit card

Document
Receipt
Platform
Make.com
Page size
80mm roll
Output
PDF, binary buffer

// live preview

An 80mm receipt, not a shrunken invoice

The page size is set to 80 by 160 millimetres, which is why the output looks like a till roll. Add lines to the JSON and the page grows with them.

// the workflow

Payment in, receipt out

Payment webhook
Stripe, SumUp, your till
CustomJS
HTML to PDF, 80mm
Email or storage
send to the customer

The scenario is short on purpose: the payment event already carries the lines, so the only work is rendering them. Set the page size on the module, otherwise the receipt is drawn on A4 with a lot of white space below it.

The page size that makes it a receipt

{
  "pdfWidthMm": 80,
  "pdfHeightMm": 160
}

// step by step

Build it yourself

  1. 1

    Connect the CustomJS app in Make

    Add the module to a scenario and create a connection with the API key from your workspace. The getting started page walks through it once, and every later scenario reuses the connection.

  2. 2

    Add the HTML to PDF module

    Pick the HTML to PDF module and paste the template. The monospace font and the dashed rules are plain CSS, so nothing has to be configured on the module itself.

  3. 3

    Set the width and height

    Set pdfWidthMm to 80. The height is a starting point, not a limit: a longer list of lines pushes the page out rather than being cut off.

  4. 4

    Map the payment lines

    Most payment providers send the basket as an array. Map it straight into the lines property and let the loop in the template draw the rows.

  5. 5

    Deliver or print it

    Email the file to the customer, or push it to a print service. Because it is a plain PDF at roll width, a thermal printer handles it without a driver specific layout.

// html template

The parts that make it look like a till receipt

Three choices do most of the work: a monospace font so the columns line up, dashed rules instead of borders, and a narrow page.

Width, font and rules

body {
  width: 80mm;
  padding: 6mm 5mm;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 9pt;
}
.rule { border: 0; border-top: 1px dashed #999; margin: 8px 0; }

The VAT split at the bottom

<tr><td class="muted">Net</td><td class="num">{{ net }}</td></tr>
<tr><td class="muted">VAT {{ vatRate }}%</td><td class="num">{{ vat }}</td></tr>
<tr class="grand"><td>Total {{ currency }}</td><td class="num">{{ total }}</td></tr>

Calculate the net and VAT figures in the scenario rather than in the template. A receipt that disagrees with the payment record by a cent is worse than one that is plain.

Questions about this template

Render your first receipt

Create a workspace, connect the API key in Make, and set the module to 80mm.