Sub-Customers
When one customer's debt really belongs to several people — and you need to know how much is whose.
DigitalKey ERP — Docs · digital-key.co/docs/customers/sub-customers
customer.sub_accounts1,500 IQD / monthOverview
Some customers buy on behalf of others. Karwan owes you 5,000,000, but that debt belongs to ten people he supplies. Sub-customers let you record which person each invoice and each payment belongs to, and see what every one of them still owes.

Adding people
- 1
Open the customer and go to People
The People tab appears in the customer drawer once the feature is subscribed.
- 2
Add person
Enter a name, and optionally a phone number and notes.
- 3
Set their share of the old debt (optional)
If the customer already owed money before you started tracking people, give each person their part. All shares together cannot be more than the customer's old debt.
Marking invoices and payments
| Parameter | Type | Required | Description |
|---|---|---|---|
Quick POS | For | Optional | After choosing the customer, pick the person in the For box. |
Sales order | For | Optional | The same box on the order form. |
Editing an invoice | For | Optional | The person can be changed. It is kept while the customer stays the same. |
Recording a payment | For | Optional | Mark the payment for a person. It may not be more than that person owes. |
Assign invoices | bulk | Optional | From the People tab: list invoices not assigned yet, select several, and assign them to a person — or clear them. |
What a person owes
What a person owes is calculated every time it is shown, never stored, so it cannot drift out of step with the invoices behind it:
| Parameter | Type | Required | Description |
|---|---|---|---|
+ Share of old debt | typed | Optional | Their part of the customer's old debt. |
+ Remaining on their invoices | calculated | Optional | The unpaid part of each postpaid invoice marked for them that counts as a sale. |
− Returns | calculated | Optional | Returns made against those invoices. |
− Their payments | calculated | Optional | Payments marked for them. |
Whatever is left of the customer's balance after everyone's share is shown as Unassigned (the customer). The parts always add up to the customer's total debt.
Statements
Print statementon a person produces a statement of just their part, for any period. The customer's own statement is unchanged and still shows everything.
customer.statement2,500 IQD / monthSwitching a person off
A person who no longer buys can be switched off. They stop being offered in the For box; their history, and anything they still owe, stays visible.
Without the feature
| Parameter | Type | Required | Description |
|---|---|---|---|
GET / | endpoint | Optional | Every person with what they owe, and the unassigned part. |
POST / | endpoint | Optional | Add a person. |
PUT /{subId} | endpoint | Optional | Change a person's name, phone, notes or share. |
PUT /{subId}/toggle | endpoint | Optional | Switch a person off or back on. |
GET /invoices | endpoint | Optional | The customer's invoices — unassigned, all, or one person's. |
PUT /invoices | endpoint | Optional | Mark invoices as a person's, or clear them. |
PUT /payments | endpoint | Optional | Mark recorded payments as a person's, or clear them. |
GET /{subId}/statement | endpoint | Optional | One person's statement. |
Related
- Recording Payments — marking a payment for a person.
- Account Statement — the customer's full ledger.
- Postpaid Sales — where the debt comes from.