---
title: "Preview Invoice Pdf"
method: POST
path: "/api/v1/invoices/preview-pdf"
tags: ["invoices", "invoices"]
---

# Preview Invoice Pdf

`POST /api/v1/invoices/preview-pdf`

## Request

- Base URL: `https://api.peil.app` (the document declares no server; this is the origin it was published from)
- URL: `https://api.peil.app/api/v1/invoices/preview-pdf`
- Auth: OAuth 2 (password, token URL `/api/v1/auth/jwt/login`)

Render a PDF from unsaved form data — for live split-pane preview.

## Request body

- InvoicePreviewRequest: Form data for live PDF preview — unsaved, client may be unresolved.
  - `invoice_number` string
  - `client_id` integer, nullable
  - `client_name` string, nullable
  - `client_address` string, nullable
  - `invoice_date` string, date, nullable
  - `period_start` string, date, nullable
  - `period_end` string, date, nullable
  - `due_date` string, date, nullable
  - `subtotal` number
  - `vat_rate` number, nullable
  - `vat_amount` number, nullable
  - `total_amount` number, nullable
  - `total_hours` number
  - `reverse_charge` boolean, nullable
  - `notes` string, nullable
  - `payment_reference` string, nullable
  - `template_fields` object, nullable
  - `lines` PreviewLineItem[]
    - `description` string
    - `hours` number, nullable
    - `rate` number, nullable
    - `amount` number, nullable
    - `sort_order` integer

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/peil/apis/peil-api.md) · [All operations](https://skmtc.dev/peil/apis/peil-api/llms.txt) · [OpenAPI document](https://skmtc.dev/peil/apis/peil-api/revisions/ee3ca1246dde?raw)
