Quotas Rules — Per Account & Supplier

Quotas Rules let you override the default minimum with more specific thresholds for targeted scopes such as Account, Supplier, and optionally Store. The engine selects one effective rule per order using a deterministic precedence.

Key points

  • Rules are admin-managed overrides to the default minimum.
  • Resolution is deterministic: the most specific matching rule wins.
  • If no rule matches, the default minimum applies.
  • Co-validation groups are covered on the next page.

🧭 What a rule is

A Quotas Rule defines:

  • Scope keys: Account, Supplier, optionally Store
  • Minimum threshold: the quota value to meet or exceed
  • Lifecycle: create, update, delete by admins

🎛️ Rule resolution at evaluation time

graph LR
  %% ---------- Flow ----------
  IN[Order enters quota check] --> MATCH[Find matching rules<br>by scope]
  MATCH --> SPEC{Any account plus supplier rule}
  SPEC -->|Yes| PICK1[Pick most specific match<br>account plus supplier]
  SPEC -->|No| ACC{Any account only rule}
  ACC -->|Yes| PICK2[Pick most specific match<br>account only]
  ACC -->|No| SUP{Any supplier only rule}
  SUP -->|Yes| PICK3[Pick most specific match<br>supplier only]
  SUP -->|No| DEF[Use default minimum]
  PICK1 --> EFF[Effective minimum resolved]
  PICK2 --> EFF
  PICK3 --> EFF
  DEF --> EFF
  EFF --> CMP[Compare order metrics<br>to effective minimum]
  CMP -->|Below min| BLK[Block<br>reason: quota_min_not_met]
  CMP -->|Meets min| OK[Allow]

  %% ---------- Styles ----------
  classDef total fill:#e8f1ff,stroke:#2f6feb,stroke-width:2px,color:#0b3d91;
  classDef diff fill:#fff4e5,stroke:#f59e0b,stroke-width:2px,color:#7a3e00;
  classDef inter fill:#fee2e2,stroke:#ef4444,stroke-width:2px,color:#7f1d1d;
  classDef visible fill:#ecfdf5,stroke:#10b981,stroke-width:2px,color:#064e3b;

  class IN,MATCH,SPEC,ACC,SUP,PICK1,PICK2,PICK3,DEF,EFF,CMP diff;
  class BLK inter;
  class OK visible;

  style IN rx:8,ry:8
  style MATCH rx:8,ry:8
  style SPEC rx:8,ry:8
  style ACC rx:8,ry:8
  style SUP rx:8,ry:8
  style PICK1 rx:8,ry:8
  style PICK2 rx:8,ry:8
  style PICK3 rx:8,ry:8
  style DEF rx:8,ry:8
  style EFF rx:8,ry:8
  style CMP rx:8,ry:8
  style BLK rx:8,ry:8
  style OK rx:8,ry:8

Precedence, in plain words

  1. Account + Supplier rules take priority over all others.
  2. If none, prefer Account-only rules.
  3. If none, prefer Supplier-only rules.
  4. If none match, use the Default minimum.

If multiple rules exist at the same specificity, the engine uses a deterministic selection (for example, most restrictive threshold). Your admin UI should avoid creating ambiguous overlaps.


🧩 CRUD and scoping

graph LR
  %% ---------- Nodes ----------
  ADM[Admin UI or API]
  RULE[Quotas Rule<br>scope and minimum]
  ACCT[Account]
  SUP[Supplier]
  STORE[Store optional]
  EVAL[Quota evaluation<br>uses effective rule]

  %% ---------- Relations ----------
  ADM --> RULE
  RULE --> ACCT
  RULE --> SUP
  RULE --> STORE
  RULE --> EVAL

  %% ---------- Styles ----------
  classDef op fill:#e0f7fa,stroke:#06b6d4,stroke-width:2px,color:#065f46;
  classDef total fill:#e8f1ff,stroke:#2f6feb,stroke-width:2px,color:#0b3d91;
  classDef visible fill:#ecfdf5,stroke:#10b981,stroke-width:2px,color:#064e3b;

  class ADM op;
  class RULE total;
  class ACCT,SUP,STORE,EVAL visible;

  style ADM rx:8,ry:8
  style RULE rx:8,ry:8
  style ACCT rx:8,ry:8
  style SUP rx:8,ry:8
  style STORE rx:8,ry:8
  style EVAL rx:8,ry:8

