data-src=../../../../../includes/commerce-only.md
updatePurchaseOrderApprovalRule mutation
The updatePurchaseOrderApprovalRule mutation updates the specified purchase order approval rule.
You can use the customer query to retrieve the uid value of the approval rule.
The createPurchaseOrderApprovalRule mutation describes the requirements of the condition and approvers fields.
Syntax
mutation {
updatePurchaseOrderApprovalRule(
input: UpdatePurchaseOrderApprovalRuleInput!
) {
PurchaseOrderApprovalRule
}
}
Reference
The updatePurchaseOrderApprovalRule reference provides detailed information about the types and fields defined in this mutation.
Headers
A valid customer authentication token is required.
Example usage
The following example updates the purchase order approval rule.
Request:
mutation {
updatePurchaseOrderApprovalRule(
input: {
uid: "Mg==",
name: "Rule name updated",
description: "Rule description",
applies_to: [],
status: ENABLED,
condition: {
attribute: GRAND_TOTAL,
operator: MORE_THAN,
amount: {
value: 100.00,
currency: EUR
}
}
}
) {
uid
name
}
}
Response:
{
"data": {
"updatePurchaseOrderApprovalRule": {
"uid": "Mg==",
"name": "Rule name updated"
}
}
}