Skip to content

orderApprovalStatusUpdate

Mutationin Order approval

Approve or reject an order approval flow. Enforced server-side: the buyer may never approve their own order, and only an eligible approver role may decide.

Arguments

ArgumentTypeDescription
businessUnitIdID!
idID!
versionStringExpected optimistic-concurrency token, to fail the write if the approval changed meanwhile. Omit to apply the decision to the current version; engines without versioning ignore it.
statusOrderApprovalStatusType!
reasonString

Returns

OrderApprovalResponse!

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

Example

mutation OrderApprovalStatusUpdate(
$businessUnitId: ID!
$id: ID!
$version: String
$status: OrderApprovalStatusType!
$reason: String
) {
orderApprovalStatusUpdate(
businessUnitId: $businessUnitId
id: $id
version: $version
status: $status
reason: $reason
) {
orderApproval {
id
version
status
pendingApproverRoleKeys
viewerCanDecide
}
orderApprovalErrors {
__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/medusaResolved
@evolve-framework/sfccResolved

Used by

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