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

# Credit Notes API — retrieve refund credit notes

> Retrieve credit notes that Borga issues automatically when a refund is processed against a paid invoice. Filter by invoice ID to find related documents.

A credit note is a legal document that records a reduction in the amount owed on an invoice. Borga generates credit notes automatically whenever a refund is processed against a paid invoice. You cannot create credit notes directly — retrieve them here to reconcile refunds in your accounting system.

<Note>
  Credit notes are created automatically when a refund is processed. You can filter by `invoice` to find all credit notes associated with a specific invoice.
</Note>

***

## List credit notes

`GET /v1/credit_notes`

Returns a paginated list of credit notes, ordered by creation date descending.

### Query parameters

<ParamField query="invoice" type="string">
  Filter by invoice ID. Returns only credit notes issued against the specified invoice.
</ParamField>

<ParamField query="limit" type="number">
  Maximum number of credit notes to return per page.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url "https://api.borga.is/v1/credit_notes?invoice=inv_01hx9z3k2mfq7nbvd4cw8ej5rt" \
    --header "Authorization: Bearer sk_live_..." \
    --header "X-Merchant-Id: mer_xxx"
  ```
</RequestExample>

### Response fields

<ResponseField name="data" type="object[]" required>
  Array of credit note objects.

  <Expandable title="credit note fields">
    <ResponseField name="id" type="string" required>
      Unique credit note identifier.
    </ResponseField>

    <ResponseField name="invoice" type="string" required>
      ID of the invoice this credit note was issued against.
    </ResponseField>

    <ResponseField name="amount" type="number" required>
      Amount credited.
    </ResponseField>

    <ResponseField name="currency" type="string" required>
      Three-letter ISO 4217 currency code.
    </ResponseField>

    <ResponseField name="reason" type="string">
      Reason for the credit note.
    </ResponseField>

    <ResponseField name="status" type="string" required>
      Current status of the credit note.
    </ResponseField>

    <ResponseField name="created_at" type="string" required>
      ISO 8601 timestamp of when the credit note was created.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="has_more" type="boolean" required>
  Whether more credit notes exist beyond this page.
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": [
      {
        "id": "cn_01hx9z3k2mfq7nbvd4cw8ej5rt",
        "invoice": "inv_01hx9z3k2mfq7nbvd4cw8ej5rt",
        "amount": 4990,
        "currency": "ISK",
        "reason": "duplicate",
        "status": "issued",
        "created_at": "2026-04-29T14:30:00Z"
      }
    ],
    "has_more": false
  }
  ```
</ResponseExample>

***

## Retrieve a credit note

`GET /v1/credit_notes/{id}`

Retrieves the details of an existing credit note.

### Path parameters

<ParamField path="id" type="string" required>
  The ID of the credit note to retrieve.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.borga.is/v1/credit_notes/cn_01hx9z3k2mfq7nbvd4cw8ej5rt \
    --header "Authorization: Bearer sk_live_..." \
    --header "X-Merchant-Id: mer_xxx"
  ```
</RequestExample>

### Response fields

<ResponseField name="id" type="string" required>
  Unique credit note identifier.
</ResponseField>

<ResponseField name="invoice" type="string" required>
  ID of the invoice this credit note was issued against.
</ResponseField>

<ResponseField name="amount" type="number" required>
  Amount credited.
</ResponseField>

<ResponseField name="currency" type="string" required>
  Three-letter ISO 4217 currency code.
</ResponseField>

<ResponseField name="reason" type="string">
  Reason for the credit note (e.g. `duplicate`, `fraudulent`, `order_change`, `product_unsatisfactory`).
</ResponseField>

<ResponseField name="status" type="string" required>
  Current status of the credit note.
</ResponseField>

<ResponseField name="created_at" type="string" required>
  ISO 8601 timestamp of when the credit note was created.
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "cn_01hx9z3k2mfq7nbvd4cw8ej5rt",
    "invoice": "inv_01hx9z3k2mfq7nbvd4cw8ej5rt",
    "amount": 4990,
    "currency": "ISK",
    "reason": "duplicate",
    "status": "issued",
    "created_at": "2026-04-29T14:30:00Z"
  }
  ```
</ResponseExample>
