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

# Get billing run details for an invoice

> Get all billing run details which created the invoice. This includes all subscriptions, subscription items and the date range which was billed.

<sup>Required permissions: `invoice:read`</sup>



## OpenAPI

````yaml get /invoices/{invoiceId}/billing-run
openapi: 3.1.0
info:
  title: Fynn API
  description: ''
  termsOfService: https://www.fynn.eu/tos
  contact:
    name: Fynn UG (haftungsbeschränkt)
    url: https://www.fynn.eu
    email: hi@fynn.eu
  license:
    name: Proprietary
    url: https://www.fynn.eu/license
  version: 0.0.0
servers:
  - url: https://coreapi.io
    description: Production
  - url: https://preview.coreapi.io
    description: Sandbox
security:
  - JWT: []
tags: []
paths:
  /invoices/{invoiceId}/billing-run:
    parameters: []
    get:
      tags:
        - BillingRun
      summary: Get billing run details for an invoice
      description: >-
        Get all billing run details which created the invoice. This includes all
        subscriptions, subscription items and the date range which was billed.


        <sup>Required permissions: `invoice:read`</sup>
      operationId: getInvoiceBillingDetails
      parameters:
        - name: invoiceId
          in: path
          description: BillingRun identifier
          required: true
          deprecated: false
          schema:
            type: string
          style: simple
          explode: false
      responses:
        '200':
          description: BillingRun resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingRun-BillingRunDetails'
            text/html:
              schema:
                $ref: '#/components/schemas/BillingRun-BillingRunDetails'
        '404':
          description: Resource not found
      deprecated: false
      security:
        - JWT:
            - invoice:read
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl -X GET \
             /invoices/{invoiceId}/billing-run \
             --header "Authorization: Bearer <token>"
components:
  schemas:
    BillingRun-BillingRunDetails:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          readOnly: true
          type: string
        dateRangeFrom:
          readOnly: true
          type: string
          format: date-time
        invoice:
          type: string
          format: uuid
          example: https://example.com/
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/Subscription-BillingRunDetails'
        subscriptionItems:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionItem-BillingRunDetails'
        billedAt:
          readOnly: true
          type: string
          format: date-time
        dateRangeTo:
          readOnly: true
          description: The date range to which the billing run was created.
          type: string
          format: date-time
        usageBreakdownUrl:
          readOnly: true
          description: Public url to view the detailed usage breakdown of this billing run.
          type:
            - string
            - 'null'
    Subscription-BillingRunDetails:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          readOnly: true
          example: ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b
          type: string
        externalId:
          type:
            - string
            - 'null'
        number:
          description: The number of the subscription.
          example: S-00000001
          type: string
        name:
          description: >-
            The name of the subscription. Defaults to the name of the plan. This
            will be used in the invoice for the grouping headers.
          example: Fitness M
          type:
            - string
            - 'null'
        billingGroup:
          description: The billing group defines the billing cycle of the subscription.
          anyOf:
            - $ref: '#/components/schemas/BillingGroup-BillingRunDetails'
            - type: 'null'
        periods:
          type: array
          items:
            $ref: '#/components/schemas/TermPeriod-BillingRunDetails'
        status:
          readOnly: true
          description: |-
            The status of the subscription.

            Possible values:
             * `draft`: The subscription is in draft mode and not active yet.
             * `active`: The subscription is active and will be billed.
             * `paused`: The subscription is paused and will not be billed.
             * `cancelled`: The subscription is cancelled and will not be billed anymore.
             * `terminated`: The subscription is terminated and will not be billed anymore.
             * `offer`: The subscription is an offer and waiting for acceptance.
          example: active
        activatedAt:
          readOnly: true
          description: The date the subscription was activated.
          example: '2021-01-01T00:00:00+00:00'
          type:
            - string
            - 'null'
          format: date-time
        poNumber:
          description: The po number of the subscription.
          example: PO-00000001
          type:
            - string
            - 'null'
        contractDetails:
          $ref: '#/components/schemas/ContractDetails-BillingRunDetails'
          description: The contract details of the subscription.
        trialEndsOn:
          readOnly: true
          description: The date the trial period ends.
          example: '2021-01-01T00:00:00+00:00'
          type:
            - string
            - 'null'
          format: date-time
        customFields:
          additionalProperties:
            type: string
          type:
            - object
            - 'null'
          example:
            field1: value1
            field2: value2
          description: >-
            Custom fields for the entity. The keys are the field names and the
            values are the field values. They need to be configured under
            \"/custom-fields\" in the API documentation. The input is validated
            against the configuration. For more details see [Custom Fields
            Guide](/guide/tenant/custom-fields)
        nextBillingDate:
          readOnly: true
          description: The next billing date of the subscription.
          type:
            - string
            - 'null'
          format: date-time
        lastBillingAt:
          readOnly: true
          description: The last billing date of the subscription.
          type:
            - string
            - 'null'
          format: date-time
        partner:
          readOnly: true
          description: The partner of the customer.
          anyOf:
            - $ref: '#/components/schemas/PartnerResource-BillingRunDetails'
            - type: 'null'
    SubscriptionItem-BillingRunDetails:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          readOnly: true
          example: 01F9ZQZJZJQZJZJZJZJZJZJZJZ
          type: string
        name:
          readOnly: true
          description: >-
            The name of the item which will be used in the invoice. The name is
            translated based on the customer's locale.
          example: Fitness M
          type: string
        description:
          readOnly: true
          description: >-
            The description of the item which will be used in the invoice. The
            description is translated based on the customer's locale.
          example: Everything included
          type:
            - string
            - 'null'
        furtherInformation:
          readOnly: true
          description: >-
            Further information defines additional information for the item
            which will be displayed in the invoice.
          example: 'Additional agreements: The contract includes a free drink flatrate.'
          type:
            - string
            - 'null'
        status:
          readOnly: true
          description: |-
            The status of the item.

            Possible values:
             * `active`: The item is active and will be billed.
             * `canceled`: The item is canceled and will be billed until the end of the contract.
             * `pending`: The item is pending and will be billed after the contract start.
             * `terminated`: The item is terminated and will not be billed.
          example: active
          enum:
            - active
            - canceled
            - pending
            - terminated
        subscriptionId:
          readOnly: true
          type: string
    BillingGroup-BillingRunDetails:
      type: object
      description: ''
      deprecated: false
    TermPeriod-BillingRunDetails:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          readOnly: true
          type: string
        contractPeriodCount:
          readOnly: true
          type: integer
        contractPeriod:
          $ref: '#/components/schemas/Interval-BillingRunDetails'
          readOnly: true
        cancellationPeriod:
          $ref: '#/components/schemas/Interval-BillingRunDetails'
          readOnly: true
    ContractDetails-BillingRunDetails:
      type: object
      description: ''
      deprecated: false
      properties:
        contractStart:
          description: The start of the contract.
          type: string
          format: date-time
        contractEnd:
          description: The end of the contract.
          type:
            - string
            - 'null'
          format: date-time
    PartnerResource-BillingRunDetails:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          description: The ID of the partner
          example: ad8f7e7d-3b3b-4b3b-8b3b-3b3b3b3b3b3b
          type: string
        name:
          description: The name of the partner
          example: John Doe
          type: string
        number:
          description: The customer number of the partner
          example: '123456'
          type: string
        email:
          description: The email address of the partner
          example: partner@example.com
          type:
            - string
            - 'null'
    Interval-BillingRunDetails:
      type: object
      description: ''
      deprecated: false
  securitySchemes:
    JWT:
      type: http
      scheme: bearer

````