AlmondTill/G3N API

ApprovalRequest

object type

An ApprovalRequest — the real-time, human-approver, in-session authorization of ONE POS action exceeding the requester's authority (DISTINCT from the async ChangeRequest). The blocked action stays blocked until resolved; short TTL (expiresAt — a touch past it refuses CONFLICT/EXPIRED and lazily expires the request). The request binds a fingerprint (action, targetId[, valueMinor]) + the requester: on approval, RETRYING the identical gated call finds + consumes the approval by fingerprint (single-use — the marker releases in the retry's own transaction). Never self-approve (AUTHZ/SELF_APPROVAL); an under-ranked approver is AUTHZ/INSUFFICIENT.

Fields

FieldTypeNotes
idID ID!The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it.
sysIdString String!The group-scoped human-facing system id (AR-…).
typeString String!The kind of record — always ApprovalRequest here.
captionString String!The record’s display name — what people see it called.
statusString String!The FSM state: pending | approved | denied | expired | cancelled.
parentIdID ID!deterministic parent: the open TillSession when the action runs in a till session, else the LF; rootId = the org group regardless.
rootIdID ID!The org-group family root.
createdAtString String!When the record was created, as a UTC timestamp.
updatedAtString String!When the record last changed, as a UTC timestamp.
revisionNumInt Int!How many times this record has been edited; the first save is 0.
revisionID ID!The OCC revision token — supply it on every mutation of this record; rotates on every write.
refCaptionsRefCaption [RefCaption!]!The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption.
actionString String!The gated action: discount.apply · price.override · void.line · void.transaction · return.approve · sale.restricted_item · no_sale · oversell · refund.routing_exception · credit.over_limit · order.below_minimum. Live: discount.apply · void.transaction · return.approve · no_sale · refund.routing_exception · credit.over_limit · order.below_minimum; the rest refuse VALIDATION/UNSUPPORTED naming their arrival.
targetTypeString String!The target construct type — derived from the action, stored for the fingerprint.
targetIdID ID!The blocked action's target construct.
valueMinorIntThe bound value (integer minor units) when the action carries one — discount.apply binds the discount Σ, EXACT-matched at consumption; absent for whole-target actions.
requestedByID ID!The requesting User.
requiredTierRoleTemplateKey RoleTemplateKey!The REQUIRED approver tier; the approver's resolved tier rank must be ≥ this tier's rank (AUTHZ/INSUFFICIENT below it).
reasonString String!Why the requester needs the override.
expiresAtString String!The live-window end (createdAt + the 900s TTL, ISO-8601): approve/deny/consume past it refuse CONFLICT/EXPIRED and the request lazily expires.
decidedByIDDECISION-stamped: the approving/denying User (≠ requestedBy on approve — never-self-approve).
decidedAtStringDECISION-stamped: the decision instant (ISO-8601).
decisionReasonStringDECISION-stamped: the approver/denier's stated reason (optional — the transition template).

Used by