Shopware icon

Shopware

Shopware

Actions778

Rule → Update Rule

AI-generated

Overview

This node operation updates an existing Rule resource in the Shopware system. It allows users to modify various attributes of a rule such as its identifier, name, priority, description, validity status, and complex nested properties like areas, conditions, product prices, shipping method prices, payment methods, promotions, and more. This operation is beneficial for managing business rules dynamically within an e-commerce platform, enabling automation and customization of pricing, promotions, shipping, and other rule-based logic.

Use Case Examples

  1. Updating a pricing rule to change its priority and add new conditions for product discounts.
  2. Modifying a shipping rule to update shipping method prices and availability based on new criteria.
  3. Adjusting promotional rules to include new customer segments or product categories.

Properties

Name Meaning
Id Identifier for the rule, required to specify which rule to update.
Response Data format for response, used as a query parameter to specify the response format.
Name Name of the rule, required for identification and management.
Priority Priority of the rule, required to determine rule precedence.
Description Description of the rule, optional for additional context.
Invalid Boolean flag indicating if the rule is invalid or not.
Areas JSON array defining the areas where the rule applies.
Custom Fields JSON object for custom fields associated with the rule.
Module Types JSON object specifying module types related to the rule.
Created At Timestamp string indicating when the rule was created.
Updated At Timestamp string indicating when the rule was last updated.
Conditions JSON array defining the conditions under which the rule applies.
Product Prices JSON array specifying product price details related to the rule.
Shipping Method Prices JSON array specifying shipping method price details related to the rule.
Shipping Method Price Calculations JSON array for shipping method price calculation details.
Shipping Methods JSON array listing shipping methods associated with the rule.
Payment Methods JSON array listing payment methods associated with the rule.
Persona Promotions JSON array defining persona-based promotions linked to the rule.
Flow Sequences JSON array defining flow sequences related to the rule.
Tax Providers JSON array specifying tax providers linked to the rule.
Tags JSON array of tags associated with the rule.
Order Promotions JSON array defining order promotions linked to the rule.
Cart Promotions JSON array defining cart promotions linked to the rule.
Promotion Discounts JSON array specifying promotion discounts related to the rule.
Promotion Set Groups JSON array defining promotion set groups linked to the rule.
Request Options Collection of request options such as batching, SSL settings, proxy, and timeout.

Output

JSON

  • id - Identifier of the updated rule
  • name - Name of the updated rule
  • priority - Priority level of the updated rule
  • description - Description of the updated rule
  • invalid - Validity status of the updated rule
  • areas - Areas where the rule applies
  • customFields - Custom fields associated with the rule
  • moduleTypes - Module types related to the rule
  • createdAt - Creation timestamp of the rule
  • updatedAt - Last update timestamp of the rule
  • conditions - Conditions defining the rule's application
  • productPrices - Product price details related to the rule
  • shippingMethodPrices - Shipping method price details related to the rule
  • shippingMethodPriceCalculations - Shipping method price calculation details
  • shippingMethods - Shipping methods associated with the rule
  • paymentMethods - Payment methods associated with the rule
  • personaPromotions - Persona-based promotions linked to the rule
  • flowSequences - Flow sequences related to the rule
  • taxProviders - Tax providers linked to the rule
  • tags - Tags associated with the rule
  • orderPromotions - Order promotions linked to the rule
  • cartPromotions - Cart promotions linked to the rule
  • promotionDiscounts - Promotion discounts related to the rule
  • promotionSetGroups - Promotion set groups linked to the rule

Dependencies

  • an API key credential for Shopware Admin API

Troubleshooting

  • Ensure the 'Id' property is correctly set to the rule you want to update; otherwise, the update will fail.
  • Verify that JSON properties like 'areas', 'conditions', 'productPrices', etc., are valid JSON strings to avoid parsing errors.
  • Check API credentials and base URL configuration to ensure successful authentication and connection to the Shopware Admin API.
  • If the API returns errors, review the error message for details on missing or invalid fields and adjust the input accordingly.

Discussion