Shopware icon

Shopware

Shopware

Actions778

Promotion → Create Promotion

AI-generated

Overview

This node operation creates a new promotion in the Shopware system. It allows users to specify detailed promotion attributes such as ID, name, active status, validity period, redemption limits, priority, exclusivity, codes, customer restrictions, and various rules and conditions related to sales channels, discounts, individual codes, persona rules, order rules, cart rules, and order line items. This operation is beneficial for e-commerce businesses looking to automate the creation and management of promotional campaigns with complex configurations.

Use Case Examples

  1. Creating a promotion with a specific ID and name, setting it as active, defining its validity period, and specifying maximum redemptions globally and per customer.
  2. Defining promotion codes and individual code patterns for targeted marketing campaigns.
  3. Setting up customer restrictions and preventing combination with other promotions to control promotion applicability.
  4. Configuring detailed rules for sales channels, discounts, persona, orders, carts, and order line items to tailor the promotion to specific business needs.

Properties

Name Meaning
Response Data format for response, either basic or detailed.
Id Unique identifier for the promotion.
Name Name of the promotion.
Active Whether the promotion is active or not.
Valid From Start date/time from which the promotion is valid.
Valid Until End date/time until which the promotion is valid.
Max Redemptions Global Maximum number of times the promotion can be redeemed globally.
Max Redemptions Per Customer Maximum number of times the promotion can be redeemed per customer.
Priority Priority level of the promotion.
Exclusive Whether the promotion is exclusive.
Code Promotion code.
Use Codes Whether to use codes for the promotion.
Use Individual Codes Whether to use individual codes for the promotion.
Individual Code Pattern Pattern for individual codes.
Use Set Groups Whether to use set groups for the promotion.
Customer Restriction Whether there is a customer restriction for the promotion.
Prevent Combination Whether to prevent combination with other promotions.
Order Count Count of orders related to the promotion.
Orders Per Customer Count JSON object representing orders per customer count.
Exclusion Ids JSON array of exclusion IDs.
Custom Fields JSON object for custom fields.
Created At Creation date/time of the promotion.
Updated At Last update date/time of the promotion.
Translated JSON object representing translated fields.
Setgroups JSON array representing set groups associated with the promotion.
Sales Channels JSON array representing sales channels associated with the promotion.
Discounts JSON array representing discounts associated with the promotion.
Individual Codes JSON array representing individual codes associated with the promotion.
Persona Rules JSON array representing persona rules associated with the promotion.
Persona Customers JSON array representing persona customers associated with the promotion.
Order Rules JSON array representing order rules associated with the promotion.
Cart Rules JSON array representing cart rules associated with the promotion.
Order Line Items JSON array representing order line items associated with the promotion.

Output

JSON

  • id - Unique identifier of the created promotion.
  • name - Name of the created promotion.
  • active - Active status of the created promotion.
  • validFrom - Start date/time of the promotion validity.
  • validUntil - End date/time of the promotion validity.
  • maxRedemptionsGlobal - Maximum global redemptions allowed.
  • maxRedemptionsPerCustomer - Maximum redemptions allowed per customer.
  • priority - Priority level of the promotion.
  • exclusive - Indicates if the promotion is exclusive.
  • code - Promotion code.
  • useCodes - Flag indicating if codes are used.
  • useIndividualCodes - Flag indicating if individual codes are used.
  • individualCodePattern - Pattern for individual codes.
  • useSetGroups - Flag indicating if set groups are used.
  • customerRestriction - Flag indicating customer restriction.
  • preventCombination - Flag indicating if combination with other promotions is prevented.
  • orderCount - Number of orders related to the promotion.
  • ordersPerCustomerCount - Orders per customer count as JSON.
  • exclusionIds - List of exclusion IDs.
  • customFields - Custom fields as JSON.
  • createdAt - Creation timestamp.
  • updatedAt - Last update timestamp.
  • translated - Translated fields as JSON.
  • setgroups - Set groups associated with the promotion as JSON.
  • salesChannels - Sales channels associated with the promotion as JSON.
  • discounts - Discounts associated with the promotion as JSON.
  • individualCodes - Individual codes associated with the promotion as JSON.
  • personaRules - Persona rules associated with the promotion as JSON.
  • personaCustomers - Persona customers associated with the promotion as JSON.
  • orderRules - Order rules associated with the promotion as JSON.
  • cartRules - Cart rules associated with the promotion as JSON.
  • orderLineItems - Order line items associated with the promotion as JSON.

Dependencies

  • An API key credential for Shopware Admin API

Troubleshooting

  • Ensure all required fields (Id, Name) are provided to avoid validation errors.
  • Verify JSON fields (e.g., ordersPerCustomerCount, exclusionIds, customFields) are correctly formatted to prevent parsing errors.
  • Check API credentials and base URL configuration to avoid authentication or connection issues.
  • If the promotion creation fails, review the response for specific error messages related to business rules or data constraints.

Discussion