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

# Export invoices

> Download all invoices for your platform as a CSV file in a single streaming response. No pagination applies – all matching invoices are included.

The CSV export endpoint streams all invoices for your platform in a single response, making it ideal for accounting integrations, financial reconciliation, and bulk data transfers to external systems. Unlike the paginated list endpoint, no `limit` or `offset` applies – every invoice matching your filter criteria is included in the export. The response is returned as a downloadable CSV file with a consistent column structure that maps to the invoice object fields.

<Tip>
  Use the `--output` flag in curl to save the response directly to a file. Without it, the raw CSV content is printed to stdout.
</Tip>

<Note>
  On platforms with very large invoice volumes, narrow the export with filters such as `invoiced_at`, `created_at`, or `status`
  and pull the data in batches rather than requesting the full dataset in one call.
</Note>

<Warning>
  There is no server-side pagination on this endpoint – all matching invoices are included in a single response. For extremely
  large datasets, the response may take several seconds to stream. Implement appropriate timeout settings on your HTTP client.
</Warning>


## OpenAPI

````yaml GET /v1/invoices/export/csv
openapi: 3.0.0
info:
  version: 0.0.1
  title: Tilta API
  description: Tilta API documentation
servers:
  - url: https://api.tilta.io
    description: Tilta Production API
  - url: https://api.tilta-sandbox.io
    description: Tilta Sandbox API
security: []
paths:
  /v1/invoices/export/csv:
    get:
      tags:
        - Invoices
      summary: Export invoices
      description: Export invoices as CSV.
      parameters:
        - schema:
            type: string
            description: An array of external_id's to filter invoices by.
            example: inv_123,inv_456
          required: false
          name: external_id
          in: query
        - schema:
            type: string
            description: An array of buyer external_id's to filter invoices by.
            example: buyer_123,buyer_456
          required: false
          name: buyer_external_id
          in: query
        - schema:
            type: string
            description: An array of merchant external_id's to filter invoices by.
            example: merch_123,merch_456
          required: false
          name: merchant_external_id
          in: query
        - schema:
            type: string
            description: The invoice number to filter invoices by.
          required: false
          name: invoice_number
          in: query
        - schema:
            type: string
            description: >-
              Filter invoices by the buyer's legal name. Supports wildcards
              (e.g. *acme*, acme*, *acme). Case-insensitive.
            example: '*acme*'
          required: false
          name: buyer_legal_name
          in: query
        - schema:
            type: string
            description: >-
              The invoiced at date range to filter invoices by, in the format
              gte..lte (unix time in seconds). Each bound is optional.
            example: 1580515200..1583020800
          required: false
          name: invoiced_at
          in: query
        - schema:
            type: string
            description: The gross amount range to filter invoices by.
          required: false
          name: amount_gross
          in: query
        - schema:
            type: string
            description: An array of currency codes to filter invoices by.
            example: EUR,GBP
          required: false
          name: currency
          in: query
        - schema:
            type: string
            description: >-
              The creation date range to filter invoices by, in the format
              gte..lte (unix time in seconds). Each bound is optional.
            example: 1580515200..1583020800
          required: false
          name: created_at
          in: query
        - schema:
            type: string
            description: >-
              The due date range to filter invoices by, in the format gte..lte
              (unix time in seconds). Each bound is optional.
            example: 1580515200..1583020800
          required: false
          name: due_at
          in: query
        - schema:
            type: string
            description: Days past due range to filter invoices by, in the format gte..lte.
            example: 15..30
          required: false
          name: days_past_due
          in: query
        - schema:
            type: string
            description: An array of invoice statuses to filter invoices by.
            example: OPEN,DUE,CLOSED,CANCELLED
          required: false
          name: status
          in: query
        - schema:
            type: string
            description: >-
              Filter invoices by Financing service status. Comma-separated list
              of statuses. Use `none` to include invoices where Financing was
              never applied.
            example: IN_REVIEW,REJECTED,none
          required: false
          name: financing_status
          in: query
        - schema:
            type: string
            description: >-
              Filter invoices by Insurance service status. Comma-separated list
              of statuses. Use `none` to include invoices where Insurance was
              never applied.
            example: CLAIM_NOTIFIED,CLAIM_IN_ASSESSMENT
          required: false
          name: insurance_status
          in: query
        - schema:
            type: string
            description: >-
              Filter invoices by Collection service status. Comma-separated list
              of statuses. Use `none` to include invoices where Collection was
              never applied.
            example: EARLY_COLLECTION,LATE_COLLECTION
          required: false
          name: collection_status
          in: query
        - schema:
            type: string
            description: >-
              Sort invoices by provided field in ascending or descending order.
              Prefix field with - for descending order. Example:
              sort_by=-created_at
          required: false
          name: sort_by
          in: query
        - schema:
            type: array
            nullable: true
            items:
              type: string
              enum:
                - buyer
                - services
            description: >-
              Invoice sub-entities to expand in the response object. Currently
              supported: buyer, services (more coming soon).
            example:
              - buyer
              - services
          required: false
          name: expand
          in: query
        - schema:
            type: string
            enum:
              - COMMA
              - SEMICOLON
            default: COMMA
          required: false
          name: delimiter
          in: query
      responses:
        '200':
          description: ''
          content:
            text/csv:
              schema:
                $ref: '#/components/schemas/csvExportResponseSchema'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badRequestSchema'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorizedRequestSchema'
      security:
        - bearerAuth: []
components:
  schemas:
    csvExportResponseSchema:
      type: string
      format: binary
      description: CSV payload streamed as the response body.
    badRequestSchema:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: BAD_REQUEST
        error:
          type: string
          description: Error message for debugging purposes
          example: Request validation failed. 1 issue found.
        issues:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                description: Issue code
                example: INVALID_TYPE
              path:
                type: string
                description: Issue path starting with body, params, querystring, or headers
                example: body.registered_at
              message:
                type: string
                description: Issue message for debugging purposes
                example: Invalid type
            required:
              - code
              - path
              - message
          description: List of issues
          example:
            - code: INVALID_TYPE
              path: body.registered_at
              message: Invalid type
      required:
        - code
        - error
        - issues
      description: Bad Request, see error message for details.
      example:
        code: BAD_REQUEST
        error: Request validation failed. 1 issue found.
        issues:
          - code: INVALID_TYPE
            path: body.registered_at
            message: Invalid type
    unauthorizedRequestSchema:
      type: object
      properties:
        error:
          type: string
          description: Error details.
          example: Unauthorized
        code:
          type: string
          description: Error code.
          example: UNAUTHORIZED
      required:
        - error
        - code
      description: Unauthorized Request.
      example:
        error: Unauthorized
        code: UNAUTHORIZED
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your Tilta API key, sent as `Bearer <key>`.

````