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

# Retrieve the upcoming invoice

> Retrieve the upcoming invoice preview for a membership or subscription. <h3>OAuth</h3>Required scopes: <code>invoices.readonly</code> or <code>invoices</code>



## OpenAPI

````yaml /assets/openapi.json get /billing/invoices/v1/upcoming
openapi: 3.0.2
info:
  title: Spacebring
  version: 1.0.0
  termsOfService: https://www.spacebring.com/terms
servers:
  - url: https://api.spacebring.com
security: []
paths:
  /billing/invoices/v1/upcoming:
    get:
      tags:
        - Billing
      summary: Retrieve the upcoming invoice
      description: >-
        Retrieve the upcoming invoice preview for a membership or subscription.
        <h3>OAuth</h3>Required scopes: <code>invoices.readonly</code> or
        <code>invoices</code>
      operationId: getUpcomingInvoice
      parameters:
        - name: subscriptionRef
          in: query
          description: The id of the subscription.
          schema:
            type: string
            format: uuid
        - in: header
          name: spacebring-network-id
          schema:
            type: string
            format: uuid
          required: false
          description: >-
            The id of the network. Required when using bearer token
            authentication
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  invoice:
                    $ref: '#/components/schemas/invoice'
                  invoiceItems:
                    type: array
                    items:
                      $ref: '#/components/schemas/invoiceItem'
                  upcomingItems:
                    type: array
                    items:
                      $ref: '#/components/schemas/invoiceItem'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
      security:
        - BasicAuth: []
        - OAuth2:
            - invoices.readonly
            - invoices
