---
title: "Import credit note"
method: POST
path: "/credit_notes"
tags: ["Credit Notes"]
---

# Import credit note

`POST /credit_notes`

## Request

- Base URL: `https://api.upflow.io/v1`
- URL: `https://api.upflow.io/v1/credit_notes`
- Auth: API key in header `X-Api-Key` and API key in header `X-Api-Secret`

This endpoint can be used to create or update (if externalId already
exists) a credit note.

It cannot be used when using a native integration as credit notes are
only created by the native integration in that case.

## Request body

- CreditNoteCreation: Common attributes for credit notes.
  - `customId` string, required: Credit note custom identifier (e.g., document number).
  - `externalId` string: Credit note external identifier.
  - `issuedAt` string, date-time: The date at which the credit note was issued (ISO 8601 format).
  - `dueDate` string, date-time: The date when the credit note is due (ISO 8601 format). Often same as issuedAt.
  - `name` string: The credit note name or description.
  - `currency` 'EUR' | 'CHF' | 'USD' | 'CAD' | 'GBP', required: ISO 4217 Currency Code
  - `grossAmount` integer, required: Amount including taxes (in cents).
  - `netAmount` integer, required: Amount net of taxes (in cents).
  - `updatedAt` string, date-time: The date at which the credit note was last updated (ISO 8601 format).
  - `customer` union, required: Reference to a customer, identifiable by ID or external ID.
    - object
      - `id` string, uuid, required: The Customer ID.
      - `externalId` string: An external ID that uniquely references the customer.
    - object
      - `id` string, uuid: The Customer ID.
      - `externalId` string, required: An external ID that uniquely references the customer.
  - `linkedInvoices` LinkedInvoiceCreation[]: The list of invoices to link to this credit note upon creation.
    - `amountLinked` integer, required: Amount allocated to the invoice (in cents).
    - `invoice` InvoiceReference, required: Reference to an invoice, identifiable by ID, external ID, or custom ID.
      - `id` string, uuid: Invoice ID.
      - `externalId` string: Invoice external ID.
      - `customId` string: Invoice custom ID.

## Response `201`

Credit Note Created or Updated

- CreditNote: Common attributes for credit notes.
  - `customId` string, required: Credit note custom identifier (e.g., document number).
  - `externalId` string: Credit note external identifier.
  - `issuedAt` string, date-time: The date at which the credit note was issued (ISO 8601 format).
  - `dueDate` string, date-time: The date when the credit note is due (ISO 8601 format). Often same as issuedAt.
  - `name` string: The credit note name or description.
  - `currency` 'EUR' | 'CHF' | 'USD' | 'CAD' | 'GBP', required: ISO 4217 Currency Code
  - `grossAmount` integer, required: Amount including taxes (in cents).
  - `netAmount` integer, required: Amount net of taxes (in cents).
  - `updatedAt` string, date-time: The date at which the credit note was last updated (ISO 8601 format).
  - `id` string, uuid, required: The Credit Note ID.
  - `pdfUrl` string, uri, nullable: URL to the credit note PDF.
  - `customer` CustomerLite, required: Minimal customer information.
    - `id` string, uuid, required: The Customer ID.
    - `externalId` string: An external ID that uniquely references the customer.
    - `companyName` string, required: Customer name.
    - `accountingRef` string: (Deprecated) Customer accounting reference (used in accounting tool). Use a custom field instead.
  - `linkedInvoices` LinkedInvoice[], required: The list of invoices linked to this credit note.
    - `amountLinked` integer, required: Amount allocated to the invoice (in cents).
    - `invoice` InvoiceLite, required: Minimal invoice information.
      - `id` string, uuid, required: The Invoice ID.
      - `currency` 'EUR' | 'CHF' | 'USD' | 'CAD' | 'GBP', required: ISO 4217 Currency Code
      - `status` 'DUE' | 'OVERDUE' | 'PAID' | 'WRITTEN_OFF' | 'DISPUTED', required: Status of the invoice.
      - `amountOutstanding` integer, required: Outstanding amount (in cents).
      - `customId` string: Invoice custom identifier.
      - `grossAmount` integer, required: Amount including taxes (in cents).
      - `netAmount` integer, required: Amount net of taxes (in cents).
      - `name` string: The invoice name or description.
      - `issuedAt` string, date-time, required: The date at which the invoice was issued (ISO 8601 format).
      - `dueDate` string, date-time, required: The date when the invoice is due (ISO 8601 format).
      - `paidDate` string, date-time, nullable: The date when the invoice was paid (ISO 8601 format).
      - `externalId` string: Invoice external identifier.
  - `createdAt` string, date-time: The date at which the credit note was created (ISO 8601 format).

---

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