# Generate/Send Customer Statement

Generates and optionally sends a customer statement

Endpoint: POST /statements/{tenantId}/generate
Version: v1-2025-04-18
Security: knox-authorizer

## Security:

  - `knox-authorizer` (unknown)
    http bearer JWT

## Path parameters:

  - `tenantId` (string, required)
    The id of the tenant being accessed

## Request body:

  - `application/json` (unknown)
    The domain_name to use to for record lookup

## Request fields (application/json):

  - `business_unit_ids` (array, required)

  - `business_unit_restriction` (string)
    Determines if/how to restrict the type of invoices to
    Enum: "exclude", "include", "none"

  - `contact_id` (string, required)

  - `customer_type` (string, required)
    Enum: "contact", "organization"

  - `email_address` (string)
    Email address to send statement, if is on file

  - `email_statement` (boolean, required)

  - `invoice_type_restriction` (string)
    Enum: "exclude", "include", "none"

  - `invoice_types` (array)

  - `organization_id` (string, required)

  - `override_statement_template` (string)
    If set, a specific template is used

  - `save_statement_on_customer_record` (boolean, required)

  - `statement_template_id` (string)
    Template to use, if not the default

## Response 200:

  - `200` (unknown)
    The invoice was downloaded successfully

## Response 200 headers (application/json):

  - `Access-Control-Allow-Headers` (string)

  - `Access-Control-Allow-Methods` (string)

  - `Access-Control-Allow-Origin` (string)

## Response 400:

  - `400` (unknown)
    The request was not valid.

## Response 400 headers:

  - `Access-Control-Allow-Headers` (string)

  - `Access-Control-Allow-Methods` (string)

  - `Access-Control-Allow-Origin` (string)

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 headers:

  - `Access-Control-Allow-Headers` (string)

  - `Access-Control-Allow-Methods` (string)

  - `Access-Control-Allow-Origin` (string)

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 headers:

  - `Access-Control-Allow-Headers` (string)

  - `Access-Control-Allow-Methods` (string)

  - `Access-Control-Allow-Origin` (string)

## Response 404:

  - `404` (unknown)
    The invoice could not be found.

## Response 404 headers:

  - `Access-Control-Allow-Headers` (string)

  - `Access-Control-Allow-Methods` (string)

  - `Access-Control-Allow-Origin` (string)

## Response 429:

  - `429` (unknown)
    Limit exceeded... unable to retrieve invoice based on tenant limits.

## Response 429 headers:

  - `Access-Control-Allow-Headers` (string)

  - `Access-Control-Allow-Methods` (string)

  - `Access-Control-Allow-Origin` (string)

## Response 500:

  - `500` (unknown)
    General server error

## Response 500 headers:

  - `Access-Control-Allow-Headers` (string)

  - `Access-Control-Allow-Methods` (string)

  - `Access-Control-Allow-Origin` (string)

