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

# Create billing report export

> Submits an async request to generate a rolling 3-month bookkeeping billing report (XLSX) for the authenticated client. Returns immediately with an export resource; poll GET /v1/exports/{exportId} or subscribe to export.completed / export.failed webhooks for completion.

Starts an async export that generates a rolling 3-month bookkeeping billing report (XLSX) for your client. The response is `202 Accepted` with an [Export](/api-reference/v1/fetch-export) resource.

Poll [Fetch export](/api-reference/v1/fetch-export) or subscribe to `export.completed` / `export.failed` webhooks. See [Generating async reports](/guides/async-reports).


## OpenAPI

````yaml post /v1/billing/reports
openapi: 3.0.1
info:
  title: API
  version: latest
servers: []
security:
  - BearerAuth: []
tags: []
externalDocs:
  url: /
paths:
  /v1/billing/reports:
    post:
      tags: []
      summary: Create billing report export
      description: >-
        Submits an async request to generate a rolling 3-month bookkeeping
        billing report (XLSX) for the authenticated client. Returns immediately
        with an export resource; poll GET /v1/exports/{exportId} or subscribe to
        export.completed / export.failed webhooks for completion.
      operationId: billing.reports.post
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingReportExportParameters'
      responses:
        '202':
          description: Export request accepted and generation started.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ApiExport'
                required:
                  - data
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      deprecated: false
components:
  schemas:
    BillingReportExportParameters:
      type: object
      description: Parameters for requesting a rolling 3-month bookkeeping billing report.
      properties:
        end_month:
          type: integer
          minimum: 1
          maximum: 12
          description: Ending month (1-12) of the rolling 3-month billing window.
        end_year:
          type: integer
          description: Ending year of the rolling 3-month billing window.
        pnl_structure:
          allOf:
            - $ref: '#/components/schemas/PnlTemplates'
          description: >-
            Optional P&L structure template used when calculating trailing
            revenue. Defaults to the client's industry default.
      required:
        - end_month
        - end_year
    ApiExport:
      type: object
      description: An async export request and its current status.
      properties:
        type:
          type: string
          description: Resource type. Value will be `Export`.
          example: Export
        id:
          type: string
          format: uuid
          description: Unique identifier for the export request.
        business_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Business associated with the export, if applicable. Null for
            client-scoped exports such as billing reports.
        export_type:
          $ref: '#/components/schemas/ExportType'
        status:
          $ref: '#/components/schemas/ExportRequestStatus'
        params:
          type: object
          additionalProperties: true
          description: >-
            Parameters used to generate the export. Shape depends on
            export_type.
        download_url:
          type: string
          nullable: true
          description: >-
            Presigned URL to download the completed file. Present only when
            status is completed.
        file_name:
          type: string
          nullable: true
          description: Suggested filename for the export artifact.
        error:
          type: string
          nullable: true
          description: Error message when status is failed.
        created_at:
          type: string
          format: date-time
          description: When the export request was created.
        started_at:
          type: string
          format: date-time
          nullable: true
          description: When export processing started.
        completed_at:
          type: string
          format: date-time
          nullable: true
          description: When the export completed successfully.
        failed_at:
          type: string
          format: date-time
          nullable: true
          description: When the export failed.
      required:
        - id
        - export_type
        - status
        - params
        - created_at
    ApiError:
      type: object
      description: An error object returned in API error responses.
      properties:
        type:
          $ref: '#/components/schemas/ApiErrorType'
          description: >-
            A fixed category for the error, helpful for categorizing and
            processing errors.
        description:
          type: string
          description: A human-readable error description.
        error_enum:
          $ref: '#/components/schemas/ApiEnumErrorType'
          description: >-
            A stable, machine-readable identifier for programmatically handling
            specific error conditions. Only present for 4xx client errors—not
            included for 5xx server errors. Use this instead of parsing the
            description field, as enum values remain stable across API versions.
          nullable: true
        meta:
          type: object
          description: Optional additional information about the error.
          nullable: true
      required:
        - type
        - description
    PnlTemplates:
      type: string
      enum:
        - DEFAULT
        - TRUCKING
        - MEDSPA
        - MEDSPA_NO_LICENSING
        - CITRUS
        - CITRUS_NO_LICENSING
        - FLORIST
    ExportType:
      type: string
      enum:
        - billing_report
      description: Type of async export. Additional report types may be added over time.
      example: billing_report
    ExportRequestStatus:
      type: string
      enum:
        - pending
        - processing
        - completed
        - failed
      description: Lifecycle status of an async export request.
      example: pending
    ApiErrorType:
      type: string
      enum:
        - ResourceArchived
        - AuthFailure
        - Plaid
        - Stripe
        - InvalidState
        - ResourceNotFound
        - InvalidParameters
        - JsonSerialization
        - Unknown
        - BadRequest
        - PaginationCursor
        - Conflict
        - LedgerOperationFailed
    ApiEnumErrorType:
      type: string
      description: >-
        Stable enum values for programmatic error handling. Only present in 4xx
        error responses.
      enum:
        - AccessCodeInvalid
        - BalanceSheetDoesNotBalance
        - BalanceSheetMissingAccount
        - BankStatementParserError
        - BillStateError
        - BulkCategorizeFailure
        - BulkMatchFailure
        - BusinessTaskAlreadyCompleted
        - BusinessTaskDeleted
        - CalendlyOAuthError
        - CallBookingError
        - CantUpdateTransactionInCustomerPayout
        - CantUpdateTransactionInVendorPayout
        - CheckPayrollConfigNotFound
        - CheckPayrollServiceNotFound
        - ClerkUserAlreadyExists
        - ConflictingQueryParams
        - CustomAccountAlreadyExists
        - CustomTransactionCsvParsingError
        - CustomTransactionUploadFailure
        - CustomerPayoutInputFormatError
        - DoesNotMatchExistingEntity
        - EmptyBatchRequest
        - ExpenseParserError
        - ExternalAccountBalanceReconciliationError
        - ExternalIdConflict
        - InvalidCategory
        - InvalidEffectiveDate
        - InvalidLedgerOperation
        - InvalidMonthlyAverageRange
        - InvalidMultiPartRequest
        - InvalidPaginationCursor
        - InvalidPayload
        - InvoiceDeleted
        - InvoiceNotFound
        - InvoiceReferenceMismatch
        - InvoiceStateError
        - ManualRateLimit
        - MultipleTagKeyFiltersUnsupported
        - NoCognitoUserFound
        - NoOpeningBalanceFound
        - NotYetReconciled
        - OnePasswordApiError
        - OnePasswordItemNotFound
        - OnePasswordVaultNotFound
        - OpenAICategorizationError
        - PaymentLinkInvalid
        - PayrollStateError
        - PeriodIsClosed
        - PeriodNotClosed
        - PhoneNumberAlreadyRegistered
        - PlaidApiError
        - PlaidConnectionBroken
        - PlaidCreateLinkTokenError
        - PlaidCredentialsNotConfigured
        - PlaidExchangePublicTokenError
        - PlaidGetInstitutionByIdError
        - PlaidGetItemError
        - PlaidInvalidEnvironment
        - PlaidItemAlreadyExists
        - PlaidItemNotFound
        - PlaidProcessorApiError
        - PlaidUnlinkItemError
        - QueryParamFormat
        - QueryParamMissing
        - QuickbooksBrokenConnection
        - QuickbooksConnectionAlreadyExists
        - QuickbooksConnectionAlreadySyncing
        - QuickbooksConnectionMissing
        - QuickbooksConnectionNotActivated
        - QuickbooksInvalidRequest
        - QuickbooksInvalidState
        - QuickbooksNoMatchingAccount
        - QuickbooksNonPostingAccountType
        - QuickbooksNotConfigured
        - QuickbooksOAuthCallbackInvalid
        - QuickbooksOAuthError
        - QuickbooksTokenExpired
        - ResourceArchived
        - ScheduleCNotConfigured
        - SmsNotEnabled
        - SpecifiedBadRequest
        - SpecifiedIdNotFound
        - SplitTransactionError
        - StepEvaluationBadRequest
        - StripeConnectAccountIdNotFound
        - StripeCredentialsNotConfigured
        - StripeGetBalanceForConnectAccountFailure
        - StripeRedirectOrRefreshUrlNotConfigured
        - TagFilterNotFound
        - UnexpectedQueryParam
        - UnitAccountsInUse
        - WrongAnswerType
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````