---
title: "Bulk generate PDFs"
description: "Queue a bulk PDF generation job for a set of invoice IDs. Returns a bulk action ID to track progress. Maximum 5,000 invoices per request."
url: https://docs.invoicefalcon.com/api/documents/bulk-generate-pdfs/
api: "API v1 reference"
method: POST
path: "/invoices/bulk_pdf"
---

# Bulk generate PDFs

`POST https://app.invoicefalcon.com/api/v1/external/invoices/bulk_pdf`

Queue a bulk PDF generation job for a set of invoice IDs. Returns a bulk action ID to track progress. Maximum 5,000 invoices per request.

## Request body

- `invoice_ids` (array of integers, required): Array of invoice IDs to generate PDFs for.
- `template_name` (string): Template name to use.

## Returns

- `bulk_action` (object)
  - `id` (integer): e.g. `2087`
  - `status` (string): e.g. `pending`
  - `total_count` (integer): e.g. `3`

Rate limit: this call costs 2 points ([rate limits](https://docs.invoicefalcon.com/docs/rate-limiting/)).

## Examples

### PDFs for chosen invoices

```sh
curl -X POST "https://app.invoicefalcon.com/api/v1/external/invoices/bulk_pdf" \
  -H "X-Auth-Token: $INVOICE_FALCON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "invoice_ids": [
      48213,
      48190,
      48177
    ]
  }'
```

### PDFs with a named template

```sh
curl -X POST "https://app.invoicefalcon.com/api/v1/external/invoices/bulk_pdf" \
  -H "X-Auth-Token: $INVOICE_FALCON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "invoice_ids": [
      48213,
      48190
    ],
    "template_name": "Wholesale invoice"
  }'
```

## 202

Bulk action queued.

```json
{
  "bulk_action": {
    "id": 2087,
    "status": "pending",
    "total_count": 3
  }
}
```

## 401

Missing or invalid API key.

```json
{
  "error": "Invalid API key"
}
```

## 403

The store is not on a paid plan. API access requires a paid Invoice Falcon plan.

```json
{
  "error": "REST API access requires a paid plan"
}
```

## 422

Request could not be processed.

```json
{
  "error": "param is missing or the value is empty: customer",
  "errors": {}
}
```

## 429

A bulk action is already in progress for the store, or the rate limit was exceeded.

```json
{
  "error": "A bulk action is already in progress"
}
```

