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

# Create supplier credit note

> Create a supplier (AP) credit note in Draft against a supplier. Amount is the gross (tax-inclusive) credit, positive. Issue it separately to make the credit available; apply it to a bill to net it down.



## OpenAPI

````yaml /api-reference/openapi.json post /suppliers/{supplierId}/credit-notes
openapi: 3.1.1
info:
  title: Dolfin API
  description: >-
    Dolfin API for AR & AP. Authenticate using the `x-dolfin-api-key` header
    with the API key distributed to your organisation.
  version: v1
servers:
  - url: https://api.dolfinai.co
    description: Production
security:
  - {}
tags:
  - name: Webhooks
  - name: Users
  - name: TaxRates
  - name: Suppliers
  - name: Supplier Credit Notes
  - name: Bills
  - name: SpendCategories
  - name: Payables
  - name: RecurringInvoices
  - name: Receivables
  - name: Purchase Orders
  - name: Products
  - name: Payments
  - name: Invoices
  - name: Organisations
  - name: Members
  - name: MCP
  - name: Matching
  - name: Invoice Reminders
  - name: Industries
  - name: Gmail
  - name: Delivery Notes
  - name: Customers
  - name: Currencies
  - name: Credit Notes
  - name: Clients
  - name: ClientInvites
  - name: BankPayments
  - name: Bank details
  - name: Auth
  - name: ApprovalPolicies
  - name: ApiKeys
  - name: Agent
paths:
  /suppliers/{supplierId}/credit-notes:
    post:
      tags:
        - Supplier Credit Notes
      summary: Create supplier credit note
      description: >-
        Create a supplier (AP) credit note in Draft against a supplier. Amount
        is the gross (tax-inclusive) credit, positive. Issue it separately to
        make the credit available; apply it to a bill to net it down.
      parameters:
        - name: supplierId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSupplierCreditNoteRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SupplierCreditNoteResponse'
        '400':
          description: >-
            SupplierCreditNote.InvalidAmount — supplier credit note amount must
            be greater than zero


            SupplierCreditNote.InvalidCurrency — currency code is not valid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: >-
            SupplierCreditNote.SupplierNotFound — no supplier with that id for
            this organisation


            SupplierCreditNote.BillNotFound — no bill with that id for this
            organisation


            TaxRate.NotFound — a referenced tax rate does not exist or belongs
            to a different organisation
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: >-
            SupplierCreditNote.SupplierMismatch — the bill belongs to a
            different supplier than the credit note


            SupplierCreditNote.CommandFailed — the supplier credit note command
            was rejected by the saga (state conflict)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    CreateSupplierCreditNoteRequest:
      required:
        - currency
      type: object
      properties:
        amount:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - number
            - string
          description: Gross (tax-inclusive) credit amount. Must be greater than zero.
          format: double
        currency:
          type: string
          description: ISO 4217 currency code (e.g. GBP, USD, EUR).
        taxRateId:
          type:
            - 'null'
            - string
          description: >-
            Optional tax rate to apply (an org rate or country default). Omit
            for a zero-rated credit; the net/tax split is computed from it.
          format: uuid
        originalBillId:
          type:
            - 'null'
            - string
          description: >-
            Optional id of the bill this credit relates to — header-level
            provenance only.
          format: uuid
        reason:
          type:
            - 'null'
            - string
          description: Optional human-readable reason for the credit.
    SupplierCreditNoteResponse:
      required:
        - currency
      type: object
      properties:
        id:
          type: string
          format: uuid
        organisationId:
          type: string
          format: uuid
        supplierId:
          type: string
          format: uuid
        documentNumber:
          type:
            - 'null'
            - string
        amount:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - number
            - string
          description: Gross (tax-inclusive) credit amount, always positive.
          format: double
        netAmount:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - number
            - string
          description: Net (ex-tax) portion of the credit. NetAmount + TaxAmount == Amount.
          format: double
        taxAmount:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - number
            - string
          description: VAT/tax portion of the credit.
          format: double
        appliedAmount:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - number
            - string
          description: How much of Amount has been netted against bills.
          format: double
        available:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - number
            - string
          description: Remaining credit available to apply (Amount - AppliedAmount).
          format: double
        taxRateId:
          type:
            - 'null'
            - string
          description: Soft reference to the tax rate applied. Null on a zero-rated credit.
          format: uuid
        taxRateSnapshot:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TaxRateSnapshotResponse'
              description: >-
                Frozen copy of the tax rate applied — the source of truth. Null
                on a zero-rated credit.
        originalBillId:
          type:
            - 'null'
            - string
          description: >-
            Optional id of the bill this credit relates to (header-level
            provenance).
          format: uuid
        currency:
          type: string
          description: ISO 4217 currency code (e.g. GBP, USD, EUR).
        reason:
          type:
            - 'null'
            - string
        source:
          $ref: '#/components/schemas/SupplierCreditNoteSource'
          description: 'How the credit note was ingested: Manual or Ocr.'
        status:
          $ref: '#/components/schemas/SupplierCreditNoteState'
        issuedAt:
          type:
            - 'null'
            - string
          format: date-time
        createdAt:
          type: string
          format: date-time
        createdBy:
          type:
            - 'null'
            - string
          format: uuid
        updatedAt:
          type: string
          format: date-time
        updatedBy:
          type:
            - 'null'
            - string
          format: uuid
    ProblemDetails:
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
        title:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string
    TaxRateSnapshotResponse:
      required:
        - code
        - name
        - source
      type: object
      properties:
        code:
          type: string
        name:
          type: string
        rate:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - number
            - string
          format: double
        source:
          type: string
        sourceId:
          type:
            - 'null'
            - string
          format: uuid
        snapshottedAt:
          type: string
          format: date-time
    SupplierCreditNoteSource:
      enum:
        - Manual
        - Ocr
    SupplierCreditNoteState:
      enum:
        - Draft
        - Issued
        - PartiallyApplied
        - Applied

````