> ## 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 credit notes

> Retrieve all credit notes for a specific invoice or location. One of invoiceRef or locationRef is required. <h3>OAuth</h3>Required scopes: <code>invoices.readonly</code> or <code>invoices</code>



## OpenAPI

````yaml /assets/openapi.json get /billing/credit_notes/v1
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/credit_notes/v1:
    get:
      tags:
        - Billing
      summary: Retrieve credit notes
      description: >-
        Retrieve all credit notes for a specific invoice or location. One of
        invoiceRef or locationRef is required. <h3>OAuth</h3>Required scopes:
        <code>invoices.readonly</code> or <code>invoices</code>
      operationId: getCreditNotes
      parameters:
        - name: invoiceRef
          in: query
          description: The id of the invoice. One of invoiceRef or locationRef is required.
          schema:
            type: string
            format: uuid
          required: false
        - name: locationRef
          in: query
          description: >-
            The id of the location. One of invoiceRef or locationRef is
            required.
          schema:
            type: string
            format: uuid
          required: false
        - name: limit
          in: query
          description: The maximum number of items to return (max 100, default 25)
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          required: false
        - in: query
          name: nextPageToken
          schema:
            $ref: '#/components/schemas/nextPageToken'
          description: Token to retrieve the next page of results.
          required: false
        - 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:
                  creditNotes:
                    type: array
                    items:
                      $ref: '#/components/schemas/creditNote'
                  nextPageToken:
                    $ref: '#/components/schemas/nextPageToken'
                  searchQueryNext:
                    $ref: '#/components/schemas/searchQueryNext'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
        '403':
          description: Forbidden - User lacks permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
        '404':
          description: Not Found - Invoice or location not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
      security:
        - BasicAuth: []
        - OAuth2:
            - invoices.readonly
            - invoices
