AlmondTill/G3N API

On this page

updateCommissionConfig

mutation · in the family Commission config

What it does

Edit the commission settings — how staff sales commission is computed — change its details.

Edit a CommissionConfig's mutable attributes. Requires the unrestricted capability + the record's CURRENT revision.

Careful

Edits take effect immediately and write a new revision; the old revision stays in history.

Who may call it

Capability area: Pricing — Prices, price schedules, promotions, coupons and the money rules of selling.

Arguments

NameTypeRequiredNotes
idID ID!yesThe id of the record.
revisionID ID!yesThe revision id you read on the record; the change is refused if an edit landed in the meantime.
inputEditCommissionConfigInput EditCommissionConfigInput!yesNo further notes.

Returns

CommissionConfig CommissionConfig! — A CommissionConfig — ONE cell of the multi-axis commission matrix (the ReplenishmentConfig SIBLING): the AXES scope WHERE it applies (each SINGULAR, absent = all, IMMUTABLE at birth — re-target = create + doom): Agent (a Role the agent holds at the sale's org ⊕ a specific User) · Merchandise (Division ⊕ Category-SUBTREE ⊕ Style — a style outranks any category depth) · Location (Organization ⊕ LogicalFacility — **the Location axis IS the org scoping; this construct is NOT org-selected**) · Channel. The SPARSE parameters (≥1 required): rate (percent_net = the line's FINAL post-position-5 discounted net · percent_margin = max(net − landed COGS, 0), COGS-absent ⇒ 0 · fixed_per_unit — a currency-mismatched fixed rate is NON-matching) + enabled (false at the winning cell SUPPRESSES the entry). At PLACE, per (line × attributed agent): candidates = ACTIVE cells matching EVERY axis; the winner PER PARAMETER is the most specific (set-axis count, tie-break Agent ≻ Merchandise ≻ Location ≻ Channel). appliesToAllSalesInScope=true + Agent=Role is the manager-on-all override: EVERY active holder of the Role at the sale's org earns additively (entryClass manager_on_all; bounded ≤ 32 holders — the write refuses over, the place mint SKIPS over [the sale never blocks]). the collision rule: an ACTIVE same-normalized-tuple sibling with an intersecting SET-parameter set refuses CONFLICT/IDENTITY_TAKEN naming the holder(s) + the intersection (create, param-GROWING edits, reactivate; same-tuple DISJOINT-parameter cells are LEGAL — the flag rides IN the tuple, so flagged/unflagged never compete). At most 128 ACTIVE per org group (the per-place resolution bound). NOT searchable (the config non-joiner stance — configs are axis-addressed, not name-found); NO UNIQ marker.

Example request

mutation ExampleUpdateCommissionConfig($id: ID!, $revision: ID!, $input: EditCommissionConfigInput!) {
  updateCommissionConfig(id: $id, revision: $revision, input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    appliesToAllSalesInScope
    agentRoleId
    agentUserId
    divisionId
    categoryId
    styleId
    organizationId
    logicalFacilityId
    channel
    enabled
  }
}

Variables:

{
  "id": "01900000-0000-7000-8000-37386ae00000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "input": {
    "caption": "Blue jeans"
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

{
  "data": {
    "updateCommissionConfig": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "CG-EXMP-0000-000F",
      "type": "CommissionConfig",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "appliesToAllSalesInScope": true,
      "agentRoleId": "01900000-0000-7000-8000-1c1b82930000",
      "agentUserId": "01900000-0000-7000-8000-640b76dc0000",
      "divisionId": "01900000-0000-7000-8000-25bd925b0000",
      "categoryId": "01900000-0000-7000-8000-786111a40000",
      "styleId": "01900000-0000-7000-8000-2f797c8b0000",
      "organizationId": "01900000-0000-7000-8000-44b781470000",
      "logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000",
      "channel": "pos",
      "enabled": true
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Dry run

Add dryRun: true to the request envelope (extensions.at) to rehearse this call: every check runs, the write is rehearsed against the current records and nothing is stored; the answer is the refusal a real call would give, or the record it would create. Every response to a rehearsal carries dryRun: true, so a rehearsed record is never mistaken for a saved one.