HTML to PDF to Printnode

Webhook

To use this webhook and print PDF's you need Printnode and setup Warehouses, Packingtables, Printertypes.

This example creates a pickup document payload in HTML  converts it's HTML to PDF and prints the PDF on a Printnode connected printer.

Method: Post

URL: https://api.clougistic.com/eu/version/print

Events: 

warehouse.shipment.saved

warehouse.shipment.label.print

Headers:

AWS-S3-Bucket: clougistic.printnode

AWS-S3-Meta-PrinterId: {{ $getCurrentUser().getSelectedPackingtable().getPrinterForTypeName("A4").metadata }}

AWS-S3-Meta-Apikey: Your Printnode APIkey

AWS-S3-Meta-NumberOfCopies: 1

Paper-Size: A4

Paper-Orientation: Portrait

Paper-Height: 310mm

Paper-Width: 280mm

Content-Type: text/html


Payload:

<!DOCTYPE HTML><HTML><BODY><h1>{{ $entity.getCompany("company") }} Shipment Pickup : {{$id}}</h1><h2>Order Reference : {{$order.reference}}</h2><hr><p style="color:red">CHECK PAYMENT STATE</p><hr><h2>To:</br>{{ $order.shipping_company }}</br>{{ $order.shipping_firstname }} {{ $order.shipping_lastname }}</br>{{ $order.shipping_street }} {{ $order.shipping_housenumber }} {{ $order.shipping_housenumber_ext }}</br>{{ $order.shipping_postcode }} {{ $order.shipping_city }} {{ $order.shipping_country }}</br></h2><hr><table style="border: 1px solid #999;" width="100%">                <tr>                    <th align="left">SKU</th>                    <th align="left">Product Description</th>                    <th align="right">Qty</th>                </tr>                {{for $item in $items}}                <tr>                    <td align="left" bgcolor="#ffffff">{{ $item.sku }}</td>                    <td align="left" bgcolor="#ffffff">{{ $item.description }}</td>                    <td align="right" bgcolor="#ffffff">{{ $item.qty }}</td>                </tr>                {{next item}}</table></BODY>

Filter:

$order.shipping_method == "pickup"