> ## 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 invoice by ID

> Retrieves a single invoice with its full detail, resolved by its ID. Works for a contract invoice and a subscription invoice alike, since invoices are addressed by their own ID.



## OpenAPI

````yaml /openapi/stigg-api.documented.yml get /api/v1/customers/{id}/invoices/{invoiceRef}
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/customers/{id}/invoices/{invoiceRef}:
    get:
      tags:
        - Invoices
      summary: Get a single invoice by ID
      description: >-
        Retrieves a single invoice with its full detail, resolved by its ID.
        Works for a contract invoice and a subscription invoice alike, since
        invoices are addressed by their own ID.
      operationId: CustomerInvoicesController_getInvoice
      parameters:
        - name: id
          required: true
          in: path
          description: >-
            External ID of the customer the invoice belongs to: your customer
            ref when mapped, otherwise the Received customer ID
          schema:
            minLength: 1
            maxLength: 255
            pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.@-]*$
            type: string
        - name: invoiceRef
          required: true
          in: path
          description: The billing provider (Received) invoice ID
          schema:
            maxLength: 255
            type: string
        - 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 invoice.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceResponseDto'
        '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: Invoice 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:
    InvoiceResponseDto:
      type: object
      properties:
        data:
          type: object
          properties:
            invoiceId:
              type: string
              maxLength: 255
              description: The billing provider (Received) invoice ID
            invoiceExternalId:
              type: string
              maxLength: 255
              description: >-
                External ID for the invoice: the mapped external ID when one
                exists, otherwise the invoice ID
              nullable: true
            invoiceNumber:
              type: string
              maxLength: 255
              description: >-
                The invoice document number (or draft number while the invoice
                is unissued)
              nullable: true
            contractExternalId:
              type: string
              maxLength: 255
              description: >-
                External ID of the contract the invoice belongs to: your
                contract ref when mapped, otherwise the Received contract ID
              nullable: true
            customerExternalId:
              type: string
              maxLength: 255
              description: >-
                External ID of the customer the invoice belongs to: your
                customer ref when mapped, otherwise the Received customer ID
              nullable: true
            state:
              type: string
              enum:
                - OPEN
                - CANCELED
                - PAID
              description: The invoice status (open, paid, or canceled)
            issueDate:
              type: string
              format: date-time
              description: The date the invoice was issued
              nullable: true
            dueDate:
              type: string
              format: date-time
              description: The date payment is due
              nullable: true
            paidDate:
              type: string
              format: date-time
              description: >-
                The date the invoice was reconciled as paid; present once
                reconciled
              nullable: true
            currency:
              type: string
              maxLength: 255
              description: The ISO-4217 currency code of the invoice
              nullable: true
            subtotal:
              type: number
              description: The pre-tax subtotal
              nullable: true
            tax:
              type: number
              description: The total tax amount
              nullable: true
            discount:
              type: number
              description: The total discount amount
              nullable: true
            total:
              type: number
              description: The total amount due
              nullable: true
            lineItems:
              type: array
              items:
                type: object
                properties:
                  description:
                    type: string
                    maxLength: 255
                    description: Human-readable description of the line item
                    nullable: true
                  quantity:
                    type: number
                    description: Quantity billed on this line
                    nullable: true
                  unitPrice:
                    type: number
                    description: Price per unit for this line
                    nullable: true
                  amount:
                    type: number
                    description: Total amount for this line (unit price × quantity)
                    nullable: true
                  productExternalId:
                    type: string
                    maxLength: 255
                    description: >-
                      External ID of the product this line item relates to, when
                      one is mapped
                    nullable: true
                required:
                  - description
                  - quantity
                  - unitPrice
                  - amount
                  - productExternalId
                title: InvoiceLineItem
                description: A single line item on an invoice.
              description: The invoice line items
          required:
            - invoiceId
            - invoiceExternalId
            - invoiceNumber
            - contractExternalId
            - customerExternalId
            - state
            - issueDate
            - dueDate
            - paidDate
            - currency
            - subtotal
            - tax
            - discount
            - total
            - lineItems
          title: Invoice
          description: A customer invoice as reported by the connected billing provider.
      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 invoice by ID](/api-reference/invoices/get-a-single-invoice-by-id-2.md)
- [Get a single contract by ID](/api-reference/contracts/get-a-single-contract-by-id.md)
- [Get a single subscription by ID](/api-reference/subscriptions/get-a-single-subscription-by-id.md)
