---
title: "Generate Invoices"
method: POST
path: "/api/invoices/generate"
tags: ["invoices"]
---

# Generate Invoices

`POST /api/invoices/generate`

Generate one or multiple invoices.

## Request body

- GenerateInvoicesRequest — Request to generate one or many invoices.
  - `payment_id` string, nullable — Single payment id
  - `payment_ids` string[], nullable — Multiple payment ids

## Response `200`

Successful Response

- GenerateInvoicesResponse — Response for invoice generation endpoints.
  - `success` boolean, required — Operation result
  - `message` string, required — Human-readable summary
  - `results` InvoiceGenerationItemResponse[] — Per-payment generation outcomes
    - `payment_id` string, required — Payment id
    - `success` boolean, required — Operation result for this payment
    - `message` string, required — Human-readable result message
    - `error` string, nullable — Error message (if failed)
    - `receiptUrl` string, nullable — Receipt URL (if generated)
    - `sts_response` string, nullable — Raw STS response text (if available)
    - `sts` object, nullable — STS metadata payload (if available)
  - `summary` InvoiceGenerationSummaryResponse — Summary for batch invoice generation.
    - `total` integer, required — Total payments processed
    - `success` integer, required — Successful payments count
    - `errors` integer, required — Failed payments count

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/corabea/apis/corabea-api.md) · [All operations](https://skmtc.dev/corabea/apis/corabea-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/corabea/corabea-api/revisions/13c1bce1bdc4/schema)
