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. The request binds a fingerprint (action, targetId[, valueMinor]) + the requester: on approval, retrying the identical gated call finds + consumes the approval by fingerprint. 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 human-readable id, shaped like AR-… — stable for the record’s life.
typeString String!The kind of record — always ApprovalRequest here.
captionString String!The record’s display name — what people see it called.
statusString String!The record’s current state — one of pending, approved, denied, expired or 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 id of your organization group — every record of yours carries the same one.
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 id of the record’s current edit — send it back with a change so an edit made in the meantime is refused instead of overwritten.
refCaptionsRefCaption [RefCaption!]!The captions of the records this one refers to, composed for you — 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 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.
decidedAtStringDecision-stamped: the decision instant (ISO-8601).
decisionReasonStringDecision-stamped: the approver/denier's stated reason (optional — the transition template).

Used by