In this tutorial, we will show you how to generate a dynamic PDF e-commerce invoice using PDF.co Web API.
Step 1: Open PDF.co Account
- To begin. Let’s start by logging into your PDF.co account and clicking on the Request Tester menu.
Step 2: Requester Tester Page
- For the Choose PDF.co API endpoint, search and select
/pdf/convert/from/html(json input)
. This endpoint scale and automates PDF generation using an HTML template. - In the templateId param, enter the ID of your HTML template. You can create an HTML template ID at this link.
- In the name param, type in your desired PDF file name.
- For the templateData param, input the JSON data.
Template Data
{\"company_address\": \"1234 Market St\\nSan Francisco, California 94102\\nUSA\",\"order_id\": \"1122455\",\"order_date\": \"15 Jan 2022\",\"customer_id\": \"T8001\",\"shipped_date\": \"20 Jan 2022\",\"shipped_via\": \"UPS\",\"bill_to_name\": \"John Doe\",\"bill_to_address\": \"435 South La Fayette Park Place, \\nLos Angeles, CA 90057\\nUSA\",\"ship_to_name\": \"Jean Doe\",\"ship_to_address\": \"18144 El Camino Real\\nSunnyvale, California\\nUSA\",\"freight\": 19.95,\"notes\": \"Thank you for your purchase.\",\"items\": [ { \"name\": \"T-800 Product 1\", \"price\": 50.0, \"quantity\": 2 }, { \"name\": \"T-800 Product 2\", \"price\": 150.0, \"quantity\": 3 }, { \"name\": \"T-800 Product 3\", \"price\": 20.0, \"quantity\": 1 }, { \"name\": \"T-800 Product 4\", \"price\": 24.99, \"quantity\": 5 }, { \"name\": \"T-800 Product 5\", \"price\": 199.0, \"quantity\": 1 }, { \"name\": \"T-800 Product 6\", \"price\": 19.0, \"quantity\": 5 }, { \"name\": \"T-800 Product 7\", \"price\": 20.0, \"quantity\": 1 }, { \"name\": \"T-800 Product 8\", \"price\": 49.0, \"quantity\": 5 }, { \"name\": \"T-800 Product 9\", \"price\": 1000.0, \"quantity\": 1 }, { \"name\": \"T-800 Product 10\", \"price\": 30.0, \"quantity\": 5 }, { \"name\": \"T-800 Product 11\", \"price\": 10.0, \"quantity\": 1 }, { \"name\": \"T-800 Product 12\", \"price\": 30.0, \"quantity\": 5 }, { \"name\": \"T-800 Product 1\", \"price\": 12.0, \"quantity\": 1 }, { \"name\": \"T-800 Product 14\", \"price\": 25.0, \"quantity\": 5 }, { \"name\": \"T-800 Product 15\", \"price\": 24.99, \"quantity\": 1 }, { \"name\": \"T-800 Product 16\", \"price\": 30.0, \"quantity\": 5 }, { \"name\": \"T-800 Product 17\", \"price\": 12.0, \"quantity\": 1 }, { \"name\": \"T-800 Product 18\", \"price\": 25.0, \"quantity\": 5 }, { \"name\": \"T-800 Product 19\", \"price\": 24.99, \"quantity\": 1 }, { \"name\": \"T-800 Product 20\", \"price\": 30.0, \"quantity\": 5 }]\r\n}
Once you are done adding the JSON data, click on the Run Request button to see the result.
Step 3: Run Request Result
- Great! The request runs successfully, click the resulting URL to view the output or directly download the output file.
Step 4: Generated Dynamic PDF
- Here’s what the generated Dynamic PDF e-commerce invoice looks like

In this tutorial, you learned how to generate dynamic PDF e-commerce invoices using PDF.co Web API. You also learned how to create an HTML template ID.
Similar Pages
- How to Create Invoices
- How to Create a Perfect Invoice with PDF and HTML Templates
- Create PDF Invoice From Google Sheet using PDF.co and Apps Script
- How to Generate Invoice Online and Sign with PDF.co
- How to Create PDF Invoice using PDF and HTML Templates in C#
- Create PDF Invoice using HTML Templates in JavaScript
- How to Generate Dynamic PDF E-commerce Invoice
- How to Generate Invoice with Barcode using HTML to PDF and Barcode Generator in PDF.co
- Make PDF Invoice by Adding Text and Images to PDF Template using PDF.co and Zapier
- Generate PDF Invoice from Invoice Template using PDF.co API (Template Sample 1)
- Generate PDF Invoice from Scratch using PDF.co API (Template Sample 2)
- Generate PDF Invoice from Invoice Template using PDF.co API (Template Sample 3)
- How to Create Invoice With/Without Discount
- How to Create Invoice With/Without Logo
- Create QuickBooks Online Invoices from Parsed PDF Data using PDF.co and Zapier
- Create QuickBooks Online Invoices from Parsed PDF Data using PDF.co and Integromat