> ## Documentation Index
> Fetch the complete documentation index at: https://dev.puppetvendors.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Grouped Invoice by Vendor

> Consolidated invoice PDF for all orders from specific vendors within a date range

<Note>
  **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur.
</Note>

## Overview

Generate a consolidated invoice PDF covering all orders from specific vendors within a date range. Useful for monthly or weekly payout summaries. Vendor tokens are automatically scoped to themselves.

## Request Body

<ParamField body="vendorIds" type="array" required>
  Array of vendor ObjectIds.
</ParamField>

<ParamField body="startDate" type="string">
  Include orders from this date (ISO 8601).
</ParamField>

<ParamField body="endDate" type="string">
  Include orders until this date (ISO 8601).
</ParamField>

## Response

```json 200 theme={null}
{ "success": true, "data": { "pdfUrl": "https://cdn.puppetvendors.com/pdf/..." } }
```

## Example

```bash theme={null}
curl -X POST "https://staging-api.puppetvendors.com/orders/invoice/grouped" \
  -H "x-access-token: YOUR_VENDOR_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "vendorIds": ["507f1f77bcf86cd799439011"],
    "startDate": "2026-03-01T00:00:00Z",
    "endDate": "2026-03-31T23:59:59Z"
  }'
```
