> ## Documentation Index
> Fetch the complete documentation index at: https://creditor-documentation.debbiecollect.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Settlements

> Post a settlement: what you are paid, what you are charged, and what is already in your books

A settlement — a *billing* in the API — is the periodic account between you and
your debt collection partner. It says how the money collected on your cases was
split, and what you are charged for the work. It ends either in a payout to you
or in an amount you owe.

Posting one correctly means fetching **both** halves of it. The payments and how
they were split are one endpoint; the fees and disbursements are another. Take
only the first and the account is half posted.

## The flow

<Steps>
  <Step title="billings.create fires">
    Debbie calls your webhook endpoint with a `billingId`.
  </Step>

  <Step title="Fetch the deposit distribution">
    `GET /billings/{billingId}/deposit-distribution` — every payment in the
    settlement, and how each was split between you and your collection partner.
  </Step>

  <Step title="Fetch the billing vouchers">
    `GET /billings/{billingId}/billing-vouchers` — the fees (honorarer) and
    disbursements (udlæg) you are charged.
  </Step>

  <Step title="Post it">
    Revenue, commission, fees, disbursements, overpayments and the net amount.
  </Step>
</Steps>

## 1. The webhook

```json theme={null}
{
  "event": "billings.create",
  "time": "2026-07-01T02:15:03.221Z",
  "data": {
    "billingId": "9c1f2b3a-4d5e-6f70-8192-a3b4c5d6e7f8",
    "id": 40218,
    "date": "2026-06-30T22:00:00.000Z",
    "billingAppendixId": "869cd519-beb7-4c8c-a854-760df763daad",
    "creditorId": "a7fcf07c-74f2-40d9-8ea6-e67b07b14ca4",
    "currency": "DKK"
  }
}
```

Verify the `X-Verification-Token` header, acknowledge with 200, and do the
fetching asynchronously. A webhook of yours only ever carries your own
creditor's events. See [Webhooks](/api-reference/webhooks/introduction) for
delivery and retry behaviour, and
[Create webhook](/api-reference/endpoints/webhooks/create) to subscribe.

If you would rather not run a webhook receiver at all, the settlement is also
in the creditor portal, and the `billingId` is all these endpoints need.

## 2. The deposit distribution

```
GET /v1/{tenantId}/billings/{billingId}/deposit-distribution
```

One entry per payment in the settlement. Each says which case and customer the
payment belongs to, which entries it was distributed across, how much of it was
an overpayment, and which of the distributed amounts your collection partner
charges commission on.

```json theme={null}
{
  "meta": { "currentPage": 0, "pageSize": 25 },
  "items": [
    {
      "currency": "DKK",
      "isAdjustment": false,
      "depositCaseVoucher": {
        "caseVoucherId": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
        "id": 118067630,
        "amount": 250000,
        "source": "COLLECTOR",
        "state": "PARTIAL_PAYMENT",
        "paymentType": "BANK_TRANSFER",
        "transactionAccountId": "6f2a1c8e-9b0d-4e3f-8a71-2c4d5e6f7a8b"
      },
      "customer": { "referenceId": "CUST-40218" },
      "case": {
        "caseId": "3f1c2d4e-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
        "id": 10427,
        "groupId": "0b1a0f3c-6c1d-4b8f-9b6b-6f6a1f2e7a10",
        "groupLabel": "Consumer"
      },
      "caseVouchers": [
        {
          "caseVoucherId": "7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d",
          "referenceId": "D12412347",
          "voucherTypeId": "eb41e58e-fccf-419d-a771-cd5027fe6e87",
          "amount": 200000,
          "source": "CREDITOR",
          "collectionCommission": true
        },
        {
          "caseVoucherId": "2d3e4f50-6a7b-8c9d-0e1f-2a3b4c5d6e7f",
          "referenceId": null,
          "voucherTypeId": "4c3ccbbf-0651-45b2-b37b-4fe736acfd7e",
          "amount": 50000,
          "source": "COLLECTOR",
          "collectionCommission": false
        }
      ],
      "overpayment": 0
    }
  ]
}
```

### Reading it

* **`customer.referenceId` is your customer number** and
  **`caseVouchers[].referenceId` is your invoice number** — the values you sent
  in. This is what makes the settlement postable: each amount lands on the
  invoice it paid.
* **`depositCaseVoucher.amount` is the payment.** `caseVouchers` is what it was
  distributed to, and those amounts plus `overpayment` add up to it.
* **`overpayment`** is the part that exceeded the debt. It is owed back to the
  debtor, not to you, and needs its own account.

### `source` is what tells you what is already in your books

Every entry carries `source`:

* **`CREDITOR`** — you imposed it. The invoice, the reminder fee, the
  compensation fee you sent at handover, and the direct payments you registered
  yourself. **You already have these postings**, so a distribution to them is
  money against a receivable you already carry.
* **`COLLECTOR`** — your debt collection partner imposed it. Collection fees,
  court fees, interest calculated during collection. These do not exist in your
  system until this settlement puts them there.

