Back to Blog
System Integration November 14, 2026 7 min read

Automating Bills of Lading & Commercial Invoices from Node.js, ERP & WMS Webhooks

Step-by-step guide to connecting your Warehouse Management System (WMS), Shopify fulfillment webhook, or billing queue to Open Layout with zero storage.

Binding Logistics & Order Arrays to Repeating Tables

Freight manifests, packing slips, and commercial invoices routinely overflow onto 2–10 pages when shipments include dozens of SKUs or HS tariff lines.

Set arrayDataPath on your table element to "items" and toggle repeatHeader: true. Open Layout’s Typst engine automatically expands the table, repeats headers across page breaks, and pushes totals & signature blocks downward without overlap.

Node.js Worker Queue Example (BullMQ / Express Webhook)

Call POST /api/v1/templates/:id/render inside your fulfillment webhook handler and pipe the returned binary PDF straight to S3, email attachment, or thermal zebra printer queue.

fulfillment-webhook.ts
export async function generateShipmentBol(shipmentPayload: any) {
  const response = await fetch(
    `https://openlayout.dev/api/v1/templates/${process.env.BOL_TEMPLATE_ID}/render`,
    {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${process.env.OPENLAYOUT_API_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        format: 'pdf',
        data: {
          bol: { number: shipmentPayload.bolNumber, proNumber: shipmentPayload.pro },
          shipper: shipmentPayload.origin,
          consignee: shipmentPayload.destination,
          items: shipmentPayload.commodities,
        },
      }),
    }
  );

  if (!response.ok) {
    throw new Error(`Render failed (${response.status}): ${await response.text()}`);
  }

  return Buffer.from(await response.arrayBuffer());
}

More guides from Open Layout