createProductCategoriesWorkflow - Medusa Core Workflows Reference
This documentation provides a reference to the createProductCategoriesWorkflow
. It belongs to the @medusajs/medusa/core-flows
package.
This workflow creates one or more product categories. It's used by the Create Product Category Admin API Route.
You can use this workflow within your customizations or your own custom workflows, allowing you to create product categories within your custom flows.
Source CodeExamples#
Steps#
Workflow hook
Step conditioned by when
View step details
Input#
CreateProductCategoriesWorkflowInput
CreateProductCategoriesWorkflowInput
CreateProductCategoriesWorkflowInput
CreateProductCategoriesWorkflowInputproduct_categories
CreateProductCategoryDTO[]The product categories to create.
product_categories
CreateProductCategoryDTO[]additional_data
Record<string, unknown>OptionalAdditional data that can be passed through the additional_data
property in HTTP requests.
Learn more in this documentation.
additional_data
Record<string, unknown>Optionaladditional_data
property in HTTP requests.
Learn more in this documentation.Output#
ProductCategoryDTO[]
ProductCategoryDTO[]
ProductCategoryDTO[]
ProductCategoryDTO[]id
stringThe ID of the product category.
id
stringname
stringThe name of the product category.
name
stringdescription
stringThe description of the product category.
description
stringhandle
stringThe handle of the product category. The handle can be used to create slug URL paths.
handle
stringis_active
booleanWhether the product category is active.
is_active
booleanis_internal
booleanWhether the product category is internal. This can be used to only show the product category to admins and hide it from customers.
is_internal
booleanrank
numberThe ranking of the product category among sibling categories.
rank
numberThe associated parent category.
parent_category_id
null | stringThe associated parent category id.
parent_category_id
null | stringThe associated child categories.
The associated products.
created_at
string | DateWhen the product category was created.
created_at
string | Dateupdated_at
string | DateWhen the product category was updated.
updated_at
string | DateThe ranking of the product category among sibling categories.
deleted_at
string | DateOptionalWhen the product category was deleted.
deleted_at
string | DateOptionalHooks#
Hooks allow you to inject custom functionalities into the workflow. You'll receive data from the workflow, as well as additional data sent through an HTTP request.
Learn more about Hooks and Additional Data.
categoriesCreated#
Handlers consuming this hook accept the following input.
input
object
input
objectcategories
ProductCategoryDTO[]
categories
ProductCategoryDTO[]additional_data
Record<string, unknown> | undefinedAdditional data that can be passed through the additional_data
property in HTTP requests.
Learn more in this documentation.
additional_data
Record<string, unknown> | undefinedadditional_data
property in HTTP requests.
Learn more in this documentation.Was this page helpful?