The flow
1
billings.create fires
The webhook carries a
billingId, the creditorId and the currency.2
Fetch the deposit distribution
GET /v1/{tenantId}/billings/{billingId}/deposit-distribution — every
payment in the settlement and how it was split.3
Fetch the billing vouchers
GET /v1/{tenantId}/billings/{billingId}/billing-vouchers — the fees
(honorarer) and disbursements (udlæg).4
Post it
Revenue, commission, fees, disbursements, overpayments and the net amount.
1. The webhook
X-Verification-Token header, acknowledge with 200, and do the
fetching asynchronously. billingId is what both endpoints below take. Key the
handler on it so a redelivery does not post the settlement twice.
payouts.create follows when the money actually moves, with type telling you
whether it is a CREDITOR_RECEIVABLES settlement, an OVERPAYMENT refund to
the debtor, or a COURT_FEE.
2. The deposit distribution
customer.referenceIdandcaseVouchers[].referenceIdare the creditor’s own identifiers — the customer number and the invoice number that were sent in. They are what makes the settlement postable in the creditor’s system.depositCaseVoucher.amountis the payment; the amounts incaseVouchersplusoverpaymentadd up to it.overpaymentis owed back to the debtor, not to the creditor.
source says who imposed what
CREDITOR— imposed by the creditor: the invoices, reminder and compensation fees sent at handover, and the payments the creditor registered itself. These already exist in the creditor’s own bookkeeping.COLLECTOR— imposed by the collector during collection: collection fees, court fees, interest.
Direct payments
Payments registered withsource: "CREDITOR" are not in the distribution by
default, and the commission charged on them is reported 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.
API reference: Get deposit distribution
See GET Get deposit distribution for
full details.
3. The billing vouchers
collectionCommission, so booking both endpoints counts nothing twice — and
misses nothing.
categoryisfee— the collector’s own charge, a honorar — ordisbursement, an outlay paid on the creditor’s behalf, an udlæg. They usually go 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.amountexcludes VAT, andvatcarries the VAT charged on the entry.caseIdandcaseSequentialIdtie the charge to a case where there is one; a charge that is not case specific has them null.depositCaseVoucheris the payment that triggered the charge, where there is one. Commission on a payment made directly to the creditor appears here, withdepositCaseVoucher.sourceset toCREDITOR.
Do not derive the fees from the
case-vouchers.* webhook stream instead. A
voucher event carries no billing reference, so nothing in it says which
settlement a fee ends up on — or whether it has been settled at all — and a
voucher can still be changed or removed after it was reported.API reference: Get billing vouchers
See GET Get billing
vouchers for full
details.
4. Posting it
What is left is the net, which
payouts.create reports when it moves.
Paging and scopes
Both endpoints returnitems plus meta, 25 per page by default, with no total
count — page with page and pageSize until a page returns fewer items than
pageSize. See Pagination.
Both require read:billings.