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

# Apply credit note to invoices



## OpenAPI

````yaml api-reference/openapi.json post /api/credit-notes/{creditNoteId}/apply-invoices
openapi: 3.0.0
info:
  title: Bigcapital
  description: Financial accounting software
  version: '1.0'
  contact: {}
servers: []
security: []
tags: []
paths:
  /api/credit-notes/{creditNoteId}/apply-invoices:
    post:
      tags:
        - Credit Notes Apply Invoice
      summary: Apply credit note to invoices
      operationId: CreditNotesApplyInvoiceController_applyCreditNoteToInvoices
      parameters:
        - name: Authorization
          in: header
          description: >-
            Value must be 'Bearer <token>' where <token> is an API key prefixed
            with 'bc_' or a JWT token.
          required: true
          schema:
            type: string
            example: Bearer bc_1234567890abcdef
        - name: organization-id
          in: header
          description: >-
            Required if Authorization is a JWT token. The organization ID to
            operate within.
          required: true
          schema:
            type: string
        - name: creditNoteId
          required: true
          in: path
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplyCreditNoteToInvoicesDto'
      responses:
        '200':
          description: Credit note successfully applied to invoices
        '400':
          description: Invalid input data
        '404':
          description: Credit note not found
components:
  schemas:
    ApplyCreditNoteToInvoicesDto:
      type: object
      properties:
        entries:
          description: Entries of invoice ID and amount to apply
          example:
            - invoice_id: 1
              amount: 100.5
            - invoice_id: 2
              amount: 50
          type: array
          items:
            $ref: '#/components/schemas/ApplyCreditNoteInvoiceEntryDto'
      required:
        - entries
    ApplyCreditNoteInvoiceEntryDto:
      type: object
      properties:
        invoiceId:
          type: number
          description: Invoice ID to apply credit to
          example: 1
        amount:
          type: number
          description: Amount to apply
          example: 100.5
      required:
        - invoiceId
        - amount

````