---
title: "Generate Invoice PDF"
method: POST
path: "/invoices/{id}/generate_pdf"
tags: ["Invoices"]
---

# Generate Invoice PDF

`POST /invoices/{id}/generate_pdf`

## Request

- Base URL: `https://api.whop.com/api/v1`
- URL: `https://api.whop.com/api/v1/invoices/{id}/generate_pdf`
- Auth: HTTP bearer

Generates the invoice as a PDF and returns a short-lived link to download it. A draft shows its estimated totals. The buyer's name and email need `member:basic:read` and `member:email:read`, and the Pay now link on an open invoice needs `payment:charge`, or `invoice:create` or `invoice:update` when it has no `payment_method_id`. Each call generates a new file and link, so this endpoint does not replay `Idempotency-Key` responses.

## Headers

- `Idempotency-Key` string

## Response `200`

invoice PDF generated

- InvoicePdf
  - `expires_at` string, required: When the link stops working, as an ISO 8601 timestamp. Generate a new PDF for a fresh link.
  - `url` string, required: A short-lived link to download the invoice as a PDF. Anyone holding the link can download the file until it expires.

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Resource not found
- `409`: Conflict

## Changes

> 203 revisions in range; 1 not diffed.

- **2026-10-26** `9b1e53f04d60`: 2 info
  - the security scope `payment:basic:read` was added to the endpoint's security scheme `bearerAuth`
  - the security scope `invoice:basic:read` was removed from the endpoint's security scheme `bearerAuth`
- **2026-10-26** `15f001536d97`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/whop/apis/whop-api/changes/invoices/:id/generate_pdf/post.md)

---

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