Skip to content

Manage system debtor groups through the API

A system debtor group collects system debtors that are financed under one shared limit and one shared factoring setting. A system debtor is the tenant-wide view of a debtor, keyed by identificationNumber, see Clients and debtors. Groups are managed through the System Debtor Groups API, not through the debtor or the invoice payload.

FieldNotes
idInteger id, set when the group is created.
nameRequired.
allowFactoringtrue or false. When it is false, invoices of the members cannot be financed. Defaults to true.
limitLocaleThe group’s shared financing limit, in the system currency.
numberOfMembersRead-only. The number of system debtors in the group.
limitLocaleUsedRead-only. The capital financed without recourse across the members.
limitLocaleDisposableRead-only. limitLocale minus limitLocaleUsed.
balancesRead-only. The members’ combined balances.

When an invoice of a member is checked for financing, it is refused if the group has allowFactoring set to false, or if the invoice total is higher than the group’s limitLocaleDisposable. For a system debtor that is in no group, each of the two criteria follows the If no value, allow criteria to pass? option of the rule: it passes with Yes and fails with No. See Rule engine criteria.

POST /system-debtor-groups (CreateSystemDebtorGroups) with a name, and optionally allowFactoring and limitLocale. The response is the created group.

Terminal window
curl -X POST "https://$HOST/system-debtor-groups" \
-H "Authorization: Bearer $JWT" -H "Content-Type: application/json" \
-d '{ "name": "Example group", "allowFactoring": true, "limitLocale": 500000 }'
CallRightDoes
PUT /system-debtor-groups/{id}UpdateSystemDebtorGroupsUpdates name, allowFactoring or limitLocale.
GET /system-debtor-groups/{id}ReadSystemDebtorGroupReads one group, including limitLocaleUsed and limitLocaleDisposable.
GET /system-debtor-groupsReadSystemDebtorGroupsLists the groups.
POST /system-debtor-groups/searchSearchSystemDebtorGroupsSearches by id or name, see Pagination and search.
DELETE /system-debtor-groups/{id}DeleteSystemDebtorGroupsDeletes the group and all its memberships. The system debtors themselves stay.

A member is a system debtor, identified by its identification number.

Terminal window
curl -X POST "https://$HOST/system-debtor-groups/$GROUP_ID/system-debtors" \
-H "Authorization: Bearer $JWT" -H "Content-Type: application/json" \
-d '{ "systemDebtorId": "5560000000" }'
CallRightDoes
POST /system-debtor-groups/{id}/system-debtorsCreateSystemDebtorGroupSystemDebtorsAdds the system debtor in systemDebtorId.
GET /system-debtor-groups/{id}/system-debtorsReadSystemDebtorGroupSystemDebtorsLists the members.
DELETE /system-debtor-groups/{id}/system-debtors/{systemDebtorId}DeleteSystemDebtorGroupSystemDebtorsRemoves the member.

Adding is refused with 400 when the group does not exist, when there is no system debtor with that identification number, or when it is already a member of that group. A system debtor exists once an invoice with its identification number has been activated.

GET /debtors/{id} returns groupId and groupName for the debtor, and GET /system-debtors/{identificationNumber} returns systemDebtorGroupId and systemDebtorGroupName. They are output only. They are empty when the system debtor is in no group, and show the first group when it is in more than one. They are not accepted when you update a debtor and are not part of the debtor object you send with an invoice. To put a debtor in a group, add its system debtor to the group as shown above.