Shopware icon

Shopware

Shopware

Actions778

Rule Condition → Create Rule Condition

AI-generated

Overview

This node operation creates a new Rule Condition in the Shopware system. It is useful for automating the creation of rule conditions that define specific criteria or logic within Shopware's rule engine, such as conditions for promotions, shipping methods, or other business rules. For example, a user can create a rule condition specifying a type, associated rule ID, and other parameters to dynamically manage business logic in Shopware.

Use Case Examples

  1. Create a rule condition with a specific type and rule ID to apply a discount only to certain products.
  2. Add a nested rule condition with custom fields and script conditions to handle complex business logic.

Properties

Name Meaning
Response Data format for response, either basic or detailed.
Id Unique identifier for the rule condition.
Type Type of the rule condition.
Rule Id Identifier of the rule to which this condition belongs.
Script Id Identifier for an associated script, if any.
Parent Id Identifier of the parent rule condition, if nested.
Value JSON object representing the value or parameters of the condition.
Position Position or order of the condition within the rule.
Custom Fields Custom fields as a JSON object for additional data.
Created At Timestamp of when the condition was created.
Updated At Timestamp of the last update to the condition.
Rule JSON object representing the full rule structure associated with the condition.
App Script Condition JSON object representing app script conditions related to the rule condition.
Parent JSON object representing the parent rule condition structure.
Children JSON array representing child rule conditions nested under this condition.
Request Options Settings for request behavior such as batching, SSL, proxy, and timeout.

Output

JSON

  • id - Unique identifier of the created rule condition.
  • type - Type of the created rule condition.
  • ruleId - Identifier of the rule associated with the condition.
  • scriptId - Identifier of the associated script, if any.
  • parentId - Identifier of the parent condition, if nested.
  • value - Value or parameters of the condition as a JSON object.
  • position - Position of the condition within the rule.
  • customFields - Custom fields data as JSON.
  • createdAt - Creation timestamp.
  • updatedAt - Last update timestamp.
  • rule - Full rule structure as JSON.
  • appScriptCondition - App script condition data as JSON.
  • parent - Parent condition structure as JSON.
  • children - Child conditions as JSON array.

Dependencies

  • Shopware API with authentication credentials

Troubleshooting

  • Ensure all required fields (Id, Type, Rule Id) are provided to avoid validation errors.
  • Check JSON formatting for fields like Value, Custom Fields, Rule, App Script Condition, Parent, and Children to prevent parsing errors.
  • Verify API credentials and endpoint URL to avoid authentication or connection issues.
  • If using custom scripts or nested conditions, ensure the JSON structure matches Shopware's expected schema to prevent errors.

Discussion