Skip to content

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.

FieldTypeDescription
ruleOrderApprovalRuleReference!The first rule the cart meets.
limitMoneyThe 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

FieldTypeDescription
idID!Unique identifier of the approval flow
versionStringOpaque optimistic-concurrency token, present only for engines that version their resources. Pass it back verbatim; never parse or compare it.
statusOrderApprovalStatusType!Current status of the approval flow
orderOrderThe 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.
approvalOrderApprovalDecisionApproval decision, when approved
rejectionOrderApprovalRejectionRejection decision, when rejected
pendingApproverRoleKeys[String!]!Associate-role keys currently eligible to decide
viewerCanDecideBoolean!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

FieldTypeDescription
nameString!Their name, or their email address where they have none
roleNameStringThe 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.

FieldTypeDescription
matchOrderApprovalMatchType!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

FieldTypeDescription
nameString!Name of the order custom field
operatorOrderApprovalComparisonOperatorType!
valueString!The value, written as text whatever the field's type

OrderApprovalDecision

A recorded approval decision

FieldTypeDescription
approverCustomerThe associate (customer) who approved. Null where the merchant approved rather than an associate of the business unit.
approvedAtDateTime!When the approval was recorded

OrderApprovalQuantityClause

A line's quantity compared with a number. Without a SKU, any line counts.

FieldTypeDescription
operatorOrderApprovalComparisonOperatorType!
quantityInt!
skuString

OrderApprovalRejection

A recorded rejection decision

FieldTypeDescription
rejecterCustomerThe associate (customer) who rejected. Null where the merchant rejected rather than an associate of the business unit.
rejectedAtDateTime!When the rejection was recorded
reasonStringOptional reason supplied with the rejection

OrderApprovalResponse

FieldTypeDescription
orderApprovalOrderApprovalThe updated approval flow
orderApprovalErrors[OrderApprovalError!]Error details if the decision failed

OrderApprovalResult

Paginated approval queue with per-status counts

FieldTypeDescription
items[OrderApproval!]!Approval flows in the current page
paginationPagination!Where this page sits within the full result set
pendingCountInt!Count of pending approval flows
approvedCountInt!Count of approved approval flows
rejectedCountInt!Count of rejected approval flows

OrderApprovalRoleGroup

Any one of these roles approves for the group.

FieldTypeDescription
anyOf[String!]!Associate-role keys, any one of which approves

OrderApprovalRule

A B2B order approval rule

FieldTypeDescription
idID!Unique identifier of the rule
versionStringOpaque optimistic-concurrency token, present only for engines that version their resources. Pass it back verbatim; never parse or compare it.
keyStringUser-defined key of the rule
nameString!Human-readable name of the rule
descriptionStringWhat the rule is for, in the company's own words
statusOrderApprovalRuleStatusType!Whether the rule is active
conditionEditableBoolean!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.
conditionOrderApprovalConditionWhich orders of the requesters need approval, as structured clauses
predicateString!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
minimumOrderTotalCentsIntMinimum 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.

FieldTypeDescription
idID!
nameString!

OrderApprovalRuleResponse

FieldTypeDescription
orderApprovalRuleOrderApprovalRuleThe created or updated rule
orderApprovalRuleErrors[OrderApprovalRuleError!]Error details if the operation failed

OrderApprovalRuleResult

Paginated result containing order approval rules

FieldTypeDescription
items[OrderApprovalRule!]!Approval rules in the current page
paginationPagination!Where this page sits within the full result set

OrderApprovalShippingCountryClause

Whether the order ships to one of these countries

FieldTypeDescription
setOperatorOrderApprovalSetOperatorType!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

FieldTypeDescription
setOperatorOrderApprovalSetOperatorType!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.

FieldTypeDescription
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.

FieldTypeDescription
operatorOrderApprovalComparisonOperatorType!
amountMoney!

Input objects

MoneyInput

An amount of money in a currency's minor units, e.g. cents

FieldTypeDescription
centAmountInt!
currencyCurrency!

OrderApprovalClauseInput

One condition on an order. Exactly one field is set.

OrderApprovalConditionInput

Which orders a rule applies to. Zero clauses means every order.

FieldTypeDescription
matchOrderApprovalMatchTypeWhether 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.

FieldTypeDescription
nameString!Name of the order custom field
operatorOrderApprovalComparisonOperatorType!
valueString!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.

FieldTypeDescription
operatorOrderApprovalComparisonOperatorType!
quantityInt!Zero or more
skuString

OrderApprovalRoleGroupInput

Any one of these roles approves for the group.

FieldTypeDescription
anyOf[ID!]!Associate-role keys, any one of which approves; at least one

OrderApprovalRuleCreateInput

Input to create an order approval rule

FieldTypeDescription
keyStringUser-defined key of the rule
nameString!Human-readable name of the rule
descriptionStringWhat the rule is for, in the company's own words
statusOrderApprovalRuleStatusTypeWhether the rule is activeDefault ACTIVE
conditionOrderApprovalConditionInputWhich 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.

FieldTypeDescription
keyStringUser-defined key of the rule; null removes it
nameStringHuman-readable name of the rule
descriptionStringWhat the rule is for; null removes it
statusOrderApprovalRuleStatusTypeWhether the rule is active
conditionOrderApprovalConditionInputWhich 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

FieldTypeDescription
operatorOrderApprovalSetOperatorType!
countries[CountryCode!]!At least one

OrderApprovalSkuClauseInput

Whether the order has a line with one of these SKUs

FieldTypeDescription
operatorOrderApprovalSetOperatorType!
skus[String!]!At least one

OrderApprovalTierInput

Tiers approve in order; within a tier, every group must approve.

FieldTypeDescription
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

FieldTypeDescription
operatorOrderApprovalComparisonOperatorType!
amountMoneyInput!Zero or more

Enums

OrderApprovalComparisonOperatorType

How a clause compares a number or a value

GTGreater than
GTEGreater than or equal to
LTLess than
LTELess than or equal to
EQEqual 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

PENDINGAwaiting an approver's decision
APPROVEDApproved and released
REJECTEDRejected

Unions

OrderApprovalClause

One condition on an order

One of OrderApprovalTotalClause, OrderApprovalSkuClause, OrderApprovalQuantityClause, OrderApprovalShippingCountryClause or OrderApprovalCustomFieldClause.

OrderApprovalError

One of ValidationError.

OrderApprovalRuleError

One of ValidationError.