updateProductCategoriesWorkflow - Medusa Core Workflows Reference
This documentation provides a reference to the updateProductCategoriesWorkflow
. It belongs to the @medusajs/medusa/core-flows
package.
This workflow updates product categories matching specified filters. It's used by the Update Product Category Admin API Route.
You can use this workflow within your customizations or your own custom workflows, allowing you to update product categories within your custom flows.
Source CodeExamples#
Steps#
Workflow hook
Step conditioned by when
View step details
Input#
UpdateProductCategoriesWorkflowInput
UpdateProductCategoriesWorkflowInput
UpdateProductCategoriesWorkflowInput
UpdateProductCategoriesWorkflowInputselector
FilterableProductCategoryPropsThe filters to select the product categories to update.
selector
FilterableProductCategoryPropsupdate
UpdateProductCategoryDTOThe data to update in the product categories.
update
UpdateProductCategoryDTOadditional_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.
categoriesUpdated#
This step is a hook that you can inject custom functionality into.
Example
Input
Handlers consuming this hook accept the following input.
input
inputThe input data for the hook.
input
inputcategories
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.Emitted Events#
This section lists the events that are either triggered by the emitEventStep
in the workflow, or by another workflow executed within this workflow.
You can listen to these events in a subscriber, as explained in the Subscribers documentation.
Event | Description | Payload | Action |
---|---|---|---|
| Emitted when product categories are updated. |
|