mutation query to remove and alter a payment customization rule

Hi dev

i am trying to create app with payment customization extension, i successfully created

Please find logs below for same , my question is that how can i remove or alter created rule

/====================Request ================/

mutation {
paymentCustomizationCreate(paymentCustomization: {
title: “Hide payment method by cart total”,
enabled: true,
functionId: “02f40882-9820-4052-8e65-96eaa3557b8f”,
}) {
paymentCustomization {
id
}
userErrors {
message
}
}
}

/====================Response ================/

{
“data”: {
“paymentCustomizationCreate”: {
“paymentCustomization”: {
“id”: “gid://shopify/PaymentCustomization/66191670”
},
“userErrors”: []
}
},
“extensions”: {
“cost”: {
“requestedQueryCost”: 10,
“actualQueryCost”: 10,
“throttleStatus”: {
“maximumAvailable”: 2000,
“currentlyAvailable”: 1990,
“restoreRate”: 100
}
}
}
}

1.Removing a Rule:

mutation {
  paymentCustomizationDelete(id: "gid://shopify/PaymentCustomization/66191670") {
    deletedPaymentCustomizationId
    userErrors {
      message
    }
  }
}

2.Altering a Rule:

mutation {
  paymentCustomizationUpdate(id: "gid://shopify/PaymentCustomization/66191670", input: {
    title: "New title",
    enabled: true,
    functionId: "new-function-id"
  }) {
    paymentCustomization {
      id
      title
      enabled
      functionId
    }
    userErrors {
      message
    }
  }
}

Replace “New title” and “new-function-id” with the new values you want to set for the rule. Also, ensure that you provide all required fields for the mutation.

1 Like