Order approval types
The types the order approval domain defines, with the fields other domains add to them.
Objects
CartApprovalRequirement
What placing a cart now waits for. Read with the server's own credentials, so a buyer who may not read the unit's approval rules still learns that one applies.
| Field | Type | Description |
|---|---|---|
rule | OrderApprovalRuleReference! | The first rule the cart meets. |
limit | Money | The total above which the rule applies. Null when the rule is not a limit on the total alone. |
approvers | [OrderApprovalApprover!]! | Who may approve its first step. Empty when the server cannot name them, which does not mean no approval is needed. |
OrderApproval
An order awaiting or having completed approval
| Field | Type | Description |
|---|---|---|
id | ID! | Unique identifier of the approval flow |
version | String | Opaque optimistic-concurrency token, present only for engines that version their resources. Pass it back verbatim; never parse or compare it. |
status | OrderApprovalStatusType! | Current status of the approval flow |
order | Order | The order under approval. Null when there is no order to show: an engine that creates the order only once approval completes has none while the approval is pending, and an order that was deleted leaves the flow, which still counts towards its status. A client renders the approval without it. |
approval | OrderApprovalDecision | Approval decision, when approved |
rejection | OrderApprovalRejection | Rejection decision, when rejected |
pendingApproverRoleKeys | [String!]! | Associate-role keys currently eligible to decide |
viewerCanDecide | Boolean! | Whether the associate making this request may decide this flow, so a storefront can render the approve and reject controls only where they would succeed. Presentation only, never authorisation: the mutation decides independently and stays the authority. False for the associate who placed the order, false for an associate holding none of the pending approver roles, and false once the flow has been decided. |
OrderApprovalApprover
A person who may approve, by name, for a notice to say who an order waits for
| Field | Type | Description |
|---|---|---|
name | String! | Their name, or their email address where they have none |
roleName | String | The name of the role that lets them approve. Null where it has none. |
OrderApprovalCondition
Which orders a rule applies to. Zero clauses means the rule applies to every order of its requesters.
| Field | Type | Description |
|---|---|---|
match | OrderApprovalMatchType! | Whether every clause has to hold, or any one of them |
clauses | [OrderApprovalClause!]! | The clauses, one level deep |
OrderApprovalCustomFieldClause
An order custom field compared with a value
| Field | Type | Description |
|---|---|---|
name | String! | Name of the order custom field |
operator | OrderApprovalComparisonOperatorType! | |
value | String! | The value, written as text whatever the field's type |
OrderApprovalDecision
A recorded approval decision
OrderApprovalQuantityClause
A line's quantity compared with a number. Without a SKU, any line counts.
| Field | Type | Description |
|---|---|---|
operator | OrderApprovalComparisonOperatorType! | |
quantity | Int! | |
sku | String |
OrderApprovalRejection
A recorded rejection decision
OrderApprovalResponse
| Field | Type | Description |
|---|---|---|
orderApproval | OrderApproval | The updated approval flow |
orderApprovalErrors | [OrderApprovalError!] | Error details if the decision failed |
OrderApprovalResult
Paginated approval queue with per-status counts
| Field | Type | Description |
|---|---|---|
items | [OrderApproval!]! | Approval flows in the current page |
pagination | Pagination! | Where this page sits within the full result set |
pendingCount | Int! | Count of pending approval flows |
approvedCount | Int! | Count of approved approval flows |
rejectedCount | Int! | Count of rejected approval flows |
OrderApprovalRoleGroup
Any one of these roles approves for the group.
| Field | Type | Description |
|---|---|---|
anyOf | [String!]! | Associate-role keys, any one of which approves |
OrderApprovalRule
A B2B order approval rule
| Field | Type | Description |
|---|---|---|
id | ID! | Unique identifier of the rule |
version | String | Opaque optimistic-concurrency token, present only for engines that version their resources. Pass it back verbatim; never parse or compare it. |
key | String | User-defined key of the rule |
name | String! | Human-readable name of the rule |
description | String | What the rule is for, in the company's own words |
status | OrderApprovalRuleStatusType! | Whether the rule is active |
conditionEditable | Boolean! | Whether the condition can be read and changed as structured clauses. False when the condition was written elsewhere; condition is then null and only predicate describes it. |
condition | OrderApprovalCondition | Which orders of the requesters need approval, as structured clauses |
predicate | String! | The engine's own expression of the condition, for display only. Empty where the engine has no such expression. |
requesterRoleKeys | [String!]! | Associate-role keys whose orders the rule applies to |
approverTiers | [OrderApprovalTier!]! | Who approves, tier by tier |
minimumOrderTotalCents | Int | Minimum order total (in the currency's minor units, e.g. cents) at or above which the rule requires approval, when the condition is exactly that.Deprecated: Read condition, which also carries the currency. |
approverRoleKeys | [String!]! | Associate-role keys allowed to approve, in any tierDeprecated: Read approverTiers, which keeps the tiers apart. |
OrderApprovalRuleReference
The approval rule an order meets, by the name a buyer is shown. A reference rather than the rule itself: a buyer may not be allowed to read the rule.
| Field | Type | Description |
|---|---|---|
id | ID! | |
name | String! |
OrderApprovalRuleResponse
| Field | Type | Description |
|---|---|---|
orderApprovalRule | OrderApprovalRule | The created or updated rule |
orderApprovalRuleErrors | [OrderApprovalRuleError!] | Error details if the operation failed |
OrderApprovalRuleResult
Paginated result containing order approval rules
| Field | Type | Description |
|---|---|---|
items | [OrderApprovalRule!]! | Approval rules in the current page |
pagination | Pagination! | Where this page sits within the full result set |
OrderApprovalShippingCountryClause
Whether the order ships to one of these countries
| Field | Type | Description |
|---|---|---|
setOperator | OrderApprovalSetOperatorType! | Whether the list holds the values that match or the ones that do not. Named apart from operator on the other clauses, whose type differs, so one selection can read every clause of the union. |
countries | [CountryCode!]! |
OrderApprovalSkuClause
Whether the order has a line with one of these SKUs
| Field | Type | Description |
|---|---|---|
setOperator | OrderApprovalSetOperatorType! | Whether the list holds the values that match or the ones that do not. Named apart from operator on the other clauses, whose type differs, so one selection can read every clause of the union. |
skus | [String!]! |
OrderApprovalTier
Tiers approve in order; within a tier, every group must approve.
| Field | Type | Description |
|---|---|---|
allOf | [OrderApprovalRoleGroup!]! | The groups that each have to approve |
OrderApprovalTotalClause
The order total compared with an amount. Holds only for orders in the amount's currency.
| Field | Type | Description |
|---|---|---|
operator | OrderApprovalComparisonOperatorType! | |
amount | Money! |
Input objects
MoneyInput
An amount of money in a currency's minor units, e.g. cents
| Field | Type | Description |
|---|---|---|
centAmount | Int! | |
currency | Currency! |
OrderApprovalClauseInput
One condition on an order. Exactly one field is set.
| Field | Type | Description |
|---|---|---|
orderTotal | OrderApprovalTotalClauseInput | |
sku | OrderApprovalSkuClauseInput | |
lineItemQuantity | OrderApprovalQuantityClauseInput | |
shippingCountry | OrderApprovalShippingCountryClauseInput | |
customField | OrderApprovalCustomFieldClauseInput |
OrderApprovalConditionInput
Which orders a rule applies to. Zero clauses means every order.
| Field | Type | Description |
|---|---|---|
match | OrderApprovalMatchType | Whether every clause has to hold, or any one of them; ALL when left outDefault ALL |
clauses | [OrderApprovalClauseInput!] | The clauses, one level deep; none when left outDefault [] |
OrderApprovalCustomFieldClauseInput
An order custom field compared with a value. The field has to exist on the order's custom type, and the value has to fit its type; text, choice and yes-or-no fields compare only with EQ.
| Field | Type | Description |
|---|---|---|
name | String! | Name of the order custom field |
operator | OrderApprovalComparisonOperatorType! | |
value | String! | The value, written as text whatever the field's type |
OrderApprovalQuantityClauseInput
A line's quantity compared with a number. Without a SKU, any line counts.
| Field | Type | Description |
|---|---|---|
operator | OrderApprovalComparisonOperatorType! | |
quantity | Int! | Zero or more |
sku | String |
OrderApprovalRoleGroupInput
Any one of these roles approves for the group.
| Field | Type | Description |
|---|---|---|
anyOf | [ID!]! | Associate-role keys, any one of which approves; at least one |
OrderApprovalRuleCreateInput
Input to create an order approval rule
| Field | Type | Description |
|---|---|---|
key | String | User-defined key of the rule |
name | String! | Human-readable name of the rule |
description | String | What the rule is for, in the company's own words |
status | OrderApprovalRuleStatusType | Whether the rule is activeDefault ACTIVE |
condition | OrderApprovalConditionInput | Which orders need approval. Left out, every order of the requesters does. |
requesterRoleKeys | [ID!]! | Associate-role keys whose orders the rule applies to; at least one |
approverTiers | [OrderApprovalTierInput!]! | Who approves, tier by tier; at least one tier |
OrderApprovalRuleUpdateInput
Partial: only the fields given are changed. Leaving out condition leaves the rule's condition as it is, including one that cannot be edited.
| Field | Type | Description |
|---|---|---|
key | String | User-defined key of the rule; null removes it |
name | String | Human-readable name of the rule |
description | String | What the rule is for; null removes it |
status | OrderApprovalRuleStatusType | Whether the rule is active |
condition | OrderApprovalConditionInput | Which orders need approval. Refused for a rule whose condition is not editable. |
requesterRoleKeys | [ID!] | Associate-role keys whose orders the rule applies to; at least one |
approverTiers | [OrderApprovalTierInput!] | Who approves, tier by tier; at least one tier |
OrderApprovalShippingCountryClauseInput
Whether the order ships to one of these countries
| Field | Type | Description |
|---|---|---|
operator | OrderApprovalSetOperatorType! | |
countries | [CountryCode!]! | At least one |
OrderApprovalSkuClauseInput
Whether the order has a line with one of these SKUs
| Field | Type | Description |
|---|---|---|
operator | OrderApprovalSetOperatorType! | |
skus | [String!]! | At least one |
OrderApprovalTierInput
Tiers approve in order; within a tier, every group must approve.
| Field | Type | Description |
|---|---|---|
allOf | [OrderApprovalRoleGroupInput!]! | The groups that each have to approve; at least one |
OrderApprovalTotalClauseInput
The order total compared with an amount, for orders in its currency
| Field | Type | Description |
|---|---|---|
operator | OrderApprovalComparisonOperatorType! | |
amount | MoneyInput! | Zero or more |
Enums
OrderApprovalComparisonOperatorType
How a clause compares a number or a value
GT | Greater than |
GTE | Greater than or equal to |
LT | Less than |
LTE | Less than or equal to |
EQ | Equal to |
OrderApprovalMatchType
Whether a condition needs every clause to hold or any one of them
ALL | |
ANY |
OrderApprovalRuleStatusType
Whether an approval rule is currently in effect
ACTIVE | |
INACTIVE |
OrderApprovalSetOperatorType
Whether a clause holds for values in a list or outside it
IN | |
NOT_IN |
OrderApprovalStatusType
Status of an order approval flow
PENDING | Awaiting an approver's decision |
APPROVED | Approved and released |
REJECTED | Rejected |
Unions
OrderApprovalClause
One condition on an order
One of OrderApprovalTotalClause, OrderApprovalSkuClause, OrderApprovalQuantityClause, OrderApprovalShippingCountryClause or OrderApprovalCustomFieldClause.
OrderApprovalError
One of ValidationError.
OrderApprovalRuleError
One of ValidationError.