components:
  schemas:
    nextPageToken:
      type: string
      description: >-
        Opaque cursor token for retrieving the next page of results. Pass this
        value as the `nextPageToken` query parameter in your next request.
    creditNote:
      type: object
      additionalProperties: false
      properties:
        baseAmounts:
          description: Amounts in the base currency.
          type: object
          properties:
            currencyCode:
              description: ISO currency code.
              type: string
            grossAmount:
              deprecated: true
              description: Deprecated.
              type: number
            postPaymentAmount:
              description: Post-payment credit amount in major units.
              type: number
            prePaymentAmount:
              description: Pre-payment credit amount in major units.
              type: number
            subtotalAmount:
              description: Subtotal in major units.
              type: number
            subtotalAmountExcludingTax:
              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 in major units.
              type: number
            totalExcludingTaxAmount:
              description: Total excluding tax in major units.
              type: number
          required:
            - currencyCode
            - grossAmount
            - postPaymentAmount
            - prePaymentAmount
            - subtotalAmount
            - subtotalAmountExcludingTax
            - taxes
            - totalAmount
            - totalExcludingTaxAmount
          additionalProperties: false
        createDate:
          description: ISO timestamp of when the credit note was created.
          type: string
          format: date-time
        creditAmount:
          description: Amount credited to customer balance in major units.
          type: number
        currencyCode:
          description: ISO currency code (from base or alt currency).
          type: string
        effectiveDate:
          description: Effective date in YYYY-MM-DD format.
          type: string
        grossAmount:
          deprecated: true
          description: Deprecated.
          type: number
        id:
          description: Unique identifier of the credit note.
          type: string
          format: uuid
        internalNote:
          description: Internal memo (visible to admins only).
          type: string
        invoiceRef:
          description: ID of the invoice being credited.
          type: string
          format: uuid
        lines:
          description: Credit note line items.
          type: array
          items:
            type: object
            properties:
              baseAmounts:
                description: Amounts in the base currency.
                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
                additionalProperties: false
              createDate:
                description: ISO timestamp of line item creation.
                type: string
                format: date-time
              currencyCode:
                description: ISO currency code.
                type: string
              discountedAmount:
                description: Discount deduction in major units.
                type: number
              discounts:
                description: Applied discounts.
                type: array
                items:
                  type: object
                  properties:
                    coupon:
                      description: Coupon applied.
                      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
                        type:
                          description: Coupon type.
                          type: string
                      additionalProperties: false
                    promocode:
                      description: Promocode applied.
                      type: object
                      properties:
                        code:
                          type: string
                        expiration:
                          type: string
                          format: date-time
                        id:
                          type: string
                          format: uuid
                        limitByFirstPurchase:
                          type: boolean
                      required:
                        - code
                        - id
                      additionalProperties: false
                    subscriptionId:
                      description: Associated subscription ID.
                      type: string
                      format: uuid
                  required:
                    - coupon
                  additionalProperties: false
              id:
                description: Unique identifier of the line item.
                type: string
                format: uuid
              invoiceItemRef:
                description: ID of the original invoice item.
                type: string
                format: uuid
              invoiceRef:
                description: ID of the invoice.
                type: string
                format: uuid
              locationRef:
                description: ID of the organization (location).
                type: string
                format: uuid
              networkRef:
                description: ID of the network.
                type: string
                format: uuid
              quantity:
                description: Quantity refunded.
                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
              updateDate:
                description: ISO timestamp of last update.
                type: string
                format: date-time
            required:
              - baseAmounts
              - createDate
              - currencyCode
              - discountedAmount
              - id
              - invoiceItemRef
              - invoiceRef
              - locationRef
              - networkRef
              - totalAmount
              - totalExcludingTaxAmount
              - updateDate
            additionalProperties: false
        locationRef:
          description: ID of the organization (location).
          type: string
          format: uuid
        networkRef:
          description: ID of the network.
          type: string
          format: uuid
        number:
          description: Credit note number.
          type: number
        outOfBandAmount:
          description: Out-of-band refund amount in major units.
          type: number
        pdfUrl:
          description: URL to download the credit note PDF.
          type: string
        postPaymentAmount:
          description: Post-payment credit amount in major units.
          type: number
        prePaymentAmount:
          description: Pre-payment credit amount in major units.
          type: number
        reason:
          description: Reason for the credit note.
          type: string
          enum:
            - duplicate
            - orderChange
            - productUnsatisfactory
            - fraudulent
            - other
        refunds:
          description: Refunds associated with this credit note.
          type: array
          items:
            type: object
            properties:
              amount:
                description: Refund amount in major units.
                type: number
              currencyCode:
                description: ISO currency code.
                type: string
              id:
                description: Unique identifier of the refund.
                type: string
                format: uuid
              method:
                description: Refund payment method.
                type: object
                properties:
                  label:
                    description: Payment method label.
                    type: string
                  type:
                    description: Payment method type.
                    type: string
                    enum:
                      - external
                      - paymentGateway
                required:
                  - type
                additionalProperties: false
              transactionRef:
                description: ID of the transaction being refunded.
                type: string
                format: uuid
            required:
              - amount
              - currencyCode
              - id
              - transactionRef
            additionalProperties: false
        status:
          description: Credit note status.
          type: string
          enum:
            - issued
            - voided
        subtotalAmount:
          description: Subtotal in major units.
          type: number
        subtotalAmountExcludingTax:
          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
        title:
          description: Credit note title.
          type: string
        totalAmount:
          description: Total in major units.
          type: number
        totalExcludingTaxAmount:
          description: Total excluding tax in major units.
          type: number
        type:
          description: Credit note type.
          type: string
          enum:
            - prePayment
            - postPayment
            - mixed
        updateDate:
          description: ISO timestamp of last update.
          type: string
          format: date-time
        voidDate:
          description: ISO timestamp of when the credit note was voided.
          type: string
          format: date-time
      required:
        - baseAmounts
        - createDate
        - currencyCode
        - grossAmount
        - id
        - invoiceRef
        - lines
        - locationRef
        - networkRef
        - pdfUrl
        - postPaymentAmount
        - prePaymentAmount
        - reason
        - status
        - subtotalAmount
        - subtotalAmountExcludingTax
        - taxes
        - title
        - totalAmount
        - totalExcludingTaxAmount
        - type
        - updateDate
    searchQueryNext:
      type: string
      description: >-
        Pre-built query string for the next page of results. Contains all active
        filter parameters combined with the next page token, ready to append to
        the endpoint URL.
    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

````