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.
What a group holds
Section titled “What a group holds”| Field | Notes |
|---|---|
id | Integer id, set when the group is created. |
name | Required. |
allowFactoring | true or false. When it is false, invoices of the members cannot be financed. Defaults to true. |
limitLocale | The group’s shared financing limit, in the system currency. |
numberOfMembers | Read-only. The number of system debtors in the group. |
limitLocaleUsed | Read-only. The capital financed without recourse across the members. |
limitLocaleDisposable | Read-only. limitLocale minus limitLocaleUsed. |
balances | Read-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.
Create and change a group
Section titled “Create and change a group”POST /system-debtor-groups (CreateSystemDebtorGroups) with a name, and
optionally allowFactoring and limitLocale. The response is the created
group.
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 }'| Call | Right | Does |
|---|---|---|
PUT /system-debtor-groups/{id} | UpdateSystemDebtorGroups | Updates name, allowFactoring or limitLocale. |
GET /system-debtor-groups/{id} | ReadSystemDebtorGroup | Reads one group, including limitLocaleUsed and limitLocaleDisposable. |
GET /system-debtor-groups | ReadSystemDebtorGroups | Lists the groups. |
POST /system-debtor-groups/search | SearchSystemDebtorGroups | Searches by id or name, see Pagination and search. |
DELETE /system-debtor-groups/{id} | DeleteSystemDebtorGroups | Deletes the group and all its memberships. The system debtors themselves stay. |
Add and remove members
Section titled “Add and remove members”A member is a system debtor, identified by its identification number.
curl -X POST "https://$HOST/system-debtor-groups/$GROUP_ID/system-debtors" \ -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" \ -d '{ "systemDebtorId": "5560000000" }'| Call | Right | Does |
|---|---|---|
POST /system-debtor-groups/{id}/system-debtors | CreateSystemDebtorGroupSystemDebtors | Adds the system debtor in systemDebtorId. |
GET /system-debtor-groups/{id}/system-debtors | ReadSystemDebtorGroupSystemDebtors | Lists the members. |
DELETE /system-debtor-groups/{id}/system-debtors/{systemDebtorId} | DeleteSystemDebtorGroupSystemDebtors | Removes 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.
Read the group of a debtor
Section titled “Read the group of a debtor”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.