approvalRequest
query · in the family Approval request
What it does
Look up one record — an approval request — asking a manager’s authority for an act above your limit.
One ApprovalRequest by id. The record must belong to your organization group; an id from another group reads as not found.
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: Reading your records — Looking up and listing the records of your organization.
Roles that may call it:
- Owner
- System Administrator
- Manager
- Associate Manager
- Sales Associate
- Cashier
- An API key whose scope allows
api:approvalRequest
What happens
Reads only — changes nothing.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
id | ID ID! | yes | The id of the record. |
Returns
ApprovalRequest — 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.
Example request
query ExampleApprovalRequest($id: ID!) {
approvalRequest(id: $id) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
action
targetType
targetId
valueMinor
requestedBy
requiredTier
reason
expiresAt
decidedBy
decidedAt
decisionReason
}
}Variables:
{
"id": "01900000-0000-7000-8000-e7259dcb0000"
}Example response
{
"data": {
"approvalRequest": {
"id": "01900000-0000-7000-8000-e7259dcb0000",
"sysId": "AR-EXMP-0000-000F",
"type": "ApprovalRequest",
"caption": "Blue jeans",
"status": "pending",
"parentId": "01900000-0000-7000-8000-4ed885220000",
"rootId": "01900000-0000-7000-8000-a1295a650000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-53c6eea90000",
"action": "<action>",
"targetType": "<target type>",
"targetId": "01900000-0000-7000-8000-8b67f1680000",
"valueMinor": 1250,
"requestedBy": "01900000-0000-7000-8000-dae980de0000",
"requiredTier": "owner",
"reason": "Correcting a miscount.",
"expiresAt": "2028-01-31T00:00:00.000Z",
"decidedBy": "01900000-0000-7000-8000-d4d316ba0000",
"decidedAt": "2027-01-31T00:00:00.000Z",
"decisionReason": "<decision reason>"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (NOT_FOUND)