Good practices

  • Keep scopes minimal and non-overlapping.
  • Prefer Account + Supplier for precision when needed.
  • Use Supplier-only for broad governance across many accounts.
  • Reserve Store for multi-store tenants.

📝 Mono-supplier platforms

Mono-supplier platforms still benefit from rules:

  • Use Account-only rules to target specific buyers.
  • The Supplier dimension is constant but rules continue to resolve deterministically.

🧾 Admin endpoints

  • Create: POST /v1/buying-policies/quotas/rules — ADM-BUYING-POLICY-152
  • List: GET /v1/buying-policies/quotas/rules — ADM-BUYING-POLICY-553
  • Update: PUT /v1/buying-policies/quotas/rules/ruleId — ADM-BUYING-POLICY-206
  • Delete: DELETE /v1/buying-policies/quotas/rules/ruleId — ADM-BUYING-POLICY-302

🔎 Searching and filtering the rules

A rule used to be identified only by technical identifiers — the rule ID and the external IDs of the customer account and the supplier. Finding or correcting the quota of a given customer therefore meant paging through the list and comparing identifiers. The list now carries a search and returns the names alongside the identifiers.

Search

GET /v1/buying-policies/quotas/rules — operationId: ADM-BUYING-POLICY-553 · Access: dj-client: OPERATOR

ParameterDescription
search"Contains" match on the rule ID, on the external ID or name of the customer account, and on the external ID or name of the supplier. Case-insensitive on every field, and accent-insensitive on the names. A blank value is ignored; surrounding spaces are trimmed.
customerAccountIdsRestrict to one or more customer accounts. Unchanged.
supplierIdsRestrict to one or more suppliers. Unchanged.

search combines with customerAccountIds and supplierIds with an AND; the values inside a single filter combine with an OR. A rule matching the search on several fields is returned once.

GET /v1/buying-policies/quotas/rules?search=boulangerie&supplierIds=SUP-01&page=0&size=20
dj-client: OPERATOR
dj-api-key: <your-api-key>

Names in the response

Two fields are returned alongside the identifiers:

FieldDescription
customerAccountNameName of the customer account, resolved at read time. null when the account no longer exists.
supplierNameName of the supplier, resolved at read time. null when the supplier no longer exists.
{
  "content": [
    {
      "id": "qr-123",
      "customerAccountId": "ACC-0001",
      "customerAccountName": "Boulangerie Martin",
      "supplierId": "SUP-ACME",
      "supplierName": "ACME Distribution",
      "minQuotaValue": 100,
      "createdAt": "2026-09-29T10:00:00Z",
      "updatedAt": "2026-09-29T10:00:00Z"
    },
    {
      "id": "qr-124",
      "customerAccountId": "ACC-OLD",
      "customerAccountName": null,
      "supplierId": "SUP-ACME",
      "supplierName": "ACME Distribution",
      "minQuotaValue": 50,
      "createdAt": "2026-09-28T10:00:00Z",
      "updatedAt": "2026-09-28T10:00:00Z"
    }
  ],
  "number": 0,
  "size": 20,
  "numberOfElements": 2,
  "first": true,
  "last": true,
  "empty": false
}

customerAccountId and supplierId carry the external identifiers of the account and the supplier.

A rule whose account or supplier has been deleted is still returned, with its other fields intact and the missing name at null — the Back-Office then displays the external identifier alone.

In the Back-Office

The Quotas per supplier tab carries a search bar backed by the search parameter above, plus two multi-select filters — Customer accounts and Suppliers. Several values of the same filter add up, the two filters combine, and each active value appears as a removable tag.

The customer account and supplier columns now display the name as the primary information, with the external identifier underneath. Multi-selection, bulk deletion, editing and rule creation are unchanged. Any change to the search or to the filters returns to the first page.

✅

Tip: A call that sends none of these parameters returns the same content, in the same order, with the same fields as before. Adding customerAccountName and supplierName is backward compatible, and no additional call is needed to display names.


🔗 API quicklinks

  • Create: POST /v1/buying-policies/quotas/rules — ADM-BUYING-POLICY-152
  • List: GET /v1/buying-policies/quotas/rules — ADM-BUYING-POLICY-553
  • Update: PUT /v1/buying-policies/quotas/rules/ruleId — ADM-BUYING-POLICY-206
  • Delete: DELETE /v1/buying-policies/quotas/rules/ruleId — ADM-BUYING-POLICY-302



Did this page help you?