---
title: "Import a credit note"
method: POST
path: "/invoices/{invoiceId}/credit_notes"
tags: ["Invoices"]
---

# Import a credit note

`POST /invoices/{invoiceId}/credit_notes`

## Request

- Base URL: `https://api.adfin.com/api`
- URL: `https://api.adfin.com/api/invoices/{invoiceId}/credit_notes`
- Auth: one of:
  - OAuth 2
    - Client credentials
    - Token URL: `https://api.staging.adfin.com/api/oauth2/token`
  - OAuth 2
    - Client credentials
    - Token URL: `https://api.adfin.com/api/oauth2/token`
- TypeScript: <https://skmtc.dev/adfin/apis/adfin-api/docs/invoices/:invoiceId/credit_notes/post.ts> (a function with typed inputs; its response is checked against the schema)

Apply a credit note from another system to an invoice. The credit note lowers the amount due. The invoice must still take payments.

## Path parameters

- `invoiceId` string, uuid, required: The id of the invoice

## Request body

- ImportCreditNoteRequest: A credit note to apply to an invoice.
  - `number` string, required: The credit note number. A number can be used once per invoice. It can be used again after that credit note is cancelled.
  - `amount` number, required: The credit note amount. It lowers the amount due of the invoice and cannot be more than the amount due.
  - `valueDate` string, date-time: The date when the credit note was applied.

## Response `201`

Credit note successfully imported.

- CreditNoteResponse: Credit note details.
  - `id` string: Credit note id.
  - `number` string: Credit note number.
  - `amount` number: Credit note amount.
  - `valueDate` string, date-time: Date when credit note was applied.
  - `externalData` CreditNoteExternalData[]: References about this credit note from external platforms Adfin integrates with. Such as ID etc
    - `connectorType` 'XERO' | 'QUICKBOOKS' | 'PLATFORM': The name of the platform for which this data is stored for.
    - `id` string: ID of the Credit Note in the external platform

## Other responses

- `400`: A problem reading or understanding the request. Ensure that the request complies with the required format and includes all necessary parameters.
- `401`: Authentication required.
- `404`: The invoice does not exist.
- `422`: The invoice does not take payments, the number was already used, or the amount is more than the amount due.
- `500`: The server could not process the request.

## Changes

- **2026-11-03** `d088b6522cdb`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/adfin/apis/adfin-api/changes/invoices/:invoiceId/credit_notes/post.md)

---

[API](https://skmtc.dev/adfin/apis/adfin-api.md) - [All operations](https://skmtc.dev/adfin/apis/adfin-api/llms.txt) - [OpenAPI document](https://skmtc.dev/adfin/apis/adfin-api/revisions/72a74f027a38?raw)
