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

# Get a single contract by ID

> The invoices the contract will produce, earliest issue date first — each with the period it covers, its issue and due dates, totals and line items. The complement to the summary: that says whether the money adds up, this says whether the customer will be invoiced when the order form says. On a draft the documents are regenerated first, so the schedule reflects the contract as it stands; on a published contract the persisted invoices are returned untouched. Pass count to read only the first N.



## OpenAPI

````yaml /openapi/stigg-api.documented.yml get /api/v1/contracts/{id}/billing/invoice-schedule
openapi: 3.0.0
info:
  title: Stigg API
  description: Stigg API documentation
  version: 8.56.0
  contact: {}
servers:
  - url: https://api.stigg.io
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Customers
    description: Operations related to customers
  - name: Subscriptions
    description: Operations related to subscriptions
  - name: Coupons
    description: Operations related to coupons
  - name: Bulk Import
    description: Operations related to import of customers and subscriptions
  - name: Usage
    description: Operations related to usage & metering
  - name: Promotional Entitlements
    description: Operations related to promotional entitlements
  - name: Products
    description: Operations related to products
  - name: Features
    description: Operations related to features
  - name: Addons
    description: Operations related to addons
  - name: Plans
    description: Operations related to plans
  - name: Credit grants
    description: Operations related to credit grants
  - name: Credit ledger
    description: Operations related to credit ledger
  - name: Custom currencies
    description: Operations related to custom currencies