components:
  schemas:
    invoice:
      type: object
      additionalProperties: false
      properties:
        amount:
          deprecated: true
          description: Deprecated. Use totalAmount instead.
          type: number
        amountDue:
          description: Amount due in major units (from base or alt currency).
          type: number
        amountPaid:
          description: Total amount paid in major units.
          type: number
        amountRemaining:
          description: Amount remaining to be paid in major units.
          type: number
        appliedBalance:
          description: Applied customer balance offset in major units.
          type: number
        autoChargeFailed:
          description: Whether the last auto-charge attempt failed.
          type: boolean
        autoCreateDate:
          description: Date of scheduled automatic invoice creation.
          type: string
          format: date-time
        baseAmounts:
          description: Amounts in the base currency.
          type: object
          properties:
            amountDue:
              description: Amount due in major units.
              type: number
            appliedBalance:
              description: Applied customer balance offset in major units.
              type: number
            currencyCode:
              description: ISO currency code.
              type: string
            postPaymentCreditNotesAmount:
              description: Post-payment credit notes amount in major units.
              type: number
            prePaymentCreditNotesAmount:
              description: Pre-payment credit notes amount in major units.
              type: number
            subtotalAmount:
              description: Subtotal amount in major units.
              type: number
            subtotalExcludingTaxAmount:
              description: Subtotal excluding tax in major units.
              type: number
            taxes:
              description: Tax breakdown.
              type: array
              items:
                type: object
                properties:
                  amount:
                    description: Tax amount in major units.
                    type: number
                  inclusive:
                    description: Whether tax is included in the price.
                    type: boolean
                  rate:
                    description: Tax rate as a decimal.
                    type: number
                  taxableAmount:
                    description: Amount subject to tax in major units.
                    type: number
                required:
                  - amount
                  - inclusive
                  - rate
                  - taxableAmount
                additionalProperties: false
            totalAmount:
              description: Total amount in major units.
              type: number
            totalExcludingTaxAmount:
              description: Total amount excluding tax in major units.
              type: number
          required:
            - amountDue
            - appliedBalance
            - currencyCode
            - postPaymentCreditNotesAmount
            - prePaymentCreditNotesAmount
            - subtotalAmount
            - subtotalExcludingTaxAmount
            - taxes
            - totalAmount
            - totalExcludingTaxAmount
          additionalProperties: false
        company:
          deprecated: true
          description: Deprecated. Use customer instead.
        companyRef:
          description: ID of the associated company.
          type: string
          format: uuid
        createDate:
          description: ISO timestamp of when the invoice was created.
          type: string
          format: date-time
        currencyCode:
          description: ISO currency code (from base or alt currency).
          type: string
        customer:
          description: Customer associated with this invoice.
          type: object
          properties:
            id:
              description: ID of the company or membership.
              type: string
              format: uuid
            logo:
              description: Company logo.
              type: object
              properties:
                key:
                  type: string
                url:
                  type: string
              required:
                - key
                - url
              additionalProperties: false
            title:
              description: Company name.
              type: string
            type:
              description: Whether the customer is a company or a user.
              type: string
              enum:
                - company
                - user
            user:
              description: User details for membership customers.
              type: object
              properties:
                id:
                  type: string
                  format: uuid
                name:
                  type: string
                photoUrl:
                  nullable: true
                  type: string
                surname:
                  type: string
              required:
                - id
              additionalProperties: false
          required:
            - id
            - type
          additionalProperties: false
        customerAddress:
          description: Customer billing address.
          type: object
          properties:
            city:
              type: string
            countryCode:
              nullable: true
              type: string
            line1:
              type: string
            line2:
              type: string
            postalCode:
              type: string
            state:
              type: string
          required:
            - city
            - countryCode
            - line1
            - line2
            - postalCode
            - state
          additionalProperties: false
        customerName:
          description: Customer legal name.
          type: string
        customerTaxId:
          description: Customer tax ID.
          type: string
        dueDate:
          description: Payment due date.
          type: string
          format: date-time
        dueDays:
          description: Number of days until payment is due.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        dueType:
          description: How the due date is calculated.
          type: string
          enum:
            - date
            - days
            - default
        id:
          description: Unique identifier of the invoice.
          type: string
          format: uuid
        internalNote:
          description: Internal memo (visible to admins only).
          type: string
        issueDate:
          description: ISO timestamp of when the invoice was issued.
          type: string
          format: date-time
        items:
          deprecated: true
          description: Deprecated. Invoice line items.
          type: array
          items: {}
        itemsCount:
          description: Number of line items on this invoice.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        locationRef:
          description: ID of the organization (location).
          type: string
          format: uuid
        membershipRef:
          description: ID of the associated membership.
          type: string
          format: uuid
        memo:
          deprecated: true
          description: Deprecated. Use internalNote instead.
          type: string
        netAmount:
          deprecated: true
          description: Deprecated. Use totalExcludingTaxAmount instead.
          type: number
        number:
          deprecated: true
          description: Deprecated. Use title instead.
          type: string
        paymentMethod:
          description: Auto-charge payment method, if configured.
          type: object
          properties:
            cardMask:
              type: string
            label:
              type: string
            mask:
              type: string
          additionalProperties: false
        payments:
          description: Payment records for this invoice.
          type: array
          items:
            type: object
            additionalProperties: false
            properties:
              createDate:
                description: ISO timestamp of the payment.
                type: string
                format: date-time
              dispute:
                description: Payment dispute details.
                type: object
                properties:
                  createDate:
                    description: ISO timestamp of when the dispute was opened.
                    type: string
                    format: date-time
                required:
                  - createDate
                additionalProperties: false
              method:
                description: Payment method used.
                type: object
                properties:
                  external:
                    description: Present when type is external.
                    type: object
                    properties: {}
                    additionalProperties: false
                  paymentGateway:
                    description: Present when type is paymentGateway.
                    type: object
                    properties:
                      gateway:
                        description: Payment gateway identifier.
                        type: string
                      label:
                        description: Display label for the payment gateway.
                        type: string
                      mask:
                        description: Masked card or account identifier.
                        type: string
                      title:
                        description: Display title for the payment gateway.
                        type: string
                    required:
                      - gateway
                    additionalProperties: false
                  type:
                    description: Payment method type.
                    type: string
                    enum:
                      - external
                      - paymentGateway
                required:
                  - type
                additionalProperties: false
              price:
                description: Payment price details.
                type: object
                properties:
                  money:
                    type: object
                    properties:
                      currencyCode:
                        description: ISO currency code.
                        type: string
                      grossAmount:
                        description: Payment amount in major units.
                        type: number
                    required:
                      - currencyCode
                      - grossAmount
                    additionalProperties: false
                  type:
                    type: string
                    enum:
                      - money
                required:
                  - money
                  - type
                additionalProperties: false
              refundable:
                description: Whether this payment can be refunded.
                type: boolean
              refunds:
                description: Refunds issued against this payment.
                type: object
                properties:
                  money:
                    type: array
                    items:
                      type: object
                      properties:
                        createDate:
                          type: string
                          format: date-time
                        currencyCode:
                          type: string
                        grossAmount:
                          type: number
                        id:
                          type: string
                          format: uuid
                      required:
                        - createDate
                        - currencyCode
                        - grossAmount
                        - id
                      additionalProperties: false
                  type:
                    type: string
                    enum:
                      - money
                required:
                  - type
                additionalProperties: false
              status:
                description: Payment status.
                type: string
                enum:
                  - canceled
                  - failed
                  - pending
                  - processing
                  - succeeded
              surcharge:
                description: Payment surcharge details.
                type: object
                properties:
                  money:
                    type: object
                    properties:
                      amount:
                        description: Surcharge amount in major units.
                        type: number
                      currencyCode:
                        description: ISO currency code.
                        type: string
                      percentage:
                        description: Surcharge percentage.
                        type: number
                      rate:
                        description: Surcharge rate.
                        type: number
                    required:
                      - amount
                      - currencyCode
                    additionalProperties: false
                  type:
                    type: string
                    enum:
                      - money
                required:
                  - money
                  - type
                additionalProperties: false
              transactionRef:
                description: ID of the associated transaction.
                type: string
                format: uuid
            required:
              - createDate
              - method
              - price
              - refundable
              - status
              - transactionRef
        pdfUrl:
          description: URL to download the invoice PDF (issued invoices only).
          type: string
        postPaymentCreation:
          description: Whether this invoice was created post-payment.
          type: boolean
        postPaymentCreditAmount:
          deprecated: true
          description: Deprecated. Use baseAmounts.postPaymentCreditNotesAmount instead.
          type: number
        postPaymentCreditNotesAmount:
          description: Post-payment credit notes amount in major units.
          type: number
        prePaymentCreditAmount:
          deprecated: true
          description: Deprecated. Use baseAmounts.prePaymentCreditNotesAmount instead.
          type: number
        prePaymentCreditNotesAmount:
          description: Pre-payment credit notes amount in major units.
          type: number
        receiptPdfUrl:
          description: URL to download the receipt PDF (paid invoices only).
          type: string
        startingBalance:
          description: Customer balance at draft creation.
          type: number
        status:
          description: Invoice status.
          type: string
          enum:
            - draft
            - issued
            - paid
            - voided
        subscriptionRef:
          description: ID of the associated subscription.
          type: string
          format: uuid
        subtotalAmount:
          description: Subtotal amount in major units.
          type: number
        subtotalExcludingTaxAmount:
          description: Subtotal excluding tax in major units.
          type: number
        taxAmount:
          deprecated: true
          description: Deprecated. Use baseAmounts.taxes instead.
          type: number
        taxes:
          description: Tax breakdown.
          type: array
          items:
            type: object
            properties:
              amount:
                description: Tax amount in major units.
                type: number
              inclusive:
                description: Whether tax is included in the price.
                type: boolean
              rate:
                description: Tax rate as a decimal.
                type: number
              taxableAmount:
                description: Amount subject to tax in major units.
                type: number
            required:
              - amount
              - inclusive
              - rate
              - taxableAmount
            additionalProperties: false
        timezoneId:
          description: Timezone of the invoice.
          type: string
        title:
          description: Invoice title.
          type: string
        totalAmount:
          description: Total amount in major units.
          type: number
        totalExcludingTaxAmount:
          description: Total amount excluding tax in major units.
          type: number
        transaction:
          deprecated: true
          description: Deprecated. Use payments instead.
          type: object
          properties:
            amount:
              type: number
            createDate:
              type: string
              format: date-time
            id:
              type: string
              format: uuid
            paymentMethod:
              type: object
              properties:
                label:
                  type: string
                type:
                  type: string
              required:
                - type
              additionalProperties: false
            refund:
              type: object
              properties:
                amount:
                  type: number
                createDate:
                  type: string
                  format: date-time
              required:
                - amount
                - createDate
              additionalProperties: false
            refunds:
              type: array
              items:
                type: object
                properties:
                  amount:
                    type: number
                  createDate:
                    type: string
                    format: date-time
                  currencyCode:
                    type: string
                  id:
                    type: string
                    format: uuid
                required:
                  - amount
                  - createDate
                  - currencyCode
                  - id
                additionalProperties: false
            status:
              type: string
              enum:
                - canceled
                - failed
                - pending
                - processing
                - succeeded
          required:
            - amount
            - createDate
            - id
            - status
          additionalProperties: false
        user:
          deprecated: true
          description: Deprecated. Use customer.user instead.
        voidDate:
          description: ISO timestamp of when the invoice was voided.
          type: string
          format: date-time
      required:
        - amountDue
        - amountPaid
        - amountRemaining
        - appliedBalance
        - baseAmounts
        - createDate
        - currencyCode
        - customer
        - itemsCount
        - locationRef
        - payments
        - postPaymentCreation
        - postPaymentCreditNotesAmount
        - prePaymentCreditNotesAmount
        - status
        - subtotalAmount
        - subtotalExcludingTaxAmount
        - taxes
        - timezoneId
        - title
        - totalAmount
        - totalExcludingTaxAmount
    invoiceItem:
      type: object
      properties:
        amount:
          deprecated: true
          description: Deprecated. Use totalAmount instead.
          type: number
        baseAmounts:
          description: >-
            Amounts in the original base currency, before any alt-currency
            conversion.
          type: object
          properties:
            currencyCode:
              description: ISO currency code.
              type: string
            discountedAmount:
              description: Discount deduction in major units.
              type: number
            tax:
              description: Tax details.
              type: object
              properties:
                amount:
                  description: Tax amount in major units.
                  type: number
                inclusive:
                  description: Whether tax is included in the price.
                  type: boolean
                rate:
                  description: Tax rate as a decimal.
                  type: number
                taxableAmount:
                  description: Amount subject to tax in major units.
                  type: number
              required:
                - amount
                - inclusive
                - rate
                - taxableAmount
              additionalProperties: false
            totalAmount:
              description: Total in major units.
              type: number
            totalExcludingTaxAmount:
              description: Total excluding tax in major units.
              type: number
            unitAmount:
              description: Unit price in major units.
              type: number
            unitExcludingTaxAmount:
              description: Unit price excluding tax in major units.
              type: number
          required:
            - currencyCode
            - discountedAmount
            - totalAmount
            - totalExcludingTaxAmount
            - unitAmount
            - unitExcludingTaxAmount
          additionalProperties: false
        booking:
          deprecated: true
          description: Deprecated. Use product.bookingRef instead.
          type: object
          properties: {}
          additionalProperties: {}
        companyRef:
          description: ID of the associated company.
          type: string
          format: uuid
        createDate:
          description: ISO timestamp of when the item was created.
          type: string
          format: date-time
        creditPackage:
          deprecated: true
          description: Deprecated.
          type: object
          properties: {}
          additionalProperties: {}
        currencyCode:
          description: >-
            ISO currency code. Reflects the alt currency when present, otherwise
            the base currency.
          type: string
        deleteDate:
          description: ISO timestamp of when the item was deleted.
          type: string
          format: date-time
        description:
          deprecated: true
          description: Deprecated. Use product.title instead.
          type: string
        discountedAmount:
          description: >-
            Discount deduction in major units. Reflects the alt currency when
            present, otherwise the base currency.
          type: number
        discounts:
          description: Applied discounts.
          type: array
          items:
            type: object
            properties:
              coupon:
                description: Coupon applied to this item.
                type: object
                properties:
                  amountOff:
                    description: Fixed discount amount in major units.
                    type: number
                  currencyCode:
                    description: Currency code for amountOff.
                    type: string
                  duration:
                    description: Discount duration type.
                    type: string
                  durationInMonths:
                    description: Number of months the discount applies.
                    type: number
                  id:
                    description: Coupon ID.
                    type: string
                    format: uuid
                  percentOff:
                    description: Percentage discount.
                    type: number
                  productTypes:
                    description: Product types this coupon applies to.
                    type: array
                    items:
                      type: string
                  type:
                    description: Coupon type.
                    type: string
                additionalProperties: false
              promocode:
                description: Promocode applied to this item.
                type: object
                properties:
                  code:
                    description: Promocode string.
                    type: string
                  expiration:
                    description: Promocode expiration date.
                    type: string
                    format: date-time
                  id:
                    description: Promocode ID.
                    type: string
                    format: uuid
                  limitByFirstPurchase:
                    description: Whether limited to first purchase only.
                    type: boolean
                required:
                  - code
                  - id
                additionalProperties: false
              subscriptionId:
                description: ID of the subscription this discount is associated with.
                type: string
                format: uuid
            required:
              - coupon
            additionalProperties: false
        id:
          description: Unique identifier of the invoice item.
          type: string
        invoiceRef:
          description: ID of the invoice this item belongs to.
          type: string
          format: uuid
        locationRef:
          description: ID of the organization (location).
          type: string
          format: uuid
        membershipRef:
          description: ID of the associated membership.
          type: string
          format: uuid
        membershipRefCreatedBy:
          description: ID of the membership that created this item.
          type: string
          format: uuid
        netAmount:
          deprecated: true
          description: Deprecated. Use totalExcludingTaxAmount instead.
          type: number
        netUnitAmount:
          deprecated: true
          description: Deprecated. Use unitExcludingTaxAmount instead.
          type: number
        orderItem:
          deprecated: true
          description: Deprecated. Use product.orderRef instead.
          type: object
          properties: {}
          additionalProperties: {}
        period:
          description: Billing period for subscription items.
          type: object
          properties:
            endDate:
              description: Subscription period end date.
              type: string
              format: date-time
            startDate:
              description: Subscription period start date.
              type: string
              format: date-time
          required:
            - endDate
            - startDate
          additionalProperties: false
        plan:
          deprecated: true
          description: Deprecated. Use period instead.
          type: object
          properties: {}
          additionalProperties: {}
        product:
          description: Product details.
          type: object
          properties:
            bookingRef:
              description: ID of the associated booking.
              type: string
              format: uuid
            eventTicketRef:
              description: ID of the associated event ticket.
              type: string
              format: uuid
            optionRef:
              description: ID of the product option.
              type: string
              format: uuid
            orderRef:
              description: ID of the associated order.
              type: string
              format: uuid
            title:
              description: Display title of the product.
              type: string
            type:
              description: Type of the invoice item.
              type: string
              enum:
                - creditPackage
                - custom
                - booking
                - eventTicket
                - subscription
                - order
          required:
            - title
            - type
          additionalProperties: false
        quantity:
          description: Quantity of units.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        subscriptionRef:
          description: ID of the associated subscription.
          type: string
          format: uuid
        tax:
          description: >-
            Tax details. Reflects the alt currency when present, otherwise the
            base currency.
          type: object
          properties:
            amount:
              description: Tax amount in major units.
              type: number
            inclusive:
              description: Whether tax is included in the price.
              type: boolean
            rate:
              description: Tax rate as a decimal.
              type: number
            taxableAmount:
              description: Amount subject to tax in major units.
              type: number
          required:
            - amount
            - inclusive
            - rate
            - taxableAmount
          additionalProperties: false
        taxAmount:
          deprecated: true
          description: Deprecated. Use baseAmounts.tax.amount instead.
          type: number
        taxableAmount:
          deprecated: true
          description: Deprecated. Use baseAmounts.tax.taxableAmount instead.
          type: number
        ticket:
          deprecated: true
          description: Deprecated. Use product.eventTicketRef instead.
          type: object
          properties: {}
          additionalProperties: {}
        totalAmount:
          description: >-
            Total in major units. Reflects the alt currency when present,
            otherwise the base currency.
          type: number
        totalExcludingTaxAmount:
          description: >-
            Total excluding tax in major units. Reflects the alt currency when
            present, otherwise the base currency.
          type: number
        type:
          deprecated: true
          description: Deprecated. Use product.type instead.
          type: string
        unitAmount:
          description: >-
            Unit price in major units. Reflects the alt currency when present,
            otherwise the base currency.
          type: number
        unitExcludingTaxAmount:
          description: >-
            Unit price excluding tax in major units. Reflects the alt currency
            when present, otherwise the base currency.
          type: number
        userCreatedBy:
          description: User who created this item.
          type: object
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            surname:
              type: string
          required:
            - id
          additionalProperties: false
      required:
        - amount
        - baseAmounts
        - createDate
        - currencyCode
        - description
        - discountedAmount
        - discounts
        - id
        - locationRef
        - netAmount
        - netUnitAmount
        - product
        - quantity
        - totalAmount
        - totalExcludingTaxAmount
        - type
        - unitAmount
        - unitExcludingTaxAmount
      additionalProperties: false
    responseError:
      type: object
      properties:
        message:
          type: string
        type:
          type: string
  securitySchemes:
    BasicAuth:
      type: http
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/api-reference/authentication#basic-authentication)
        for how to authorize your requests
      scheme: basic
    OAuth2:
      type: oauth2
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/api-reference/authentication#oauth2)
        for how to authorize your requests
      flows:
        authorizationCode:
          authorizationUrl: https://api.spacebring.com/oauth2/authorize
          tokenUrl: https://api.spacebring.com/oauth2/token
          refreshUrl: https://api.spacebring.com/oauth2/token
          scopes:
            benefits.readonly: Read benefits and applications
            benefits: Read and write benefits and applications
            community.readonly: Read community companies and memberships
            community: Read and write community companies and memberships
            events.readonly: Read events and tickets
            events: Read and write events and tickets
            feed.readonly: Read feed posts
            feed: Read and write feed posts
            invoices.readonly: Read invoices
            invoices: Read and write invoices
            locations.readonly: Read locations
            locations: Read and write locations
            plans.readonly: Read plans
            plans: Read and write plans
            resources.readonly: Read resources and bookings
            resources: Read and write resources and bookings
            subscriptions.readonly: Read subscriptions
            subscriptions: Read and write subscriptions
            shop.readonly: Read products and orders
            shop: Read and write products and orders
            support.readonly: Read support tickets
            support: Read and write support tickets
            transactions.readonly: Read transactions
            transactions: Read and write transactions
            visitors.readonly: Read visitors
            visitors: Read and write visitors

````