How the two systems divide responsibility
The law firm system stays the system of record for the matter — the client relationship, the parties, the invoicing of legal work. Debbie becomes the system of record for the collection process — the workflow, the letters, the interest calculation, the fees, the payment plans, the court steps and the settlement of the creditor.Before you start
- Get a sandbox tenant. Contact the Debbie team. Every endpoint is scoped by
tenantId, which is part of the path, so a sandbox and a production tenant differ only by that id and the API key. - Create an API key. In the platform, go to Developers → API, name the key and grant the scopes listed under Scopes. Authenticate with
Authorization: Bearer {token}— see Authentication. - Subscribe to webhooks. Under Developers → Webhooks. Register the endpoint in your system that should receive the events listed under Webhooks back to the law firm system.
Identifiers to store on both sides
Getting the identifier mapping right is the single most important part of the integration. Decide up front which id lives where, and persist it.
Deep-link from the law firm system into Debbie with the sequential case id:
1. Create the creditor
A creditor is the party the money is owed to — the law firm’s client. Only create the creditors that actually have collection cases. Before creating a case, check whether the creditor already exists in Debbie. If it does not, create it and store the returnedid on the client record in the law firm system.
POST /v1/{tenantId}/creditors
id is your own creditor number, returned as reference on subsequent reads. bankAccountDetails is what Debbie pays out to when the creditor is settled, so include it if the law firm system holds it. erpLink supports the {{customerReferenceId}} placeholder, which Debbie substitutes with the customer’s referenceId — giving the caseworker a one-click jump to the right party in the law firm system.
API reference: Create creditor
See POST Create creditor for full
details.
2. Create the customer and its parties
A case is never created directly on a creditor — it hangs off a customer. A customer represents the creditor’s relationship with the other side of the matter, and holds one or more contacts, called users. Create the customer with the debtor, plus any other party the law firm knows about, before creating the case. The creditor is passed as a query parameter.POST /v1/{tenantId}/customers?creditorId={creditorId}
relationisdebtorfor the party who owes the money, andalternative-contactfor anyone else on the matter — a lawyer, a guardian, an administrator, a parent company contact.contact: truemarks the user Debbie addresses its communication to.referenceIdis your own party number. UseGET /customers/by-reference-id/{referenceId}?creditorId={creditorId}to look the customer up again instead of keeping a mapping table.
POST /customers/{customerId}/users.
API reference: Create customer
See POST Create customer for full
details.
3. Create the case with its financial entries
The case is created in the law firm system and replicated into Debbie. Send the financial entries of the matter along with it as case vouchers, so the case arrives in Debbie with a correct balance.POST /v1/{tenantId}/cases
- Amounts are integers in the minor unit, and debt is negative.
-450000is a debt of 4,500.00 DKK; a positive amount is a credit note or a deposit. voucherTypeIdcomes fromGET /voucher-types. Fetch the list once and cache it — the invoice, reminder fee and deposit types you need are stable per tenant.sourceisCREDITORfor everything the law firm imposes before handover.COLLECTORis reserved for what the collection agency imposes.- Set
uniqueIdto your own invoice number. It is unique per tenant and stops the same voucher from being created twice if a request is replayed. interestis a decimal fraction —0.1225is 12.25% per year — and applies frominterestStartDate.
API reference: Create case
See POST Create case for full details.
4. Register deposits paid to the law firm
Payments the debtor makes directly to the law firm’s client account must be replicated into Debbie, so the balance is correct and so the collection process — reminders, payment plans, court steps, and any reply to the court — reflects what has actually been paid.POST /v1/{tenantId}/case-vouchers/{caseId}
source: "CREDITOR" marks the deposit as paid directly to the creditor rather than collected by Debbie — this is what makes the settlement in step 5 come out right. Set uniqueId from the bank transaction id so a replay cannot double-book the payment.
By default Debbie distributes the amount across the case’s vouchers using the tenant’s distribution rules. To settle specific invoices instead, send distribute as an array of { "value": { "amount": 50000, "caseVoucherReferenceId": "F-100241" } } entries — one per voucher, keyed by your invoice number (caseVoucherReferenceId) or by caseVoucherId. The distributed amounts must sum to the deposit’s amount.
API reference: Add case voucher
See POST Add case voucher for
full details.
5. Receive fees, status changes and settlements
Everything that happens after handover is reported back over webhooks.Fees imposed during collection
case-vouchers.create fires for every voucher created in Debbie — collection fees, court fees, interest entries and deposits registered by Debbie. Filter on data.source === "COLLECTOR" to pick out what Debbie imposed, and use data.category (fee, courtcost, interest, collectioncommission, …) to book it in the law firm system.
case-vouchers.update and case-vouchers.delete fire when a voucher is later changed or removed — handle them, or the balance in the two systems will drift.
Case status
cases.update reports changes to the case, including status transitions. On a transition data.status is set to the new status — PENDING, VERIFIED or ENDED — and when the case ends, data.endReasonId and data.handle tell you why — paid in full, written off, withdrawn — which is usually what the law firm system needs to close the matter.
cases.merge fires when Debbie merges two cases for the same debtor. If the law firm system holds one matter per Debbie case, this is the event that tells you two of your matters are now handled as one.
Settlement of the creditor
When creditors are settled in Debbie, a billing is created andbillings.create fires with a billingId. Call:
items plus meta — 25 deposits per page by default — so page through it with page and pageSize. It reports which case and customer each deposit belongs to, which case vouchers it was distributed to, how much of it is overpayment, and which of the vouchers carry collectionCommission. This is the breakdown the law firm system needs to book revenue, overpayments and the amount payable to the client.
If the law firm registers deposits paid directly to it (step 4), add
?includeDepositsWithSourceCreditor=true. Without it, the collection
commission charged on those direct payments is reported as a separate fee on
the billing rather than as part of the deposit’s distribution.payouts.create then reports the actual payouts, with type telling you whether it is a CREDITOR_RECEIVABLES settlement, an OVERPAYMENT refund to the debtor, or a COURT_FEE, and caseId / caseSequentialId linking it back to the matter.
Webhooks back to the law firm system
These are the events a law firm integration normally subscribes to:Delivery
Every delivery is aPOST with a JSON body of the shape:
- Debbie sends
X-Verification-Tokenwith the token from your webhook subscription. Verify it on every request before acting on the payload. - Any non-2xx response counts as a failure. The first delivery is attempted immediately; a failure is then retried up to 7 more times with exponential backoff — roughly 1, 3, 8, 21, 55, 149 and 404 minutes after the previous attempt, about eleven hours end to end — so a receiver that is down for most of a day will still catch up.
- Respond quickly and process asynchronously. Acknowledge with 200 as soon as the payload is persisted rather than after your own downstream work has finished.
- Retries mean a delivery can arrive more than once, replayed with an unchanged body. There is no single
data.idacross events, so key the handler on the identifiers each event actually carries:caseVoucherIdforcase-vouchers.*,idforbillings.createandpayouts.create,caseIdtogether withstatusforcases.update,fromCaseIdandtoCaseIdforcases.merge, andpaymentPlanIdforpayment-plans.*.
GET /webhooks/items, filtered by webhookId and state, so the law firm system can reconcile what it received against what Debbie sent. Deliveries that exhausted their retries can be re-sent from Developers → Webhooks in the platform.
API reference: Webhooks
See Get webhook items and the
payload of each event under Webhooks in the API reference.
Scopes
Grant the API key only what the integration uses:Optional extensions
Once the core flow runs, these are the usual next steps:- Attach documents. Upload the invoice or contract with
POST /filesand reference it as theappendixof the case voucher, so it follows the case into letters and court documents. - Register incoming communication. Post a
POST /interactionsof typeNOTEorDEBTOR NOTEwhen the debtor contacts the law firm, so the Debbie caseworker sees it on the case. - Enrich with custom fields. Send
propertieson the case or the voucher to carry law-firm-specific data into Debbie’s letter templates.
Checklist before going live
1
Identifiers are stored on both sides
creditorId, customerId, caseId and caseSeqId are persisted in the law firm system, and customJournalNumber is set on every case.2
Every write is replayable
Idempotency-Key on the request, uniqueId on every voucher, and failed calls go to a retry queue rather than being dropped.3
The webhook receiver verifies and is idempotent
X-Verification-Token is checked, the handler tolerates duplicate deliveries, and it responds 200 before doing downstream work.4
Deposits flow both ways
Payments to the law firm are pushed to Debbie as
source: "CREDITOR" deposits, and deposits collected by Debbie are booked from case-vouchers.create.5
Settlement is booked from the deposit distribution
billings.create triggers a fetch of the deposit distribution, and revenue, overpayments and the creditor payout are booked from it.