Shopware icon

Shopware

Shopware

Actions778

Rule → Create Rule

AI-generated

Overview

This node operation allows users to create a new Rule resource in the Shopware system. It is useful for automating the creation of business rules that can control various aspects of the Shopware platform, such as pricing, promotions, shipping, and payment methods. Users can specify detailed rule attributes including ID, name, priority, description, validity, and complex nested configurations like conditions, product prices, shipping method prices, payment methods, promotions, and more. This operation is beneficial for e-commerce administrators and developers who want to programmatically manage rules in their Shopware environment.

Use Case Examples

  1. Create a pricing rule that applies discounts based on customer groups and product categories.
  2. Automate the creation of shipping rules that vary by delivery method and geographic area.
  3. Set up promotional rules that trigger specific discounts or offers during checkout.

Properties

Name Meaning
Response Data format for response, either basic or detailed.
Id Unique identifier for the rule.
Name Name of the rule.
Priority Priority level of the rule.
Description Description of the rule.
Invalid Indicates if the rule is invalid (true or false).
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 for when the rule was created.
Updated At Timestamp string for when the rule was last updated.
Conditions JSON array defining the conditions under which the rule applies.
Product Prices JSON array specifying product price configurations for the rule.
Shipping Method Prices JSON array specifying shipping method price configurations for the rule.
Shipping Method Price Calculations JSON array specifying shipping method price calculation configurations for the rule.
Shipping Methods JSON array specifying shipping methods associated with the rule.
Payment Methods JSON array specifying payment methods associated with the rule.
Persona Promotions JSON array specifying persona promotions linked to the rule.
Flow Sequences JSON array specifying flow sequences related to the rule.
Tax Providers JSON array specifying tax providers linked to the rule.
Tags JSON array specifying tags associated with the rule.
Order Promotions JSON array specifying order promotions linked to the rule.
Cart Promotions JSON array specifying cart promotions linked to the rule.
Promotion Discounts JSON array specifying promotion discounts linked to the rule.
Promotion Set Groups JSON array specifying promotion set groups linked to the rule.

Output

JSON

  • id - Unique identifier of the created rule.
  • name - Name of the created rule.
  • priority - Priority level of the created rule.
  • description - Description of the created rule.
  • invalid - Indicates if the created rule is invalid.
  • 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 under which the rule applies.
  • productPrices - Product price configurations for the rule.
  • shippingMethodPrices - Shipping method price configurations for the rule.
  • shippingMethodPriceCalculations - Shipping method price calculation configurations for the rule.
  • shippingMethods - Shipping methods associated with the rule.
  • paymentMethods - Payment methods associated with the rule.
  • personaPromotions - Persona 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 linked to the rule.
  • promotionSetGroups - Promotion set groups linked to the rule.

Dependencies

  • Shopware API with appropriate credentials

Troubleshooting

  • Ensure all required fields (Id, Name, Priority) are provided to avoid validation errors.
  • Verify JSON format correctness for complex fields like conditions, productPrices, and promotions to prevent parsing errors.
  • Check API credentials and permissions to ensure the node can create rules in the Shopware system.
  • If the response is empty or unexpected, try switching the Response property between 'basic' and 'detail' to get more information.

Links

Discussion