Skip to content

orderApprovalRuleCreate

Mutationin Order approval

Create an order approval rule for a business unit. Invalid input is answered with a ValidationError whose field paths name the input, such as approverTiers.0.allOf.1.anyOf or condition.clauses.2.orderTotal.amount.

Arguments

ArgumentTypeDescription
businessUnitIdID!
inputOrderApprovalRuleCreateInput!

Returns

OrderApprovalRuleResponse!

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

Example

mutation OrderApprovalRuleCreate(
$businessUnitId: ID!
$input: OrderApprovalRuleCreateInput!
) {
orderApprovalRuleCreate(businessUnitId: $businessUnitId, input: $input) {
orderApprovalRule {
id
version
key
name
description
status
conditionEditable
predicate
requesterRoleKeys
}
orderApprovalRuleErrors {
__typename
... on ValidationError {
message
}
}
}
}

The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.

Served by

@evolve-framework/commercetoolsResolved
@evolve-framework/medusaStub: answers Not implemented
@evolve-framework/sfccResolved

Used by

The storefront packages that send it, in these GraphQL documents: