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

# Apply a Credit Note to an Invoice

> Allocates an amount from a Credit Note's balance to an Invoice's balance.



## OpenAPI

````yaml invoices.latest.product.live POST /credit-note-applications
openapi: 3.0.0
info:
  title: Invoices
  description: Create and issue invoices
  version: '0.1'
servers:
  - url: https://dev.seqhq.io/api
    description: DEV
  - url: https://sandbox.sequencehq.com/api
    description: SANDBOX
  - url: https://eu.sequencehq.com/api
    description: PRODUCTION
security: []
tags: []
paths:
  /credit-note-applications:
    servers: []
    parameters: []
    post:
      tags:
        - Credit Notes
      summary: Apply a Credit Note to an Invoice
      description: >-
        Allocates an amount from a Credit Note's balance to an Invoice's
        balance.
      operationId: postCreditNoteApplications
      parameters:
        - name: Authorization
          in: header
          description: >-
            Your [API credentials](/reference/authentication). Eg. `Basic
            {credentials}`.
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          description: >-
            Unique ID for this request (max 255 characters). Retrying with the
            same ID is safe; the operation runs at most once.
          required: true
          schema:
            type: string
        - name: Sequence-Version
          in: header
          description: Use this header to select an API version
          required: false
          schema:
            type: string
            enum:
              - '2024-07-30'
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/CreateCreditNoteApplicationEndpointCreateCreditNoteApplicationRequestModel
              example:
                creditNoteId: af60cab3-812d-4250-a051-0fb7133a00c7
                invoiceId: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
                amount: 50
                currency: USD
                creditNoteBalanceVersion: 3
                invoiceBalanceVersion: 7
            examples:
              CreateCreditNoteApplicationEndpointCreateCreditNoteApplicationRequestModel:
                summary: ''
                value:
                  creditNoteId: af60cab3-812d-4250-a051-0fb7133a00c7
                  invoiceId: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
                  amount: 50
                  currency: USD
                  creditNoteBalanceVersion: 3
                  invoiceBalanceVersion: 7
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditNoteApplicationResponse'
                example:
                  ledgerTransactionId: 0192c1b6-7f3a-7000-8000-000000000001
                  creditNoteId: af60cab3-812d-4250-a051-0fb7133a00c7
                  invoiceId: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
                  amount: 50
                  currency: USD
                  appliedAt: '2026-05-28T12:34:56Z'
                  invoiceBalance:
                    value: 150
                    currency: USD
                    version: 8
                  creditNoteBalance:
                    value: 50
                    currency: USD
                    version: 4
              examples:
                CreditNoteApplicationResponse:
                  summary: ''
                  value:
                    ledgerTransactionId: 0192c1b6-7f3a-7000-8000-000000000001
                    creditNoteId: af60cab3-812d-4250-a051-0fb7133a00c7
                    invoiceId: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
                    amount: 50
                    currency: USD
                    appliedAt: '2026-05-28T12:34:56Z'
                    invoiceBalance:
                      value: 150
                      currency: USD
                      version: 8
                    creditNoteBalance:
                      value: 50
                      currency: USD
                      version: 4
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionConflictResponse'
                example:
                  message: >-
                    Balance version mismatch. Re-read current versions and
                    retry.
                  currentInvoiceBalance:
                    value: 150
                    currency: USD
                    version: 8
                  currentCreditNoteBalance:
                    value: 50
                    currency: USD
                    version: 4
              examples:
                VersionConflictResponse:
                  summary: ''
                  value:
                    message: >-
                      Balance version mismatch. Re-read current versions and
                      retry.
                    currentInvoiceBalance:
                      value: 150
                      currency: USD
                      version: 8
                    currentCreditNoteBalance:
                      value: 50
                      currency: USD
                      version: 4
        '500':
          description: Internal Server Error
          content: {}