<Warning>
  Do not assume the two sides line up. A `CREDITOR` entry can be settled by a
  payment the collector received, and a `COLLECTOR` entry can be settled by a
  payment you received yourself — the source of the payment and the source of
  what it paid are independent. Read `depositCaseVoucher.source` for who
  received the money and `caseVouchers[].source` for who imposed what it paid,
  and post them separately. Treating one as a proxy for the other is the usual
  way a settlement fails to reconcile.
</Warning>

### Direct payments

By default the payments you registered yourself are **not** in the distribution,
and the commission charged on them shows up as a separate fee among the billing
vouchers instead. Add `?includeDepositsWithSourceCreditor=true` to have them
reported here, with their commission as part of the distribution.

<Warning>
  The billing vouchers endpoint always reports that commission, whatever you
  pass here. So if you take both halves of the settlement — which is what this
  guide recommends — leave the parameter off. Turning it on and also reading the
  billing vouchers counts the commission on your direct payments twice.
</Warning>

### Paging

The response is `items` plus `meta`, 25 payments per page by default. Page with
`page` and `pageSize` until a page returns fewer items than `pageSize`; there is
no total count. See [Pagination](/api-reference/pagination).

<Card horizontal title="API reference: Get deposit distribution">
  See [GET Get deposit
  distribution](/api-reference/endpoints/billings/deposit-distribution) for full
  details.
</Card>

## 3. The billing vouchers

```
GET /v1/{tenantId}/billings/{billingId}/billing-vouchers
```

The other half: the fees and disbursements on the settlement.

Only the ones that stand on their own are returned. A fee charged on a specific
payment belongs to that payment's distribution and is reported there as
`collectionCommission`, so booking both endpoints counts nothing twice — and
misses nothing.

```json theme={null}
{
  "meta": { "currentPage": 0, "pageSize": 25 },
  "items": [
    {
      "billingVoucherId": "5e6f7a8b-9c0d-1e2f-3a4b-5c6d7e8f9a0b",
      "id": 8841,
      "billingId": "9c1f2b3a-4d5e-6f70-8192-a3b4c5d6e7f8",
      "label": "Retsafgift",
      "category": "disbursement",
      "voucherTypeId": "6991fa7e-5812-4948-be69-0001d1f7205f",
      "amount": 75000,
      "currency": "DKK",
      "caseId": "3f1c2d4e-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
      "caseSequentialId": 10427,
      "referenceId": null,
      "text": null,
      "createdAt": "2026-06-14T09:02:11.000Z",
      "caseVoucher": null,
      "depositCaseVoucher": null
    }
  ]
}
```

* **`category`** is either `fee` — your collection partner's own charge, a
  honorar — or `disbursement`, an outlay they paid on your behalf, an udlæg.
  They are usually posted to different accounts, and can be fetched separately
  with `?category=["fee"]` or `?category=["disbursement"]` (JSON encoded, as on
  Debbie's other list filters). Both are returned when it is omitted.
* **`amount` excludes VAT**, and `vat` carries the VAT charged on the entry.
* **`label`** is what the line is called, in the language of the settlement.
* **`caseId` and `caseSequentialId`** tie the charge to a case where there is
  one; a charge that is not case specific has them null.
* **`depositCaseVoucher`** is the payment that triggered the charge, where there
  is one. **Commission on a direct payment you registered yourself appears
  here**, with `depositCaseVoucher.source` set to `CREDITOR` — that is where it
  goes when you did not pass
  `includeDepositsWithSourceCreditor=true` on the distribution.
* The response is paged the same way as the distribution.

<Card horizontal title="API reference: Get billing vouchers">
  See [GET Get billing
  vouchers](/api-reference/endpoints/billings/billing-vouchers) for full
  details.
</Card>

## 4. Posting it

Once you have both halves, a settlement decomposes into:

| What                                             | Where it comes from                                                                                        |
| ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
| Payments against your own receivables            | Distribution entries with `caseVouchers[].source` `CREDITOR`                                               |
| Collection entries settled out of those payments | Distribution entries with `caseVouchers[].source` `COLLECTOR`                                              |
| Commission                                       | `caseVouchers[].collectionCommission` on the distribution, and commission lines among the billing vouchers |
| Fees you are charged                             | Billing vouchers with `category` `fee`                                                                     |
| Disbursements you are charged                    | Billing vouchers with `category` `disbursement`                                                            |
| Owed back to the debtor                          | `overpayment` on the distribution                                                                          |

What is left is the net: paid out to you when the settlement is in your favour,
invoiced to you when it is not.

<Tip>
  Reconcile the settlement against its total before posting it. If the parts do
  not add up to the amount your debt collection partner paid out, something was
  missed — most often the billing vouchers, or the direct payments landing on
  whichever side of `includeDepositsWithSourceCreditor` you did not expect.
</Tip>

## Scopes

Both endpoints require `read:billings` on the API key. A key only ever reaches
its own creditor's settlements.