paths:
  /api/v1/contracts/{id}/billing/invoice-schedule:
    get:
      tags:
        - Contracts
      summary: Get a single contract by ID
      description: >-
        The invoices the contract will produce, earliest issue date first — each
        with the period it covers, its issue and due dates, totals and line
        items. The complement to the summary: that says whether the money adds
        up, this says whether the customer will be invoiced when the order form
        says. On a draft the documents are regenerated first, so the schedule
        reflects the contract as it stands; on a published contract the
        persisted invoices are returned untouched. Pass count to read only the
        first N.
      operationId: ContractController_getContractInvoiceSchedule
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the entity
          schema:
            minLength: 1
            maxLength: 255
            type: string
        - name: count
          required: false
          in: query
          schema:
            minimum: 1
            type: integer
        - name: X-ACCOUNT-ID
          in: header
          description: >-
            Account ID — optional when authenticating with a user JWT (Bearer
            token); falls back to the user's first membership. Ignored for
            API-key auth.
          required: false
          schema:
            type: string
        - name: X-ENVIRONMENT-ID
          in: header
          description: >-
            Environment ID — required when authenticating with a user JWT
            (Bearer token) on environment-scoped endpoints. Ignored for API-key
            auth (env is intrinsic to the key).
          required: false
          schema:
            type: string
      responses:
        '200':
          description: >-
            The contract's invoices, earliest first, with the period each
            covers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractInvoiceScheduleResponseDto'
        '400':
          description: bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadInputErrorResponseDto'
        '401':
          description: User is not authenticated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedErrorResponseDto'
        '403':
          description: User is not allowed to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenErrorResponseDto'
        '404':
          description: Contract not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponseDto'
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsErrorResponseDto'
components:
  schemas:
    ContractInvoiceScheduleResponseDto:
      type: object
      properties:
        data:
          type: object
          properties:
            contractId:
              type: string
              maxLength: 255
              description: Billing contract ID
            externalId:
              type: string
              maxLength: 255
              description: External ID for the contract
            isPreview:
              type: boolean
              description: >-
                True when the contract is still a draft and these are
                regenerated draft documents; false when they are the published
                contract's persisted invoices
            invoiceCount:
              type: number
              description: Number of invoices returned
            total:
              type: number
              description: Sum of the returned invoices' totals
            invoices:
              type: array
              items:
                type: object
                properties:
                  invoiceId:
                    type: string
                    maxLength: 255
                    description: Invoice ID
                  invoiceNumber:
                    type: string
                    maxLength: 255
                    description: >-
                      Human-readable invoice number, or the draft number while
                      still a draft
                    nullable: true
                  state:
                    type: string
                    maxLength: 255
                    description: Invoice state
                  issueDate:
                    type: string
                    format: date-time
                    description: Date the invoice is issued
                  dueDate:
                    type: string
                    format: date-time
                    description: Date payment is due, derived from the payment terms
                    nullable: true
                  periodStart:
                    type: string
                    format: date-time
                    description: Start of the period this invoice covers
                    nullable: true
                  periodEnd:
                    type: string
                    format: date-time
                    description: End of the period this invoice covers
                    nullable: true
                  currency:
                    type: string
                    maxLength: 255
                    description: Invoice currency
                  subtotal:
                    type: number
                    description: Amount before tax and discount
                  tax:
                    type: number
                    description: Tax amount
                  discount:
                    type: number
                    description: Discount amount
                    nullable: true
                  total:
                    type: number
                    description: Sum of the returned invoices' totals
                  lineItems:
                    type: array
                    items:
                      type: object
                      properties:
                        description:
                          type: string
                          maxLength: 255
                          description: Line item description
                        quantity:
                          type: number
                          description: Line item quantity
                        unitPrice:
                          type: number
                          description: Line item unit price
                        amount:
                          type: number
                          description: Line item amount
                      required:
                        - description
                        - quantity
                        - unitPrice
                        - amount
                required:
                  - invoiceId
                  - state
                  - issueDate
                  - currency
                  - subtotal
                  - tax
                  - total
                  - lineItems
          required:
            - contractId
            - externalId
            - isPreview
            - invoiceCount
            - total
            - invoices
          title: ContractInvoiceSchedule
          description: >-
            The invoices a contract will produce, earliest issue date first.
            Where the summary says whether the money adds up, this says whether
            the customer will be invoiced when the order form says — so it is
            the check that catches line items which agree on a total but bill on
            different days.
      required:
        - data
      title: Response
      description: Response object
    BadInputErrorResponseDto:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
          enum:
            - BadUserInput
            - BillingContractOperationRejected
            - DuplicateIntegrationNotAllowed
            - EntityIsArchivedError
            - IntegrityViolation
            - FreePlanCantHaveCompatiblePackageGroupError
            - SubscriptionMustHaveSinglePlanError
            - AddonIsCompatibleWithPlan
            - AddonIsCompatibleWithGroup
            - DuplicateAddonProvisionedError
            - ScheduledMigrationAlreadyExistsError
            - SubscriptionAlreadyOnLatestPlan
            - EntityIdDifferentFromRefIdError
            - UnsupportedFeatureType
            - UnsupportedVendorIdentifier
            - UnsupportedSubscriptionScheduleType
            - InvalidEntitlementResetPeriod
            - IncompatibleSubscriptionAddon
            - UnPublishedPackage
            - MeteringNotAvailableForFeatureType
            - AuthCustomerMismatch
            - AuthCustomerReadonly
            - FetchAllCountriesPricesNotAllowed
            - MemberInvitationError
            - PlansCircularDependencyError
            - NoFeatureEntitlementInSubscription
            - CheckoutIsNotSupported
            - UnsupportedParameter
            - PricingModelNotSupportedByBillingIntegration
            - BillingIntegrationMissing
            - BillingIntegrationAlreadyExistsError
            - InvalidMemberDelete
            - PackageAlreadyPublished
            - DraftPlanCantBeArchived
            - DraftAddonCantBeArchived
            - PlanWithChildCantBeDeleted
            - PlanCannotBePublishWhenBasePlanIsDraft
            - PlanCannotBePublishWhenCompatibleAddonIsDraft
            - PlanIsUsedAsDefaultStartPlan
            - PlanIsUsedAsDowngradePlan
            - InvalidAddressError
            - InvalidQuantity
            - BillingPeriodMissingError
            - DowngradeBillingPeriodNotSupportedError
            - CustomerAlreadyUsesCouponError
            - CustomerAlreadyHaveCustomerCoupon
            - SubscriptionAlreadyCanceledOrExpired
            - TrialMustBeCancelledImmediately
            - SubscriptionDoesNotHaveBillingPeriod
            - InvalidCancellationDate
            - FailedToImportCustomer
            - FailedToImportSubscriptions
            - PackagePricingTypeNotSet
            - InvalidSubscriptionStatus
            - InvalidArgumentError
            - EditAllowedOnDraftPackageOnlyError
            - ResyncAlreadyInProgress
            - ArchivedCouponCantBeApplied
            - ImportAlreadyInProgress
            - AddonHasToHavePriceError
            - SelectedBillingModelDoesntMatchImportedItemError
            - CannotArchiveProductError
            - CannotUnarchiveProductError
            - CannotDeleteCustomerError
            - CannotRemovePaymentMethodFromCustomerError
            - CannotDeleteFeatureError
            - CannotArchiveFeatureError
            - InvalidUpdatePriceUnitAmountError
            - ExperimentAlreadyRunning
            - ExperimentStatusError
            - OperationNotAllowedDuringInProgressExperiment
            - EntitlementsMustBelongToSamePackage
            - CanNotUpdateEntitlementsFeatureGroup
            - MeterMustBeAssociatedToMeteredFeature
            - CannotUpdateMeterOfFeatureInUse
            - CannotEditPackageInNonDraftMode
            - CannotAddOverrideEntitlementToPlan
            - MissingEntityIdError
            - NoProductsAvailable
            - PromotionCodeNotForCustomer
            - PromotionCodeNotActive
            - PromotionCodeMaxRedemptionsReached
            - PromotionCodeMinimumAmountNotReached
            - PromotionCodeCustomerNotFirstPurchase
            - AddonWithDraftCannotBeDeletedError
            - CannotReportUsageForEntitlementWithMeterError
            - RecalculateEntitlementsError
            - ImportSubscriptionsBulkError
            - InvalidMetadataError
            - CannotUpsertToPackageThatHasDraft
            - IntegrationValidationError
            - AwsMarketplaceIntegrationValidationError
            - AwsMarketplaceIntegrationError
            - DataExportIntegrationError
            - HubspotIntegrationError
            - DuplicateProductValidationError
            - AmountTooLarge
            - CustomerHasNoEmailAddress
            - MergeEnvironmentValidationError
            - EntitlementLimitExceededError
            - EntitlementUsageOutOfRangeError
            - UsageMeasurementDiffOutOfRangeError
            - AddonQuantityExceedsLimitError
            - AddonDependencyMissingError
            - PackageGroupMinItemsError
            - CannotUpdateUnitTransformationError
            - SingleSubscriptionCantBeAutoCancellationTargetError
            - MultiSubscriptionCantBeAutoCancellationSourceError
            - ChangingPayingCustomerIsNotSupportedError
            - RequiredSsoAuthenticationError
            - InvalidDoggoSignatureError
            - InvalidReceivedSignatureError
            - CannotDeleteDefaultIntegration
            - CannotChangeBillingIntegration
            - FailedToResolveBillingIntegration
            - WorkflowTriggerNotFound
            - DeprecatedEstimateSubscriptionError
            - FeatureConfigurationExceededLimitError
            - FeatureNotBelongToFeatureGroupError
            - FeatureGroupMissingFeaturesError
            - VersionExceedsMaxValueError
            - CannotUpdateExpireAtForExpiredCreditGrantError
            - ExpireAtMustBeLaterThanEffectiveAtError
            - OfferAlreadyExists
            - DraftAlreadyExists
            - CreditGrantAlreadyVoided
            - CreditGrantCannotBeVoided
            - InvalidTaxId
            - ObjectAlreadyBeingUsedByAnotherRequestError
            - TooManySubscriptionsPerCustomer
            - TooManyCustomCurrencies
            - StripeError
            - SchedulingAtEndOfBillingPeriod
            - ApiKeyExpired
            - ApiKeyHasExpiry
            - OveragePriceNotSupportedOnAddon
            - OveragePriceRequiresUsageLimit
            - InvalidCreditOverageBillingModel
            - CreditOveragePriceCurrencyNotFound
            - InvoicePreviewNotAvailableForDraftContract
          nullable: true
        reason:
          type: string
          maxLength: 255
          description: >-
            The billing side's machine-readable code for a billing-contract
            refusal. Present only when the code is
            BillingContractOperationRejected and the refusal carried one.
      required:
        - message
        - code
    UnauthenticatedErrorResponseDto:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
          enum:
            - Unauthenticated
          nullable: true
      required:
        - message
        - code
    ForbiddenErrorResponseDto:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
          enum:
            - IdentityForbidden
            - AccessDeniedError
            - NoFeatureEntitlementError
            - GovernanceNotEnabled
          nullable: true
      required:
        - message
        - code
    NotFoundErrorResponseDto:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
          enum:
            - CustomerNotFound
            - CustomCurrencyNotFound
            - CreditGrantNotFound
            - ContractNotFound
            - InvoiceNotFound
            - MemberNotFound
            - PackageGroupNotFound
            - AddonNotFound
            - AddonsNotFound
            - EnvironmentMissing
            - IntegrationNotFound
            - VendorIsNotSupported
            - CouponNotFound
            - FutureUpdateNotFound
            - CustomerNoBillingId
            - SubscriptionNoBillingId
            - StripeCustomerIsDeleted
            - InitStripePaymentMethodError
            - PreparePaymentMethodFormError
            - AccountNotFoundError
            - ExperimentNotFoundError
            - NoDraftOfferFound
            - PromotionCodeNotFound
            - FailedToCreateCheckoutSessionError
            - PaymentMethodNotFoundError
            - ProductNotFoundError
            - ProductNotPublishedError
            - MissingBillingInvoiceError
            - BillingInvoiceStatusError
            - FeatureGroupNotFoundError
            - CannotArchiveFeatureGroupError
            - OfferNotFound
            - CustomerResourceNotFound
            - FeatureNotFound
            - PriceNotFound
            - NoActiveSubscriptionForCustomer
            - PlanNotFound
            - PromotionalEntitlementNotFoundError
            - SubscriptionNotFound
            - ApiKeyNotFound
          nullable: true
      required:
        - message
        - code
    TooManyRequestsErrorResponseDto:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
          enum:
            - RateLimitExceeded
          nullable: true
      required:
        - message
        - code
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Server API Key

````

## Related topics

- [Get a single contract by ID](/api-reference/contracts/get-a-single-contract-by-id.md)
- [Get a single invoice by ID](/api-reference/invoices/get-a-single-invoice-by-id.md)
- [Get a single entity by ID](/api-reference/governance-entities/get-a-single-entity-by-id.md)
