Skip to main content
All posts
payroll payslips HR templates PDF API

Payslip PDF Generator API: Payslips, Offers and ID Cards

Generate payslip PDFs from payroll JSON with gross and net pay calculated, plus job offer letters and employee ID cards with photos and barcodes.

PodPDF Team September 18, 2026 6 min read

HR documents are produced in batches and read one person at a time. Payroll runs every month and every employee needs their own payslip; every new hire needs an offer letter; every new starter needs an ID card on day one. The data already lives in your payroll or HR system — what’s missing is a clean, consistent document for each person.

PodPDF has three HR templates in Templates → Template library → HR & payroll. Each one takes a JSON record and returns a finished PDF.

A payslip generated from the PodPDF template

Payslips

The payslip template shows the employer, the employee’s details (ID, job title, tax code, National Insurance or social security number), an Earnings table, a Deductions table, year-to-date figures and a summary with Gross pay, Total deductions and Net pay.

curl -X POST https://api.podpdf.com/templates/YOUR_TEMPLATE_ID/render \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -o payslip-E-10442-2026-09.pdf \
  -d '{
    "data": {
      "employer": { "name": "Kestrel Logistics Ltd", "address": "Unit 9, Meridian Business Park\nBristol BS16 7FL" },
      "employee": { "name": "Daniel Hughes", "id": "E-10442", "role": "Warehouse Supervisor", "tax_code": "1257L", "ni_number": "QQ 12 34 56 C" },
      "pay_date": "2026-09-25",
      "period": "September 2026",
      "earnings": [
        { "description": "Basic salary", "amount": 2750 },
        { "description": "Overtime", "hours": 8, "rate": 24.5, "amount": 196 },
        { "description": "Night shift allowance", "amount": 120 }
      ],
      "deductions": [
        { "description": "Income tax (PAYE)", "amount": 404.4 },
        { "description": "National Insurance", "amount": 161.76 },
        { "description": "Pension (5%)", "amount": 153.3 }
      ],
      "total_deductions": 719.46,
      "ytd_gross": 18396,
      "ytd_tax": 2426.4,
      "payment_method": "Bank ••••4417"
    }
  }'

What’s Calculated and What You Send

  • Gross pay is the sum of the amount values in earnings, calculated by the template.
  • Total deductions is the total_deductions value you send, and Net pay is gross pay minus that.
  • Every amount is rounded to the currency’s smallest unit and formatted for the template’s language.

Your payroll system has already done the tax calculations — the template presents them, it doesn’t compute tax. Sending total_deductions alongside the itemised list means the payslip always matches your payroll figures to the penny.

The starter is set to British English and pounds sterling. For another country, open Page & style and change the language and currency — en-US and USD, de-DE and EUR, en-IN and INR — and rename labels such as “NI number” to your local equivalent, for example “SSN” or “PAN”.

Payroll Day

Render one payslip per employee from your payroll export:

import os, requests

for employee in payroll_run:            # rows from your payroll system
    r = requests.post(
        f"https://api.podpdf.com/templates/{TEMPLATE_ID}/render",
        headers={"X-API-Key": os.environ["PODPDF_API_KEY"]},
        json={"data": employee, "filename": f"payslip-{employee['employee']['id']}.pdf"},
    )
    r.raise_for_status()
    open(f"payslips/{employee['employee']['id']}.pdf", "wb").write(r.content)

If a record is missing a required field — a pay date, an employee name, an earnings line — that payslip is rejected with the exact field (for example earnings[2].amount is required) and isn’t charged, while the rest of the run carries on. Already have one big PDF of payslips from another system? Split it into one file per person instead.

Job Offer Letters

A job offer letter

The offer letter is a proper letter: company letterhead, the candidate’s address, a subject line, the key terms in a clear list, a benefits paragraph, and two signature lines — one for the company, one for the candidate to accept.

FieldExample
candidate.name, candidate.addressMei Lin, 81 Oak Hollow Lane…
position, department, managerSenior Data Engineer, Platform, Dr. Helen Park
start_date2026-10-19 → October 19, 2026
salary142000 → $142,000.00 per year
employment_type, locationFull-time, permanent · Austin office, hybrid
benefitsMedical, dental and vision cover · 401(k)…
respond_by2026-09-30
signatory.name, signatory.titleCarlos Mendes, Head of People

Generate it from your applicant tracking system when an offer is approved, then send it for e-signature or attach it to the offer email. Edit the wording in the builder — probation period, notice period, conditions — without touching your integration.

Employee ID Cards

An employee ID card with photo and barcode

The ID card is credit-card size (85.6 × 54 mm, the CR80 size card printers use) with the company name, the employee’s photo, name, job title, department, a valid-until date and a Code 128 barcode of the employee ID for door readers, canteens and time clocks.

The photo comes from photo_url:

  • an https URL to the photo in your HR system — PodPDF downloads it when rendering (PNG or JPEG, up to 2 MB), or
  • a data URI (data:image/jpeg;base64,…) if the photo isn’t online

Private and local network addresses are refused, so a mistyped internal URL gives a clear error instead of a blank card.

Use Cases

  • Monthly payroll: payslips for every employee, emailed or uploaded to an employee portal
  • Contractors and shift workers: weekly pay statements with hours × rate lines in the earnings table
  • Recruitment: offer letters generated when an offer is approved, with the terms from your ATS
  • Onboarding: an ID card PDF for every new starter, sent to the card printer
  • Year-end: summary statements using the year-to-date fields
  • Payroll bureaus: one template per client, each with its own logo, colours and currency

Privacy

Payslips are personal data. By default the PDF comes back in the API response and isn’t stored. If you add "store": true to get a download link instead, the link expires after 1 hour and generated files are deleted after 30 days.

Pricing

Each payslip, letter or card is one PDF at $0.01. A payroll run for 200 employees costs $2.00, and a monthly plan covers regular runs.

Get Started

payroll payslips HR templates PDF API
Back to blog

PodPDF is built by XAD Labs, which builds custom PDF processing pipelines at scale.

Start generating PDFs today

$0.01 per PDF — from credit packs that never expire.