# Batch generate invoices Generate invoices for multiple shipments in a single request. ## What happens - Creates invoice records for each shipment - Generates PDF documents - Optionally sends emails grouped by customer ## Note Shipments that already have invoices or are missing requirements will be skipped and returned in the failed array. Endpoint: POST /invoices/batch-generate Version: 1.0.0 Security: BearerAuth ## Request fields (application/json): - `orderIds` (array, required) Order IDs to generate invoices for - `sendEmail` (boolean) Email invoices to customers after generation - `emailConfig` (object) - `emailConfig.ccEmails` (array) - `emailConfig.groupByCustomer` (boolean) Group invoices by customer in emails ## Response 200 fields (application/json): - `generated` (array) - `generated.orderId` (string) - `generated.invoiceId` (string) - `generated.documentId` (string) - `failed` (array) - `failed.error` (string) - `emailsSent` (integer) ## Response 400 fields (application/json): - `error` (string, required) Error code - `message` (string, required) Human-readable error message ## Response 401 fields (application/json): - `error` (string, required) Error code - `message` (string, required) Human-readable error message