Shopware icon

Shopware

Shopware

Actions778

Unit → Create Unit

AI-generated

Overview

This node operation creates a new Unit in the Shopware system. It is useful for scenarios where you need to programmatically add measurement units or similar entities to your Shopware store, such as during product setup or inventory management. For example, you can create a unit with a specific ID, short code, and name, along with optional custom fields and timestamps.

Use Case Examples

  1. Creating a new unit with ID 'unit123', short code 'kg', and name 'Kilogram' to be used for product measurements.
  2. Adding a unit with detailed custom fields and associated products for advanced inventory tracking.

Properties

Name Meaning
Response Data format for response, either basic or detailed.
Id Unique identifier for the unit to be created.
Short Code Short code representing the unit.
Name Name of the unit.
Custom Fields Custom JSON fields for additional unit data.
Created At Timestamp for when the unit was created.
Updated At Timestamp for when the unit was last updated.
Translated JSON object containing translated fields for the unit.
Products JSON array of products associated with the unit.

Output

JSON

  • id - The unique identifier of the created unit.
  • shortCode - The short code of the created unit.
  • name - The name of the created unit.
  • customFields - Custom fields associated with the unit.
  • createdAt - Creation timestamp of the unit.
  • updatedAt - Last update timestamp of the unit.
  • translated - Translated fields of the unit.
  • products - Products associated with the unit.

Dependencies

  • An API key credential for Shopware Admin API

Troubleshooting

  • Ensure all required fields (Id, Short Code, Name) are provided to avoid validation errors.
  • Check API credentials and base URL configuration if authentication fails.
  • If the response format is not as expected, verify the '_response' property value (basic or detail).
  • For JSON fields like Custom Fields, Translated, and Products, ensure valid JSON syntax to prevent parsing errors.

Discussion