components:
  schemas:
    CreateCreditNoteApplicationEndpointCreateCreditNoteApplicationRequestModel:
      required:
        - amount
        - creditNoteBalanceVersion
        - creditNoteId
        - currency
        - invoiceBalanceVersion
        - invoiceId
      type: object
      example:
        creditNoteId: af60cab3-812d-4250-a051-0fb7133a00c7
        invoiceId: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
        amount: 50
        currency: USD
        creditNoteBalanceVersion: 3
        invoiceBalanceVersion: 7
      properties:
        creditNoteId:
          type: string
          description: The Credit Note to draw from
          example: af60cab3-812d-4250-a051-0fb7133a00c7
        invoiceId:
          type: string
          description: The Invoice to apply credit to
          example: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
        amount:
          type: number
          description: Amount to allocate from the Credit Note to the Invoice.
          example: 50
        currency:
          $ref: '#/components/schemas/Currency'
          description: >-
            Currency of the amount. Must match the Credit Note and Invoice
            currency.
        creditNoteBalanceVersion:
          type: integer
          description: Expected current balance version of the Credit Note (for OCC)
          format: int64
          example: 3
        invoiceBalanceVersion:
          type: integer
          description: Expected current balance version of the Invoice (for OCC)
          format: int64
          example: 7
    CreditNoteApplicationResponse:
      required:
        - amount
        - appliedAt
        - creditNoteBalance
        - creditNoteId
        - currency
        - invoiceBalance
        - invoiceId
        - ledgerTransactionId
      type: object
      example:
        ledgerTransactionId: 0192c1b6-7f3a-7000-8000-000000000001
        creditNoteId: af60cab3-812d-4250-a051-0fb7133a00c7
        invoiceId: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
        amount: 50
        currency: USD
        appliedAt: '2026-05-28T12:34:56Z'
        invoiceBalance:
          value: 150
          currency: USD
          version: 8
        creditNoteBalance:
          value: 50
          currency: USD
          version: 4
      properties:
        ledgerTransactionId:
          type: string
          description: Ledger transaction id that recorded the application
          example: 0192c1b6-7f3a-7000-8000-000000000001
        creditNoteId:
          type: string
          example: af60cab3-812d-4250-a051-0fb7133a00c7
        invoiceId:
          type: string
          example: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
        amount:
          type: number
          description: Amount applied
          example: 50
        currency:
          $ref: '#/components/schemas/Currency'
        appliedAt:
          type: string
          format: date-time
          example: '2026-05-28T12:34:56Z'
        invoiceBalance:
          $ref: '#/components/schemas/BalanceResponse'
        creditNoteBalance:
          $ref: '#/components/schemas/BalanceResponse'
    VersionConflictResponse:
      required:
        - currentCreditNoteBalance
        - currentInvoiceBalance
        - message
      type: object
      example:
        message: Balance version mismatch. Re-read current versions and retry.
        currentInvoiceBalance:
          value: 150
          currency: USD
          version: 8
        currentCreditNoteBalance:
          value: 50
          currency: USD
          version: 4
      properties:
        message:
          type: string
          description: Human-readable conflict explanation
          example: Balance version mismatch. Re-read current versions and retry.
        currentInvoiceBalance:
          $ref: '#/components/schemas/BalanceResponse'
        currentCreditNoteBalance:
          $ref: '#/components/schemas/BalanceResponse'
    Currency:
      type: string
      example: GBP
      enum:
        - AED
        - ARS
        - AUD
        - BRL
        - BGN
        - CAD
        - CHF
        - CLP
        - CNY
        - COP
        - CZK
        - DKK
        - EGP
        - EUR
        - GBP
        - HKD
        - ILS
        - INR
        - ISK
        - JPY
        - KRW
        - MXN
        - NOK
        - NZD
        - PLN
        - SAR
        - SEK
        - SGD
        - THB
        - USD
        - UYU
        - ZAR
    BalanceResponse:
      required:
        - currency
        - value
        - version
      type: object
      example:
        value: 150
        currency: USD
        version: 8
      properties:
        value:
          type: number
          description: Balance value
          example: 150
        currency:
          $ref: '#/components/schemas/Currency'
          description: Balance currency
        version:
          type: integer
          description: Balance version for optimistic concurrency control
          format: int64
          example: 8

````