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

# Import credit notes (max 100)



## OpenAPI

````yaml https://public.leanpay.fr/openapi/leanpay_api_documentation.swagger.yaml post /credit-notes/batch
openapi: 3.1.1
info:
  version: 1.0.0
  title: LeanPay Api documentation
  contact:
    email: integration@leanpay.fr
servers:
  - url: https://api.leanpay.fr/v1/public
security: []
tags:
  - name: clients
    description: Routes related to clients
  - name: invoices
    description: Routes related to invoices
  - name: credit-notes
    description: Routes related to credit notes
  - name: misc-operations
    description: Routes related to misc operations
  - name: contacts
    description: Routes related to client contacts
  - name: addresses
    description: Routes related to client addresses
  - name: payments
    description: Routes related to invoice payments
  - name: portal-payments
    description: >-
      Routes related to portal payments (online payments made by debtors from
      the customer portal)
  - name: paybacks
    description: Routes related to credit note paybacks
  - name: links
    description: Routes related to invoice/credit note links
  - name: comments
    description: Routes related to comments
  - name: deleted-elements
    description: Routes related to deleted elements
  - name: client-properties
    description: Routes related to client properties
paths:
  /credit-notes/batch:
    post:
      tags:
        - credit-notes
      summary: Import credit notes (max 100)
      requestBody:
        description: Credit notes objects to import
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                creditNotes:
                  type: array
                  maxItems: 100
                  items:
                    $ref: '#/components/schemas/CreditNoteCreate'
      responses:
        '200':
          description: Returns the imported credit notes
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CreditNoteResponse'
        '400':
          description: Response sent when the credit note object provided is invalid
        '404':
          description: Client not found
        '409':
          description: Credit note already exist
      security:
        - authorization: []
components:
  schemas:
    CreditNoteCreate:
      type: object
      properties:
        clientId:
          type: string
          format: uuid
        externalId:
          type:
            - string
            - 'null'
          maxLength: 80
        reference:
          type: string
          maxLength: 80
        amount:
          type: integer
          minimum: 0
        netAmount:
          type: integer
          minimum: 0
        issueDate:
          type: string
          format: date
        dueDate:
          type: string
          format: date
      required:
        - clientId
        - reference
        - amount
        - netAmount
        - issueDate
        - dueDate
    CreditNoteResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        tenantId:
          type: string
          format: uuid
        clientId:
          type: string
          format: uuid
        externalId:
          type:
            - string
            - 'null'
        reference:
          type: string
        amount:
          type: integer
        remainingAmount:
          type: integer
        paybackAmount:
          type: integer
        deductedAmount:
          type: integer
        issueDate:
          type: string
          format: date-time
        paybacks:
          type: array
          items:
            $ref: '#/components/schemas/PaymentOrPaybackOutput'
        invoiceLinks:
          type: array
          items:
            $ref: '#/components/schemas/CreditNoteToInvoiceLinkOutput'
        status:
          type: string
          description: Credit note status
          enum:
            - available
            - deducted
            - disputed
            - recovery
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    PaymentOrPaybackOutput:
      allOf:
        - $ref: '#/components/schemas/AmountAndDefaultCurrencyAmount'
        - type: object
          properties:
            date:
              type: string
              format: date-time
            externalId:
              type:
                - string
                - 'null'
              maxLength: 80
          required:
            - date
    CreditNoteToInvoiceLinkOutput:
      allOf:
        - $ref: '#/components/schemas/AmountAndDefaultCurrencyAmountNullable'
        - type: object
          properties:
            date:
              type: string
              format: date-time
            externalId:
              type: string
              maxLength: 80
            invoice:
              type: object
              properties:
                id:
                  type: string
                  format: uuid
                externalId:
                  type:
                    - string
                    - 'null'
          required:
            - date
    AmountAndDefaultCurrencyAmount:
      type: object
      properties:
        amount:
          type: number
          minimum: 0
        defaultCurrencyAmount:
          type: number
          minimum: 0
    AmountAndDefaultCurrencyAmountNullable:
      type: object
      properties:
        amount:
          type:
            - number
            - 'null'
          minimum: 0
        defaultCurrencyAmount:
          type:
            - number
            - 'null'
          minimum: 0
  securitySchemes:
    authorization:
      type: apiKey
      name: Authorization
      in: header

````