Customers

Sub-Customers

When one customer's debt really belongs to several people — and you need to know how much is whose.

Last updated 2026-10-13

DigitalKey ERP — Docs · digital-key.co/docs/customers/sub-customers

Requires subscriptioncustomer.sub_accounts1,500 IQD / month

Overview

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.

The main customer still owes all of itA sub-customer is a label, not a separate account. The customer's balance, credit limit, statement, finance and reports are exactly as they were. Marking an invoice or payment for a person moves no money.
Customers — People tab
People tab
People tab — The customer drawer's People tab, listing each person with their invoices, total, paid and what they owe, and the unassigned remainder.

Adding people

  1. 1

    Open the customer and go to People

    The People tab appears in the customer drawer once the feature is subscribed.

  2. 2

    Add person

    Enter a name, and optionally a phone number and notes.

  3. 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

Where a person can be chosen
ParameterTypeRequiredDescription
Quick POSForOptionalAfter choosing the customer, pick the person in the For box.
Sales orderForOptionalThe same box on the order form.
Editing an invoiceForOptionalThe person can be changed. It is kept while the customer stays the same.
Recording a paymentForOptionalMark the payment for a person. It may not be more than that person owes.
Assign invoicesbulkOptionalFrom the People tab: list invoices not assigned yet, select several, and assign them to a person — or clear them.
TipOld invoices can be assigned too, from any month. Because marking moves no money and changes no report, it is not restricted to the current month the way editing an invoice is.

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:

A person's balance
ParameterTypeRequiredDescription
+ Share of old debttypedOptionalTheir part of the customer's old debt.
+ Remaining on their invoicescalculatedOptionalThe unpaid part of each postpaid invoice marked for them that counts as a sale.
− ReturnscalculatedOptionalReturns made against those invoices.
− Their paymentscalculatedOptionalPayments 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.

Requires subscriptioncustomer.statement2,500 IQD / month

Switching 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

NoteIf the subscription lapses, nothing is lost. The marks stay on the invoices and payments; the sale, order, edit and payment screens simply stop offering the For box and ignore the field. An edited invoice keeps its person while its customer is unchanged.
Endpoints — /api/v1/customers/{id}/sub-customers
ParameterTypeRequiredDescription
GET /endpointOptionalEvery person with what they owe, and the unassigned part.
POST /endpointOptionalAdd a person.
PUT /{subId}endpointOptionalChange a person's name, phone, notes or share.
PUT /{subId}/toggleendpointOptionalSwitch a person off or back on.
GET /invoicesendpointOptionalThe customer's invoices — unassigned, all, or one person's.
PUT /invoicesendpointOptionalMark invoices as a person's, or clear them.
PUT /paymentsendpointOptionalMark recorded payments as a person's, or clear them.
GET /{subId}/statementendpointOptionalOne person's statement.

Related