docs: [10/n] generate core-flows reference (#8791)
This commit is contained in:
1 parent
842c26cb46
commit
c4dd82e814
52 files changed
+1888
No files matched your search
+16
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/batchLinkProductsToCategoryWorkflow
|
||||||
|
sidebar_label: batchLinkProductsToCategoryWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# batchLinkProductsToCategoryWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `batchLinkProductsToCategoryWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow creates links between product and category records.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"BatchUpdateProductsOnCategoryWorkflowInput","type":"[BatchUpdateProductsOnCategoryWorkflowInput](../../../../../types/WorkflowTypes/ProductCategoryWorkflow/interfaces/types.WorkflowTypes.ProductCategoryWorkflow.BatchUpdateProductsOnCategoryWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"add","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remove","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="batchLinkProductsToCategoryWorkflow"/>
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/batchLinkProductsToCollectionWorkflow
|
||||||
|
sidebar_label: batchLinkProductsToCollectionWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# batchLinkProductsToCollectionWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `batchLinkProductsToCollectionWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow creates links between product and collection records.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"batchLinkProductsToCollectionWorkflow","steps":[{"type":"step","name":"batchLinkProductsToCollectionStep","description":"This step creates links between product and collection records.","link":"../../../../core_flows.Steps_Product/page.mdx#batchlinkproductstocollectionstep","depth":1}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"LinkWorkflowInput","type":"[LinkWorkflowInput](../../../../../types/CommonTypes/types/types.CommonTypes.LinkWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"add","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remove","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="batchLinkProductsToCollectionWorkflow"/>
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/batchProductVariantsWorkflow
|
||||||
|
sidebar_label: batchProductVariantsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# batchProductVariantsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `batchProductVariantsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow creates, updates, and deletes product variants.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"batchProductVariantsWorkflow","steps":[{"type":"workflow","name":"createProductVariantsWorkflow","description":"This workflow creates one or more product variants.","link":"../../../../core_flows.Workflows_Product/page.mdx#createproductvariantsworkflow","depth":1},{"type":"workflow","name":"updateProductVariantsWorkflow","description":"This workflow updates one or more product variants.","link":"../../../../core_flows.Workflows_Product/page.mdx#updateproductvariantsworkflow","depth":1},{"type":"workflow","name":"deleteProductVariantsWorkflow","description":"This workflow deletes one or more product variants.","link":"../../../../core_flows.Workflows_Product/page.mdx#deleteproductvariantsworkflow","depth":1}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"BatchWorkflowInput","type":"[BatchWorkflowInput](../../../../../types/CommonTypes/types/types.CommonTypes.BatchWorkflowInput/page.mdx)<[CreateProductVariantWorkflowInputDTO](../../../../../types/types/types.CreateProductVariantWorkflowInputDTO/page.mdx), [UpdateProductVariantWorkflowInputDTO](../../../../../types/types/types.UpdateProductVariantWorkflowInputDTO/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CreateProductVariantWorkflowInputDTO","type":"[CreateProductVariantWorkflowInputDTO](../../../../../types/types/types.CreateProductVariantWorkflowInputDTO/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The id of the product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The EAN of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The UPC of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The HS Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The origin country of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The MID Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The material of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The weight of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The length of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The height of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The width of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"The options of the variant. Each key is an option's title, and value\nis an option's value. If an option with the specified title doesn't exist,\na new one is created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreateMoneyAmountDTO](../../../../../pricing/interfaces/pricing.CreateMoneyAmountDTO/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../../../pricing/types/pricing.BigNumberInput/page.mdx)","descriptioLine truncated
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"BatchWorkflowOutput","type":"[BatchWorkflowOutput](../../../../../types/CommonTypes/types/types.CommonTypes.BatchWorkflowOutput/page.mdx)<[ProductVariantDTO](../../../../../product/interfaces/product.ProductVariantDTO/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductVariantDTO","type":"[ProductVariantDTO](../../../../../product/interfaces/product.ProductVariantDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product variant's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The SKU of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The barcode of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The EAN of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The UPC of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the product variant's requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[ProductOptionValueDTO](../../../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product options.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option value was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option value was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option","type":"`null` \\| [ProductOptionDTO](../../../../../product/interfaces/product.ProductOptionDTO/page.mdx)","description":"The associated product option. It may only be available if the `option` relation is expanded.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"option_id","type":"`null` \\| `string`","description":"The associated product option id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairsLine truncated
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/batchProductsWorkflow
|
||||||
|
sidebar_label: batchProductsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# batchProductsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `batchProductsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow creates, updates, or deletes products.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"batchProductsWorkflow","steps":[{"type":"workflow","name":"createProductsWorkflow","description":"This workflow creates one or more products.","link":"../../../../core_flows.Workflows_Product/page.mdx#createproductsworkflow","depth":1},{"type":"workflow","name":"updateProductsWorkflow","description":"This workflow updates one or more products.","link":"../../../../core_flows.Workflows_Product/page.mdx#updateproductsworkflow","depth":1},{"type":"workflow","name":"deleteProductsWorkflow","description":"This workflow deletes one or more products.","link":"../../../../core_flows.Workflows_Product/page.mdx#deleteproductsworkflow","depth":1}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"BatchWorkflowInput","type":"[BatchWorkflowInput](../../../../../types/CommonTypes/types/types.CommonTypes.BatchWorkflowInput/page.mdx)<[CreateProductWorkflowInputDTO](../../../../../types/types/types.CreateProductWorkflowInputDTO/page.mdx), [UpdateProductWorkflowInputDTO](../../../../../types/types/types.UpdateProductWorkflowInputDTO/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CreateProductWorkflowInputDTO","type":"[CreateProductWorkflowInputDTO](../../../../../types/types/types.CreateProductWorkflowInputDTO/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"sales_channels","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"variants","type":"[CreateProductVariantWorkflowInputDTO](../../../../../types/types/types.CreateProductVariantWorkflowInputDTO/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The id of the product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The EAN of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The UPC of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The HS Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The origin country of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The MID Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The material of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The weight of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The length of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The height of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The width of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"The options of the variant. Each key is an option's title, and value\nis an option's value. If an option with the specified title doesn't exist,\na new one is created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreateMoneyAmountDTO](../../../../../pricing/interfaces/pricing.CreateMoneyAmountDTO/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"UpdateProductWorkflowInputDTO","type":"[UpdateProductWorkflowInputDTO](../../../../../types/types/types.UpdateProductWorkflowInputDTO/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product to update. If not provided, a product\nis created instead. In that case, the `title` property is required.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","descLine truncated
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"BatchWorkflowOutput","type":"[BatchWorkflowOutput](../../../../../types/CommonTypes/types/types.CommonTypes.BatchWorkflowOutput/page.mdx)<[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductDTO","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product collection was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product collection was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product collection was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associateLine truncated
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/createCollectionsWorkflow
|
||||||
|
sidebar_label: createCollectionsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createCollectionsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `createCollectionsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow creates one or more collections.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createCollectionsWorkflow","steps":[{"type":"step","name":"createCollectionsStep","description":"This step creates one or more collection.","link":"../../../../core_flows.Steps_Product/page.mdx#createcollectionsstep","depth":1},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":2},{"type":"hook","name":"collectionsCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#collectionsCreated","depth":3}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreateCollectionsWorkflowInput","type":"[CreateCollectionsWorkflowInput](../../../../types/core_flows.CreateCollectionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"collections","type":"[CreateProductCollectionDTO](../../../../../product/interfaces/product.CreateProductCollectionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The product collection's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product collection's handle. If not provided, the value of this attribute is set to the slug version of the title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_ids","type":"`string`[]","description":"The products to associate with the collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createCollectionsWorkflow"/>
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductCollectionDTO[]","type":"[ProductCollectionDTO](../../../../../product/interfaces/product.ProductCollectionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductCollectionDTO","type":"[ProductCollectionDTO](../../../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product collection's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product collection was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product collection was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product collection was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValLine truncated
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### collectionsCreated
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { createCollectionsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
createCollectionsWorkflow.hooks.collectionsCreated(
|
||||||
|
async (({ collections, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"collections","type":"[ProductCollectionDTO](../../../../../product/interfaces/product.ProductCollectionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product collection was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product collection was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product collection was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="collectionsCreated"/>
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/createProductOptionsWorkflow
|
||||||
|
sidebar_label: createProductOptionsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createProductOptionsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `createProductOptionsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow creates one or more product options.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createProductOptionsWorkflow","steps":[{"type":"step","name":"createProductOptionsStep","description":"This step creates one or more product options.","link":"../../../../core_flows.Steps_Product/page.mdx#createproductoptionsstep","depth":1},{"type":"hook","name":"productOptionsCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productOptionsCreated","depth":2}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreateProductOptionsWorkflowInput","type":"[CreateProductOptionsWorkflowInput](../../../../types/core_flows.CreateProductOptionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_options","type":"[CreateProductOptionDTO](../../../../../product/interfaces/product.CreateProductOptionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The product option's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The product option values.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createProductOptionsWorkflow"/>
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductOptionDTO[]","type":"[ProductOptionDTO](../../../../../product/interfaces/product.ProductOptionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductOptionDTO","type":"[ProductOptionDTO](../../../../../product/interfaces/product.ProductOptionDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product option's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[ProductOptionValueDTO](../../../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product option values.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option value was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option value was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option","type":"`null` \\| [ProductOptionDTO](../../../../../product/interfaces/product.ProductOptionDTO/page.mdx)","description":"The associated product option. It may only be available if the `option` relation is expanded.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"option_id","type":"`null` \\| `string`","description":"The associated product option id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product option value was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)","description":"The associated product.","optional":true,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The hLine truncated
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### productOptionsCreated
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { createProductOptionsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
createProductOptionsWorkflow.hooks.productOptionsCreated(
|
||||||
|
async (({ product_options, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_options","type":"[ProductOptionDTO](../../../../../product/interfaces/product.ProductOptionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[ProductOptionValueDTO](../../../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product option values.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)","description":"The associated product.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"product_id","type":"`null` \\| `string`","description":"The associated product id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product option was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productOptionsCreated"/>
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/createProductTagsWorkflow
|
||||||
|
sidebar_label: createProductTagsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createProductTagsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `createProductTagsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow creates one or more product tags.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createProductTagsWorkflow","steps":[{"type":"step","name":"createProductTagsStep","description":"This step creates one or more product tags.","link":"../../../../core_flows.Steps_Product/page.mdx#createproducttagsstep","depth":1},{"type":"hook","name":"productTagsCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTagsCreated","depth":2}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreateProductTagsWorkflowInput","type":"[CreateProductTagsWorkflowInput](../../../../types/core_flows.CreateProductTagsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_tags","type":"[CreateProductTagDTO](../../../../../product/interfaces/product.CreateProductTagDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The value of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createProductTagsWorkflow"/>
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductTagDTO[]","type":"[ProductTagDTO](../../../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductTagDTO","type":"[ProductTagDTO](../../../../../product/interfaces/product.ProductTagDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product tag's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)","description":"The associated product type.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The associated product type id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"[ProductTagDTO](../../../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","description":"The associated product tags.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"variants","type":"[ProductVariantDTO](../../../../../product/interfaces/product.ProductVariantDTO/page.mdx)[]","description":"The Line truncated
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### productTagsCreated
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { createProductTagsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
createProductTagsWorkflow.hooks.productTagsCreated(
|
||||||
|
async (({ product_tags, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_tags","type":"[ProductTagDTO](../../../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTagsCreated"/>
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/createProductTypesWorkflow
|
||||||
|
sidebar_label: createProductTypesWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createProductTypesWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `createProductTypesWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow creates one or more product types.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createProductTypesWorkflow","steps":[{"type":"step","name":"createProductTypesStep","description":"This step creates one or more product types.","link":"../../../../core_flows.Steps_Product/page.mdx#createproducttypesstep","depth":1},{"type":"hook","name":"productTypesCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTypesCreated","depth":2}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreateProductTypesWorkflowInput","type":"[CreateProductTypesWorkflowInput](../../../../types/core_flows.CreateProductTypesWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_types","type":"[CreateProductTypeDTO](../../../../../product/interfaces/product.CreateProductTypeDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The product type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createProductTypesWorkflow"/>
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductTypeDTO[]","type":"[ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductTypeDTO","type":"[ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product type's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createProductTypesWorkflow"/>
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### productTypesCreated
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { createProductTypesWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
createProductTypesWorkflow.hooks.productTypesCreated(
|
||||||
|
async (({ product_types, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_types","type":"[ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTypesCreated"/>
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/createProductVariantsWorkflow
|
||||||
|
sidebar_label: createProductVariantsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createProductVariantsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `createProductVariantsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow creates one or more product variants.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createProductVariantsWorkflow","steps":[{"type":"step","name":"createProductVariantsStep","description":"This step creates one or more product variants.","link":"../../../../core_flows.Steps_Product/page.mdx#createproductvariantsstep","depth":1},{"type":"workflow","name":"createInventoryItemsWorkflow","description":"This workflow creates one or more inventory items.","link":"../../../../core_flows.Workflows_Inventory/page.mdx#createinventoryitemsworkflow","depth":2},{"type":"workflow","name":"createLinksWorkflow","description":"This workflow creates one or more links between records.","link":"../../../../core_flows.Workflows_Common/page.mdx#createlinksworkflow","depth":3},{"type":"step","name":"createPriceSetsStep","description":"This step creates one or more price sets.","link":"../../../../core_flows.Steps_Pricing/page.mdx#createpricesetsstep","depth":4},{"type":"step","name":"createVariantPricingLinkStep","description":"This step creates links between variant and price set records.","link":"../../../../core_flows.Steps_Product/page.mdx#createvariantpricinglinkstep","depth":5},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":6},{"type":"hook","name":"productVariantsCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productVariantsCreated","depth":7}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreateProductVariantsWorkflowInput","type":"[CreateProductVariantsWorkflowInput](../../../../types/core_flows.CreateProductVariantsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_variants","type":"[CreateProductVariantDTO](../../../../../product/interfaces/product.CreateProductVariantDTO/page.mdx) & `object` & `object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The id of the product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The EAN of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The UPC of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The HS Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The origin country of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The MID Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The material of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The weight of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The length of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The height of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The width of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"The options of the variant. Each key is an option's title, and value\nis an option's value. If an option with the specified title doesn't exist,\na new one is created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreateMoneyAmountDTO](../../../../../pricing/interfaces/pricing.CreateMoneyAmountDTO/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"inventory_items","type":"`object`[]","description":"","optional":true,"defLine truncated
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"object[]","type":"`object`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"prices","type":"[MoneyAmountDTO](../../../../../pricing/interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberValue](../../../../../pricing/types/pricing.BigNumberValue/page.mdx)","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"[BigNumberValue](../../../../../pricing/types/pricing.BigNumberValue/page.mdx)","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"[BigNumberValue](../../../../../pricing/types/pricing.BigNumberValue/page.mdx)","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules_count","type":"`number`","description":"The number of rules that apply to this price","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_rules","type":"[PriceRuleDTO](../../../../../pricing/interfaces/pricing.PriceRuleDTO/page.mdx)[]","description":"The price rules that apply to this price","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"id","type":"`string`","description":"The ID of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The SKU of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The barcode of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The EAN of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The UPC of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the product variant's requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product variant.","optional":false,"defaultValue":"","expanLine truncated
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### productVariantsCreated
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { createProductVariantsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
createProductVariantsWorkflow.hooks.productVariantsCreated(
|
||||||
|
async (({ product_variants, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_variants","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"prices","type":"[MoneyAmountDTO](../../../../../pricing/interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The SKU of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The barcode of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The EAN of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The UPC of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the product variant's requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[ProductOptionValueDTO](../../../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product options.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`null` \\| `string`","description":"The associated product id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product variant was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product variant was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product variant was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)","description":"The associated product.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"variant_rank","type":"`null` \\| `number`","description":"he ranking of the variant among other variants associated with the product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":falsLine truncated
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/createProductsWorkflow
|
||||||
|
sidebar_label: createProductsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createProductsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `createProductsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow creates one or more products.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createProductsWorkflow","steps":[{"type":"step","name":"createProductsStep","description":"This step creates one or more products.","link":"../../../../core_flows.Steps_Product/page.mdx#createproductsstep","depth":1},{"type":"step","name":"associateProductsWithSalesChannelsStep","description":"This step creates links between products and sales channel records.","link":"../../../../core_flows.Steps_Sales_Channel/page.mdx#associateproductswithsaleschannelsstep","depth":2},{"type":"workflow","name":"createProductVariantsWorkflow","description":"This workflow creates one or more product variants.","link":"../../../../core_flows.Workflows_Product/page.mdx#createproductvariantsworkflow","depth":3},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":4},{"type":"hook","name":"productsCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productsCreated","depth":5}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreateProductsWorkflowInput","type":"[CreateProductsWorkflowInput](../../../../types/core_flows.CreateProductsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"products","type":"[CreateProductWorkflowInputDTO](../../../../../types/types/types.CreateProductWorkflowInputDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"sales_channels","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"variants","type":"[CreateProductVariantWorkflowInputDTO](../../../../../types/types/types.CreateProductVariantWorkflowInputDTO/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The id of the product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The EAN of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The UPC of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The HS Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The origin country of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The MID Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The material of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The weight of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The length of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The height of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The width of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"The options of the variant. Each key is an option's title, and value\nis an option's value. If an option with the specified title doesn't exist,\na new one is created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreateMoneyAmountDTO](../../../../../pricing/interfaces/pricing.CreateMoneyAmountDTO/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createProductsWorkflow"/>
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductDTO[]","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductDTO","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product collection was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product collection was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product collection was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`nullLine truncated
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### productsCreated
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { createProductsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
createProductsWorkflow.hooks.productsCreated(
|
||||||
|
async (({ products, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"products","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)","description":"The associated product type.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The associated product type id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"[ProductTagDTO](../../../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","description":"The associated product tags.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"variants","type":"[ProductVariantDTO](../../../../../product/interfaces/product.ProductVariantDTO/page.mdx)[]","description":"The associated product variants.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"options","type":"[ProductOptionDTO](../../../../../product/interfaces/product.ProductOptionDTO/page.mdx)[]","description":"The associated product options.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"images","type":"[ProductImageDTO](../../../../../product/interfaces/product.ProductImageDTO/page.mdx)[]","description":"The associated product images.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain\na reference to the ID in the integrated service.","optional":false,"defaultVLine truncated
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/deleteCollectionsWorkflow
|
||||||
|
sidebar_label: deleteCollectionsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# deleteCollectionsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `deleteCollectionsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow deletes one or more collection.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"deleteCollectionsWorkflow","steps":[{"type":"step","name":"deleteCollectionsStep","description":"This step deletes one or more collections.","link":"../../../../core_flows.Steps_Product/page.mdx#deletecollectionsstep","depth":1},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":2},{"type":"hook","name":"collectionsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#collectionsDeleted","depth":3}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"DeleteCollectionsWorkflowInput","type":"[DeleteCollectionsWorkflowInput](../../../../types/core_flows.DeleteCollectionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteCollectionsWorkflow"/>
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### collectionsDeleted
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { deleteCollectionsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
deleteCollectionsWorkflow.hooks.collectionsDeleted(
|
||||||
|
async (({ ids }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="collectionsDeleted"/>
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/deleteProductOptionsWorkflow
|
||||||
|
sidebar_label: deleteProductOptionsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# deleteProductOptionsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `deleteProductOptionsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow deletes one or more product options.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"deleteProductOptionsWorkflow","steps":[{"type":"step","name":"deleteProductOptionsStep","description":"This step deletes one or more product options.","link":"../../../../core_flows.Steps_Product/page.mdx#deleteproductoptionsstep","depth":1},{"type":"hook","name":"productOptionsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productOptionsDeleted","depth":2}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"DeleteProductOptionsWorkflowInput","type":"[DeleteProductOptionsWorkflowInput](../../../../types/core_flows.DeleteProductOptionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteProductOptionsWorkflow"/>
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### productOptionsDeleted
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { deleteProductOptionsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
deleteProductOptionsWorkflow.hooks.productOptionsDeleted(
|
||||||
|
async (({ ids }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productOptionsDeleted"/>
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/deleteProductTagsWorkflow
|
||||||
|
sidebar_label: deleteProductTagsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# deleteProductTagsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `deleteProductTagsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow deletes one or more product tags.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"deleteProductTagsWorkflow","steps":[{"type":"step","name":"deleteProductTagsStep","description":"This step deletes one or more product tags.","link":"../../../../core_flows.Steps_Product/page.mdx#deleteproducttagsstep","depth":1},{"type":"hook","name":"productTagsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTagsDeleted","depth":2}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"DeleteProductTagsWorkflowInput","type":"[DeleteProductTagsWorkflowInput](../../../../types/core_flows.DeleteProductTagsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteProductTagsWorkflow"/>
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### productTagsDeleted
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { deleteProductTagsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
deleteProductTagsWorkflow.hooks.productTagsDeleted(
|
||||||
|
async (({ ids }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTagsDeleted"/>
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/deleteProductTypesWorkflow
|
||||||
|
sidebar_label: deleteProductTypesWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# deleteProductTypesWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `deleteProductTypesWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow deletes one or more product types.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"deleteProductTypesWorkflow","steps":[{"type":"step","name":"deleteProductTypesStep","description":"This step deletes one or more product types.","link":"../../../../core_flows.Steps_Product/page.mdx#deleteproducttypesstep","depth":1},{"type":"hook","name":"productTypesDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTypesDeleted","depth":2}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"DeleteProductTypesWorkflowInput","type":"[DeleteProductTypesWorkflowInput](../../../../types/core_flows.DeleteProductTypesWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteProductTypesWorkflow"/>
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### productTypesDeleted
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { deleteProductTypesWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
deleteProductTypesWorkflow.hooks.productTypesDeleted(
|
||||||
|
async (({ ids }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTypesDeleted"/>
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/deleteProductVariantsWorkflow
|
||||||
|
sidebar_label: deleteProductVariantsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# deleteProductVariantsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `deleteProductVariantsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow deletes one or more product variants.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"deleteProductVariantsWorkflow","steps":[{"type":"step","name":"removeRemoteLinkStep","description":"This step deletes linked records of a record.\n\nLearn more in the [Remote Link documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#cascade-delete-linked-records)\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#removeremotelinkstep","depth":1},{"type":"step","name":"deleteProductVariantsStep","description":"This step deletes one or more product variants.","link":"../../../../core_flows.Steps_Product/page.mdx#deleteproductvariantsstep","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":3},{"type":"hook","name":"productVariantsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productVariantsDeleted","depth":4}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"DeleteProductVariantsWorkflowInput","type":"[DeleteProductVariantsWorkflowInput](../../../../types/core_flows.DeleteProductVariantsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteProductVariantsWorkflow"/>
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### productVariantsDeleted
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { deleteProductVariantsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
deleteProductVariantsWorkflow.hooks.productVariantsDeleted(
|
||||||
|
async (({ ids }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productVariantsDeleted"/>
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/deleteProductsWorkflow
|
||||||
|
sidebar_label: deleteProductsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# deleteProductsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `deleteProductsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow deletes one or more products.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"deleteProductsWorkflow","steps":[{"type":"step","name":"getProductsStep","description":"This step retrieves products.","link":"../../../../core_flows.Steps_Product/page.mdx#getproductsstep","depth":1},{"type":"step","name":"removeRemoteLinkStep","description":"This step deletes linked records of a record.\n\nLearn more in the [Remote Link documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#cascade-delete-linked-records)\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#removeremotelinkstep","depth":2},{"type":"step","name":"deleteProductsStep","description":"This step deletes one or more products.","link":"../../../../core_flows.Steps_Product/page.mdx#deleteproductsstep","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":3},{"type":"hook","name":"productsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productsDeleted","depth":4}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"DeleteProductsWorkflowInput","type":"[DeleteProductsWorkflowInput](../../../../types/core_flows.DeleteProductsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteProductsWorkflow"/>
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### productsDeleted
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { deleteProductsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
deleteProductsWorkflow.hooks.productsDeleted(
|
||||||
|
async (({ ids }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productsDeleted"/>
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/exportProductsWorkflow
|
||||||
|
sidebar_label: exportProductsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# exportProductsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `exportProductsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow exports products matching the specified filters.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"exportProductsWorkflow","steps":[{"type":"step","name":"getAllProductsStep","description":"This step retrieves all products.","link":"../../../../core_flows.Steps_Product/page.mdx#getallproductsstep","depth":1},{"type":"step","name":"generateProductCsvStep","description":"This step generates a CSV file to be exported.","link":"../../../../core_flows.Steps_Product/page.mdx#generateproductcsvstep","depth":2},{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":3}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ExportProductsDTO","type":"`ExportProductsDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="exportProductsWorkflow"/>
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/importProductsWorkflow
|
||||||
|
sidebar_label: importProductsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# importProductsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `importProductsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow imports products from a CSV file.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"importProductsWorkflow","steps":[{"type":"step","name":"parseProductCsvStep","description":"This step parses a CSV file holding products to import.","link":"../../../../core_flows.Steps_Product/page.mdx#parseproductcsvstep","depth":1},{"type":"step","name":"groupProductsForBatchStep","description":"This step groups products to be created and updated.","link":"../../../../core_flows.Steps_Product/page.mdx#groupproductsforbatchstep","depth":2},{"type":"step","name":"waitConfirmationProductImportStep","description":"This step waits until a product import is confirmed.","link":"../../../../core_flows.Steps_Product/page.mdx#waitconfirmationproductimportstep","depth":3}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ImportProductsDTO","type":"`ImportProductsDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="importProductsWorkflow"/>
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ImportProductsSummary","type":"`ImportProductsSummary`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="importProductsWorkflow"/>
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/updateCollectionsWorkflow
|
||||||
|
sidebar_label: updateCollectionsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateCollectionsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `updateCollectionsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow updates collections matching the specified filters.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateCollectionsWorkflow","steps":[{"type":"step","name":"updateCollectionsStep","description":"This step updates collections matching the specified filters.","link":"../../../../core_flows.Steps_Product/page.mdx#updatecollectionsstep","depth":1},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":2},{"type":"hook","name":"collectionsUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#collectionsUpdated","depth":3}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateCollectionsWorkflowInput","type":"[UpdateCollectionsWorkflowInput](../../../../types/core_flows.UpdateCollectionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"selector","type":"[FilterableProductCollectionProps](../../../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductCollectionProps](../../../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductCollectionProps](../../../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductCollectionProps](../../../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductCollectionProps](../../../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductCollectionProps](../../../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductCollectionProps](../../../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the collections' titles.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product collections by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string` \\| `string`[]","description":"The handles to filter product collections by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"The title to filter product collections by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableProductCollectionProps](../../../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductCollectionProps](../../../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductCollectionProps](../../../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductCollectionProps](../../../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductCollectionProps](../../../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductCollectionProps](../../../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx)>)[]","description":"An array of filters tLine truncated
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductCollectionDTO[]","type":"[ProductCollectionDTO](../../../../../product/interfaces/product.ProductCollectionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductCollectionDTO","type":"[ProductCollectionDTO](../../../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product collection's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product collection was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product collection was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product collection was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValLine truncated
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### collectionsUpdated
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { updateCollectionsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
updateCollectionsWorkflow.hooks.collectionsUpdated(
|
||||||
|
async (({ additional_data, collections }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collections","type":"[ProductCollectionDTO](../../../../../product/interfaces/product.ProductCollectionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product collection was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product collection was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product collection was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="collectionsUpdated"/>
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/updateProductOptionsWorkflow
|
||||||
|
sidebar_label: updateProductOptionsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateProductOptionsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `updateProductOptionsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow updates product options matching the specified filters.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateProductOptionsWorkflow","steps":[{"type":"step","name":"updateProductOptionsStep","description":"This step updates product options matching the specified filters.","link":"../../../../core_flows.Steps_Product/page.mdx#updateproductoptionsstep","depth":1},{"type":"hook","name":"productOptionsUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productOptionsUpdated","depth":2}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateProductOptionsWorkflowInput","type":"[UpdateProductOptionsWorkflowInput](../../../../types/core_flows.UpdateProductOptionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"selector","type":"[FilterableProductOptionProps](../../../../../product/interfaces/product.FilterableProductOptionProps/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductOptionProps](../../../../../product/interfaces/product.FilterableProductOptionProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductOptionProps](../../../../../product/interfaces/product.FilterableProductOptionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductOptionProps](../../../../../product/interfaces/product.FilterableProductOptionProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductOptionProps](../../../../../product/interfaces/product.FilterableProductOptionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductOptionProps](../../../../../product/interfaces/product.FilterableProductOptionProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductOptionProps](../../../../../product/interfaces/product.FilterableProductOptionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the options' titles.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product options by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"The titles to filter product options by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string` \\| `string`[]","description":"Filter the product options by their associated products' IDs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableProductOptionProps](../../../../../product/interfaces/product.FilterableProductOptionProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductOptionProps](../../../../../product/interfaces/product.FilterableProductOptionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductOptionProps](../../../../../product/interfaces/product.FilterableProductOptionProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductOptionProps](../../../../../product/interfaces/product.FilterableProductOptionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductOptionProps](../../../../../product/interfaces/product.FilterableProductOptionProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductOptionProps](../../../../../product/interfaces/product.FilterableProductOptionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" conditionLine truncated
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductOptionDTO[]","type":"[ProductOptionDTO](../../../../../product/interfaces/product.ProductOptionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductOptionDTO","type":"[ProductOptionDTO](../../../../../product/interfaces/product.ProductOptionDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product option's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[ProductOptionValueDTO](../../../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product option values.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option value was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option value was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option","type":"`null` \\| [ProductOptionDTO](../../../../../product/interfaces/product.ProductOptionDTO/page.mdx)","description":"The associated product option. It may only be available if the `option` relation is expanded.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"option_id","type":"`null` \\| `string`","description":"The associated product option id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product option value was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)","description":"The associated product.","optional":true,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The hLine truncated
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### productOptionsUpdated
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { updateProductOptionsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
updateProductOptionsWorkflow.hooks.productOptionsUpdated(
|
||||||
|
async (({ product_options, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_options","type":"[ProductOptionDTO](../../../../../product/interfaces/product.ProductOptionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[ProductOptionValueDTO](../../../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product option values.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)","description":"The associated product.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"product_id","type":"`null` \\| `string`","description":"The associated product id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product option was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productOptionsUpdated"/>
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/updateProductTagsWorkflow
|
||||||
|
sidebar_label: updateProductTagsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateProductTagsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `updateProductTagsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow updates product tags matching the specified filters.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateProductTagsWorkflow","steps":[{"type":"step","name":"updateProductTagsStep","description":"This step updates product tags matching the specified filters.","link":"../../../../core_flows.Steps_Product/page.mdx#updateproducttagsstep","depth":1},{"type":"hook","name":"productTagsUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTagsUpdated","depth":2}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateProductTagsWorkflowInput","type":"[UpdateProductTagsWorkflowInput](../../../../types/core_flows.UpdateProductTagsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"selector","type":"[FilterableProductTypeProps](../../../../../product/interfaces/product.FilterableProductTypeProps/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductTypeProps](../../../../../product/interfaces/product.FilterableProductTypeProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductTypeProps](../../../../../product/interfaces/product.FilterableProductTypeProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductTypeProps](../../../../../product/interfaces/product.FilterableProductTypeProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductTypeProps](../../../../../product/interfaces/product.FilterableProductTypeProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductTypeProps](../../../../../product/interfaces/product.FilterableProductTypeProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductTypeProps](../../../../../product/interfaces/product.FilterableProductTypeProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the types' values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product types by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value to filter product types by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableProductTypeProps](../../../../../product/interfaces/product.FilterableProductTypeProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductTypeProps](../../../../../product/interfaces/product.FilterableProductTypeProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductTypeProps](../../../../../product/interfaces/product.FilterableProductTypeProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductTypeProps](../../../../../product/interfaces/product.FilterableProductTypeProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductTypeProps](../../../../../product/interfaces/product.FilterableProductTypeProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductTypeProps](../../../../../product/interfaces/product.FilterableProductTypeProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the types' values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"TheLine truncated
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductTagDTO[]","type":"[ProductTagDTO](../../../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductTagDTO","type":"[ProductTagDTO](../../../../../product/interfaces/product.ProductTagDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product tag's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)","description":"The associated product type.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The associated product type id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"[ProductTagDTO](../../../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","description":"The associated product tags.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"variants","type":"[ProductVariantDTO](../../../../../product/interfaces/product.ProductVariantDTO/page.mdx)[]","description":"The Line truncated
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### productTagsUpdated
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { updateProductTagsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
updateProductTagsWorkflow.hooks.productTagsUpdated(
|
||||||
|
async (({ product_tags, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_tags","type":"[ProductTagDTO](../../../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTagsUpdated"/>
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/updateProductTypesWorkflow
|
||||||
|
sidebar_label: updateProductTypesWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateProductTypesWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `updateProductTypesWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow updates product types matching the specified filters.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateProductTypesWorkflow","steps":[{"type":"step","name":"updateProductTypesStep","description":"This step updates product types matching the specified filters.","link":"../../../../core_flows.Steps_Product/page.mdx#updateproducttypesstep","depth":1},{"type":"hook","name":"productTypesUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTypesUpdated","depth":2}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateProductTypesWorkflowInput","type":"`UpdateProductTypesWorkflowInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateProductTypesWorkflow"/>
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductTypeDTO[]","type":"[ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductTypeDTO","type":"[ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product type's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateProductTypesWorkflow"/>
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### productTypesUpdated
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { updateProductTypesWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
updateProductTypesWorkflow.hooks.productTypesUpdated(
|
||||||
|
async (({ product_types, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_types","type":"[ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTypesUpdated"/>
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/updateProductVariantsWorkflow
|
||||||
|
sidebar_label: updateProductVariantsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateProductVariantsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `updateProductVariantsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow updates one or more product variants.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateProductVariantsWorkflow","steps":[{"type":"step","name":"updateProductVariantsStep","description":"This step updates one or more product variants.","link":"../../../../core_flows.Steps_Product/page.mdx#updateproductvariantsstep","depth":1},{"type":"step","name":"updatePriceSetsStep","description":"This step updates price sets.","link":"../../../../core_flows.Steps_Pricing/page.mdx#updatepricesetsstep","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":3},{"type":"hook","name":"productVariantsUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productVariantsUpdated","depth":4}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateProductVariantsWorkflowInput & AdditionalData","type":"[UpdateProductVariantsWorkflowInput](../../../../types/core_flows.UpdateProductVariantsWorkflowInput/page.mdx) & [AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"UpdateProductVariantsWorkflowInput","type":"[UpdateProductVariantsWorkflowInput](../../../../types/core_flows.UpdateProductVariantsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"selector","type":"[FilterableProductVariantProps](../../../../../product/interfaces/product.FilterableProductVariantProps/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductVariantProps](../../../../../product/interfaces/product.FilterableProductVariantProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductVariantProps](../../../../../product/interfaces/product.FilterableProductVariantProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductVariantProps](../../../../../product/interfaces/product.FilterableProductVariantProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductVariantProps](../../../../../product/interfaces/product.FilterableProductVariantProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the title and different code attributes on the variant","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product variants by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string` \\| `string`[]","description":"The SKUs to filter product variants by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string` \\| `string`[]","description":"Filter the product variants by their associated products' IDs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"Filter product variants by their associated options.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update","type":"[UpdateProductVariantDTO](../../../../../product/interfaces/product.UpdateProductVariantDTO/page.mdx) & `object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The SKU of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The barcode of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The EAN of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The UPC of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null`Line truncated
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"object[]","type":"`object`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"price_set","type":"`undefined` \\| [PriceSetDTO](../../../../../pricing/interfaces/pricing.PriceSetDTO/page.mdx)","description":"","optional":false,"defaultValue":"priceSetForVariant","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../../../../pricing/interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"calculated_price","type":"[CalculatedPriceSet](../../../../../pricing/interfaces/pricing.CalculatedPriceSet/page.mdx)","description":"The calculated price based on the context.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"id","type":"`string`","description":"The ID of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The SKU of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The barcode of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The EAN of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The UPC of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the product variant's requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[ProductOptionValueDTO](../../../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product options.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option value was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option value was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option","type":"`null` \\| [ProductOptionDTO](../../../../../product/interfaces/product.ProductOptionDTO/page.mdx)","description":"The associated product option. It may only be available if the `optLine truncated
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### productVariantsUpdated
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { updateProductVariantsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
updateProductVariantsWorkflow.hooks.productVariantsUpdated(
|
||||||
|
async (({ product_variants, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_variants","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"price_set","type":"`undefined` \\| [PriceSetDTO](../../../../../pricing/interfaces/pricing.PriceSetDTO/page.mdx)","description":"","optional":false,"defaultValue":"priceSetForVariant","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The SKU of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The barcode of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The EAN of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The UPC of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the product variant's requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[ProductOptionValueDTO](../../../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product options.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`null` \\| `string`","description":"The associated product id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product variant was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product variant was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product variant was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)","description":"The associated product.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"variant_rank","type":"`null` \\| `number`","description":"he ranking of the variant among other variants associated with the product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","deLine truncated
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/updateProductsWorkflow
|
||||||
|
sidebar_label: updateProductsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateProductsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `updateProductsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow updates one or more products.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateProductsWorkflow","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"type":"step","name":"updateProductsStep","description":"This step updates one or more products.","link":"../../../../core_flows.Steps_Product/page.mdx#updateproductsstep","depth":2},{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":3},{"type":"workflow","name":"upsertVariantPricesWorkflow","description":"This workflow creates or updates variants' prices.","link":"../../../../core_flows.Workflows_Product/page.mdx#upsertvariantpricesworkflow","depth":4},{"type":"step","name":"dismissRemoteLinkStep","description":"This step removes remote links between two records of linked data models.\n\nLearn more in the [Remote Link documentation.](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#dismiss-link).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#dismissremotelinkstep","depth":5},{"type":"step","name":"createRemoteLinkStep","description":"This step creates remote links between two records of linked data models.\n\nLearn more in the [Remote Link documentation.](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#create-link).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#createremotelinkstep","depth":6},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":7},{"type":"hook","name":"productsUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productsUpdated","depth":8}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateProductWorkflowInput","type":"[UpdateProductWorkflowInput](../../../../types/core_flows.UpdateProductWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"selector","type":"[FilterableProductProps](../../../../../product/interfaces/product.FilterableProductProps/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductProps](../../../../../product/interfaces/product.FilterableProductProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductProps](../../../../../product/interfaces/product.FilterableProductProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductProps](../../../../../product/interfaces/product.FilterableProductProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductProps](../../../../../product/interfaces/product.FilterableProductProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductProps](../../../../../product/interfaces/product.FilterableProductProps/page.mdx) \\| [BaseFilterable](../../../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductProps](../../../../../product/interfaces/product.FilterableProductProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the products' attributes, such as titles and descriptions, using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../product/types/product.ProductStatus/page.mdx) \\| [ProductStatus](../../../../../product/types/product.ProductStatus/page.mdx)[]","description":"The status to filter products by","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"The titles to filter products by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string` \\| `string`[]","description":"The handles to filter products by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter products by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Filters only or excluding gift card products","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`object`","description":"Filters on a product's tags.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variants","type":"`object`","description":"Filters on a product's variant properties.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string` \\| `string`[]","description":"Filter a product by the ID of the associated type","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`object` \\| `object`","description":"Filter a product by the IDs of their associated categories.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../../../product/types/product.OperatorMap/page.mdx)<string>","description":"Filters a product by its associated collections.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../product/types/product.OperatorMap/page.mdx)<string>","description":"Filters a product based on when it was created","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../../../product/types/product.OperatorMap/page.mdx)<string>","description":"Filters a product based on when it was updated","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"[OperatorMap](../../../../../product/types/product.OperatorMap/page.mdx)<string>","description":"Filters soft-deleted products based on the date they were deleted at.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../product/iLine truncated
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductDTO[]","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductDTO","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product collection was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product collection was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product collection was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`nullLine truncated
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### productsUpdated
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { updateProductsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
updateProductsWorkflow.hooks.productsUpdated(
|
||||||
|
async (({ products, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"products","type":"[ProductDTO](../../../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)","description":"The associated product type.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The associated product type id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"[ProductTagDTO](../../../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","description":"The associated product tags.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"variants","type":"[ProductVariantDTO](../../../../../product/interfaces/product.ProductVariantDTO/page.mdx)[]","description":"The associated product variants.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"options","type":"[ProductOptionDTO](../../../../../product/interfaces/product.ProductOptionDTO/page.mdx)[]","description":"The associated product options.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"images","type":"[ProductImageDTO](../../../../../product/interfaces/product.ProductImageDTO/page.mdx)[]","description":"The associated product images.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain\na reference to the ID in the integrated service.","optional":false,"defaultVLine truncated
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/upsertVariantPricesWorkflow
|
||||||
|
sidebar_label: upsertVariantPricesWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# upsertVariantPricesWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `upsertVariantPricesWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow creates or updates variants' prices.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"upsertVariantPricesWorkflow","steps":[{"type":"step","name":"removeRemoteLinkStep","description":"This step deletes linked records of a record.\n\nLearn more in the [Remote Link documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#cascade-delete-linked-records)\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#removeremotelinkstep","depth":1},{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":2},{"type":"step","name":"updatePriceSetsStep","description":"This step updates price sets.","link":"../../../../core_flows.Steps_Pricing/page.mdx#updatepricesetsstep","depth":3},{"type":"step","name":"createPriceSetsStep","description":"This step creates one or more price sets.","link":"../../../../core_flows.Steps_Pricing/page.mdx#createpricesetsstep","depth":4},{"type":"step","name":"createVariantPricingLinkStep","description":"This step creates links between variant and price set records.","link":"../../../../core_flows.Steps_Product/page.mdx#createvariantpricinglinkstep","depth":5}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpsertVariantPricesWorkflowInput","type":"[UpsertVariantPricesWorkflowInput](../../../../types/core_flows.UpsertVariantPricesWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"variantPrices","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variant_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"([CreatePricesDTO](../../../../../pricing/interfaces/pricing.CreatePricesDTO/page.mdx) \\| `UpdatePricesDTO`)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../../../pricing/interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are the attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"previousVariantIds","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="upsertVariantPricesWorkflow"/>
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# batchLinkProductsToCategoryWorkflowId
|
||||||
|
|
||||||
|
`Const` **batchLinkProductsToCategoryWorkflowId**: `"batch-link-products-to-category"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# batchLinkProductsToCollectionWorkflowId
|
||||||
|
|
||||||
|
`Const` **batchLinkProductsToCollectionWorkflowId**: `"batch-link-products-to-collection"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# batchProductVariantsWorkflowId
|
||||||
|
|
||||||
|
`Const` **batchProductVariantsWorkflowId**: `"batch-product-variants"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# batchProductsWorkflowId
|
||||||
|
|
||||||
|
`Const` **batchProductsWorkflowId**: `"batch-products"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createCollectionsWorkflowId
|
||||||
|
|
||||||
|
`Const` **createCollectionsWorkflowId**: `"create-collections"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createProductOptionsWorkflowId
|
||||||
|
|
||||||
|
`Const` **createProductOptionsWorkflowId**: `"create-product-options"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createProductTagsWorkflowId
|
||||||
|
|
||||||
|
`Const` **createProductTagsWorkflowId**: `"create-product-tags"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createProductTypesWorkflowId
|
||||||
|
|
||||||
|
`Const` **createProductTypesWorkflowId**: `"create-product-types"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createProductVariantsWorkflowId
|
||||||
|
|
||||||
|
`Const` **createProductVariantsWorkflowId**: `"create-product-variants"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createProductsWorkflowId
|
||||||
|
|
||||||
|
`Const` **createProductsWorkflowId**: `"create-products"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# deleteCollectionsWorkflowId
|
||||||
|
|
||||||
|
`Const` **deleteCollectionsWorkflowId**: `"delete-collections"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# deleteProductOptionsWorkflowId
|
||||||
|
|
||||||
|
`Const` **deleteProductOptionsWorkflowId**: `"delete-product-options"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# deleteProductTagsWorkflowId
|
||||||
|
|
||||||
|
`Const` **deleteProductTagsWorkflowId**: `"delete-product-tags"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# deleteProductTypesWorkflowId
|
||||||
|
|
||||||
|
`Const` **deleteProductTypesWorkflowId**: `"delete-product-types"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# deleteProductVariantsWorkflowId
|
||||||
|
|
||||||
|
`Const` **deleteProductVariantsWorkflowId**: `"delete-product-variants"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# deleteProductsWorkflowId
|
||||||
|
|
||||||
|
`Const` **deleteProductsWorkflowId**: `"delete-products"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# exportProductsWorkflowId
|
||||||
|
|
||||||
|
`Const` **exportProductsWorkflowId**: `"export-products"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# importProductsWorkflowId
|
||||||
|
|
||||||
|
`Const` **importProductsWorkflowId**: `"import-products"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateCollectionsWorkflowId
|
||||||
|
|
||||||
|
`Const` **updateCollectionsWorkflowId**: `"update-collections"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateProductOptionsWorkflowId
|
||||||
|
|
||||||
|
`Const` **updateProductOptionsWorkflowId**: `"update-product-options"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateProductTagsWorkflowId
|
||||||
|
|
||||||
|
`Const` **updateProductTagsWorkflowId**: `"update-product-tags"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateProductTypesWorkflowId
|
||||||
|
|
||||||
|
`Const` **updateProductTypesWorkflowId**: `"update-product-types"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateProductVariantsWorkflowId
|
||||||
|
|
||||||
|
`Const` **updateProductVariantsWorkflowId**: `"update-product-variants"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateProductsWorkflowId
|
||||||
|
|
||||||
|
`Const` **updateProductsWorkflowId**: `"update-products"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# upsertVariantPricesWorkflowId
|
||||||
|
|
||||||
|
`Const` **upsertVariantPricesWorkflowId**: `"upsert-variant-prices"`
|
||||||
+803
@@ -0,0 +1,803 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# Workflows\_Product
|
||||||
|
|
||||||
|
## batchLinkProductsToCollectionWorkflow
|
||||||
|
|
||||||
|
This workflow creates links between product and collection records.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"batchLinkProductsToCollectionWorkflow","steps":[{"type":"step","name":"batchLinkProductsToCollectionStep","description":"This step creates links between product and collection records.","link":"../../core_flows.Steps_Product/page.mdx#batchlinkproductstocollectionstep","depth":1}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"LinkWorkflowInput","type":"[LinkWorkflowInput](../../../types/CommonTypes/types/types.CommonTypes.LinkWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"add","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remove","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="batchLinkProductsToCollectionWorkflow"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## batchProductVariantsWorkflow
|
||||||
|
|
||||||
|
This workflow creates, updates, and deletes product variants.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"batchProductVariantsWorkflow","steps":[{"type":"workflow","name":"createProductVariantsWorkflow","description":"This workflow creates one or more product variants.","link":"../../core_flows.Workflows_Product/page.mdx#createproductvariantsworkflow","depth":1},{"type":"workflow","name":"updateProductVariantsWorkflow","description":"This workflow updates one or more product variants.","link":"../../core_flows.Workflows_Product/page.mdx#updateproductvariantsworkflow","depth":1},{"type":"workflow","name":"deleteProductVariantsWorkflow","description":"This workflow deletes one or more product variants.","link":"../../core_flows.Workflows_Product/page.mdx#deleteproductvariantsworkflow","depth":1}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"BatchWorkflowInput","type":"[BatchWorkflowInput](../../../types/CommonTypes/types/types.CommonTypes.BatchWorkflowInput/page.mdx)<[CreateProductVariantWorkflowInputDTO](../../../types/types/types.CreateProductVariantWorkflowInputDTO/page.mdx), [UpdateProductVariantWorkflowInputDTO](../../../types/types/types.UpdateProductVariantWorkflowInputDTO/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CreateProductVariantWorkflowInputDTO","type":"[CreateProductVariantWorkflowInputDTO](../../../types/types/types.CreateProductVariantWorkflowInputDTO/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The id of the product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The EAN of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The UPC of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The HS Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The origin country of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The MID Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The material of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The weight of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The length of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The height of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The width of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"The options of the variant. Each key is an option's title, and value\nis an option's value. If an option with the specified title doesn't exist,\na new one is created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreateMoneyAmountDTO](../../../pricing/interfaces/pricing.CreateMoneyAmountDTO/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for Line truncated
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"BatchWorkflowOutput","type":"[BatchWorkflowOutput](../../../types/CommonTypes/types/types.CommonTypes.BatchWorkflowOutput/page.mdx)<[ProductVariantDTO](../../../product/interfaces/product.ProductVariantDTO/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductVariantDTO","type":"[ProductVariantDTO](../../../product/interfaces/product.ProductVariantDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product variant's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The SKU of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The barcode of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The EAN of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The UPC of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the product variant's requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[ProductOptionValueDTO](../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product options.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option value was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option value was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option","type":"`null` \\| [ProductOptionDTO](../../../product/interfaces/product.ProductOptionDTO/page.mdx)","description":"The associated product option. It may only be available if the `option` relation is expanded.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"option_id","type":"`null` \\| `string`","description":"The associated product option id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":""Line truncated
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## batchLinkProductsToCategoryWorkflow
|
||||||
|
|
||||||
|
This workflow creates links between product and category records.
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"BatchUpdateProductsOnCategoryWorkflowInput","type":"[BatchUpdateProductsOnCategoryWorkflowInput](../../../types/WorkflowTypes/ProductCategoryWorkflow/interfaces/types.WorkflowTypes.ProductCategoryWorkflow.BatchUpdateProductsOnCategoryWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"add","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remove","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="batchLinkProductsToCategoryWorkflow"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## batchProductsWorkflow
|
||||||
|
|
||||||
|
This workflow creates, updates, or deletes products.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"batchProductsWorkflow","steps":[{"type":"workflow","name":"createProductsWorkflow","description":"This workflow creates one or more products.","link":"../../core_flows.Workflows_Product/page.mdx#createproductsworkflow","depth":1},{"type":"workflow","name":"updateProductsWorkflow","description":"This workflow updates one or more products.","link":"../../core_flows.Workflows_Product/page.mdx#updateproductsworkflow","depth":1},{"type":"workflow","name":"deleteProductsWorkflow","description":"This workflow deletes one or more products.","link":"../../core_flows.Workflows_Product/page.mdx#deleteproductsworkflow","depth":1}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"BatchWorkflowInput","type":"[BatchWorkflowInput](../../../types/CommonTypes/types/types.CommonTypes.BatchWorkflowInput/page.mdx)<[CreateProductWorkflowInputDTO](../../../types/types/types.CreateProductWorkflowInputDTO/page.mdx), [UpdateProductWorkflowInputDTO](../../../types/types/types.UpdateProductWorkflowInputDTO/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CreateProductWorkflowInputDTO","type":"[CreateProductWorkflowInputDTO](../../../types/types/types.CreateProductWorkflowInputDTO/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"sales_channels","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"variants","type":"[CreateProductVariantWorkflowInputDTO](../../../types/types/types.CreateProductVariantWorkflowInputDTO/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The id of the product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The EAN of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The UPC of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The HS Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The origin country of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The MID Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The material of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The weight of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The length of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The height of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The width of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"The options of the variant. Each key is an option's title, and value\nis an option's value. If an option with the specified title doesn't exist,\na new one is created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreateMoneyAmountDTO](../../../pricing/interfaces/pricing.CreateMoneyAmountDTO/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"UpdateProductWorkflowInputDTO","type":"[UpdateProductWorkflowInputDTO](../../../types/types/types.UpdateProductWorkflowInputDTO/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product to update. If not provided, a product\nis created instead. In that case, the `title` property is required.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":Line truncated
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"BatchWorkflowOutput","type":"[BatchWorkflowOutput](../../../types/CommonTypes/types/types.CommonTypes.BatchWorkflowOutput/page.mdx)<[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductDTO","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product collection was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product collection was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product collection was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":falseLine truncated
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## createCollectionsWorkflow
|
||||||
|
|
||||||
|
This workflow creates one or more collections.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createCollectionsWorkflow","steps":[{"type":"step","name":"createCollectionsStep","description":"This step creates one or more collection.","link":"../../core_flows.Steps_Product/page.mdx#createcollectionsstep","depth":1},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":2},{"type":"hook","name":"collectionsCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#collectionsCreated","depth":3}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreateCollectionsWorkflowInput","type":"[CreateCollectionsWorkflowInput](../../types/core_flows.CreateCollectionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"collections","type":"[CreateProductCollectionDTO](../../../product/interfaces/product.CreateProductCollectionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The product collection's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product collection's handle. If not provided, the value of this attribute is set to the slug version of the title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_ids","type":"`string`[]","description":"The products to associate with the collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createCollectionsWorkflow"/>
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductCollectionDTO[]","type":"[ProductCollectionDTO](../../../product/interfaces/product.ProductCollectionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductCollectionDTO","type":"[ProductCollectionDTO](../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product collection's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product collection was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product collection was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product collection was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValue":"","expandable":false,"children"Line truncated
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### collectionsCreated
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { createCollectionsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
createCollectionsWorkflow.hooks.collectionsCreated(
|
||||||
|
async (({ collections, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"collections","type":"[ProductCollectionDTO](../../../product/interfaces/product.ProductCollectionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product collection was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product collection was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product collection was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="collectionsCreated"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## createProductOptionsWorkflow
|
||||||
|
|
||||||
|
This workflow creates one or more product options.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createProductOptionsWorkflow","steps":[{"type":"step","name":"createProductOptionsStep","description":"This step creates one or more product options.","link":"../../core_flows.Steps_Product/page.mdx#createproductoptionsstep","depth":1},{"type":"hook","name":"productOptionsCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productOptionsCreated","depth":2}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreateProductOptionsWorkflowInput","type":"[CreateProductOptionsWorkflowInput](../../types/core_flows.CreateProductOptionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_options","type":"[CreateProductOptionDTO](../../../product/interfaces/product.CreateProductOptionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The product option's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The product option values.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createProductOptionsWorkflow"/>
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductOptionDTO[]","type":"[ProductOptionDTO](../../../product/interfaces/product.ProductOptionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductOptionDTO","type":"[ProductOptionDTO](../../../product/interfaces/product.ProductOptionDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product option's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[ProductOptionValueDTO](../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product option values.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option value was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option value was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option","type":"`null` \\| [ProductOptionDTO](../../../product/interfaces/product.ProductOptionDTO/page.mdx)","description":"The associated product option. It may only be available if the `option` relation is expanded.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"option_id","type":"`null` \\| `string`","description":"The associated product option id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product option value was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)","description":"The associated product.","optional":true,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"dLine truncated
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### productOptionsCreated
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { createProductOptionsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
createProductOptionsWorkflow.hooks.productOptionsCreated(
|
||||||
|
async (({ product_options, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_options","type":"[ProductOptionDTO](../../../product/interfaces/product.ProductOptionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[ProductOptionValueDTO](../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product option values.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)","description":"The associated product.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"product_id","type":"`null` \\| `string`","description":"The associated product id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product option was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productOptionsCreated"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## createProductTagsWorkflow
|
||||||
|
|
||||||
|
This workflow creates one or more product tags.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createProductTagsWorkflow","steps":[{"type":"step","name":"createProductTagsStep","description":"This step creates one or more product tags.","link":"../../core_flows.Steps_Product/page.mdx#createproducttagsstep","depth":1},{"type":"hook","name":"productTagsCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTagsCreated","depth":2}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreateProductTagsWorkflowInput","type":"[CreateProductTagsWorkflowInput](../../types/core_flows.CreateProductTagsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_tags","type":"[CreateProductTagDTO](../../../product/interfaces/product.CreateProductTagDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The value of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createProductTagsWorkflow"/>
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductTagDTO[]","type":"[ProductTagDTO](../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductTagDTO","type":"[ProductTagDTO](../../../product/interfaces/product.ProductTagDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product tag's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [ProductTypeDTO](../../../product/interfaces/product.ProductTypeDTO/page.mdx)","description":"The associated product type.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The associated product type id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"[ProductTagDTO](../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","description":"The associated product tags.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"variants","type":"[ProductVariantDTO](../../../product/interfaces/product.ProductVariantDTO/page.mdx)[]","description":"The associated product variants.","optional":false,"defaulLine truncated
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### productTagsCreated
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { createProductTagsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
createProductTagsWorkflow.hooks.productTagsCreated(
|
||||||
|
async (({ product_tags, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_tags","type":"[ProductTagDTO](../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTagsCreated"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## createProductTypesWorkflow
|
||||||
|
|
||||||
|
This workflow creates one or more product types.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createProductTypesWorkflow","steps":[{"type":"step","name":"createProductTypesStep","description":"This step creates one or more product types.","link":"../../core_flows.Steps_Product/page.mdx#createproducttypesstep","depth":1},{"type":"hook","name":"productTypesCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTypesCreated","depth":2}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreateProductTypesWorkflowInput","type":"[CreateProductTypesWorkflowInput](../../types/core_flows.CreateProductTypesWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_types","type":"[CreateProductTypeDTO](../../../product/interfaces/product.CreateProductTypeDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The product type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createProductTypesWorkflow"/>
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductTypeDTO[]","type":"[ProductTypeDTO](../../../product/interfaces/product.ProductTypeDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductTypeDTO","type":"[ProductTypeDTO](../../../product/interfaces/product.ProductTypeDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product type's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createProductTypesWorkflow"/>
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### productTypesCreated
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { createProductTypesWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
createProductTypesWorkflow.hooks.productTypesCreated(
|
||||||
|
async (({ product_types, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_types","type":"[ProductTypeDTO](../../../product/interfaces/product.ProductTypeDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTypesCreated"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## createProductVariantsWorkflow
|
||||||
|
|
||||||
|
This workflow creates one or more product variants.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createProductVariantsWorkflow","steps":[{"type":"step","name":"createProductVariantsStep","description":"This step creates one or more product variants.","link":"../../core_flows.Steps_Product/page.mdx#createproductvariantsstep","depth":1},{"type":"workflow","name":"createInventoryItemsWorkflow","description":"This workflow creates one or more inventory items.","link":"../../core_flows.Workflows_Inventory/page.mdx#createinventoryitemsworkflow","depth":2},{"type":"workflow","name":"createLinksWorkflow","description":"This workflow creates one or more links between records.","link":"../../core_flows.Workflows_Common/page.mdx#createlinksworkflow","depth":3},{"type":"step","name":"createPriceSetsStep","description":"This step creates one or more price sets.","link":"../../core_flows.Steps_Pricing/page.mdx#createpricesetsstep","depth":4},{"type":"step","name":"createVariantPricingLinkStep","description":"This step creates links between variant and price set records.","link":"../../core_flows.Steps_Product/page.mdx#createvariantpricinglinkstep","depth":5},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":6},{"type":"hook","name":"productVariantsCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productVariantsCreated","depth":7}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreateProductVariantsWorkflowInput","type":"[CreateProductVariantsWorkflowInput](../../types/core_flows.CreateProductVariantsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_variants","type":"[CreateProductVariantDTO](../../../product/interfaces/product.CreateProductVariantDTO/page.mdx) & `object` & `object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The id of the product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The EAN of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The UPC of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The HS Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The origin country of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The MID Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The material of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The weight of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The length of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The height of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The width of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"The options of the variant. Each key is an option's title, and value\nis an option's value. If an option with the specified title doesn't exist,\na new one is created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreateMoneyAmountDTO](../../../pricing/interfaces/pricing.CreateMoneyAmountDTO/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"inventory_items","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"childrenLine truncated
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"object[]","type":"`object`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"prices","type":"[MoneyAmountDTO](../../../pricing/interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"When the money\\_amount was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"When the money\\_amount was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"When the money\\_amount was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberValue](../../../pricing/types/pricing.BigNumberValue/page.mdx)","description":"The price of this money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"[BigNumberValue](../../../pricing/types/pricing.BigNumberValue/page.mdx)","description":"The minimum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"[BigNumberValue](../../../pricing/types/pricing.BigNumberValue/page.mdx)","description":"The maximum quantity required to be purchased for this price to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules_count","type":"`number`","description":"The number of rules that apply to this price","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_rules","type":"[PriceRuleDTO](../../../pricing/interfaces/pricing.PriceRuleDTO/page.mdx)[]","description":"The price rules that apply to this price","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"id","type":"`string`","description":"The ID of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The SKU of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The barcode of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The EAN of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The UPC of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the product variant's requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"Line truncated
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### productVariantsCreated
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { createProductVariantsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
createProductVariantsWorkflow.hooks.productVariantsCreated(
|
||||||
|
async (({ product_variants, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_variants","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"prices","type":"[MoneyAmountDTO](../../../pricing/interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The SKU of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The barcode of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The EAN of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The UPC of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the product variant's requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[ProductOptionValueDTO](../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product options.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`null` \\| `string`","description":"The associated product id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product variant was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product variant was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product variant was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)","description":"The associated product.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"variant_rank","type":"`null` \\| `number`","description":"he ranking of the variant among other variants associated with the product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"Line truncated
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## createProductsWorkflow
|
||||||
|
|
||||||
|
This workflow creates one or more products.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createProductsWorkflow","steps":[{"type":"step","name":"createProductsStep","description":"This step creates one or more products.","link":"../../core_flows.Steps_Product/page.mdx#createproductsstep","depth":1},{"type":"step","name":"associateProductsWithSalesChannelsStep","description":"This step creates links between products and sales channel records.","link":"../../core_flows.Steps_Sales_Channel/page.mdx#associateproductswithsaleschannelsstep","depth":2},{"type":"workflow","name":"createProductVariantsWorkflow","description":"This workflow creates one or more product variants.","link":"../../core_flows.Workflows_Product/page.mdx#createproductvariantsworkflow","depth":3},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":4},{"type":"hook","name":"productsCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productsCreated","depth":5}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreateProductsWorkflowInput","type":"[CreateProductsWorkflowInput](../../types/core_flows.CreateProductsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"products","type":"[CreateProductWorkflowInputDTO](../../../types/types/types.CreateProductWorkflowInputDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"sales_channels","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"variants","type":"[CreateProductVariantWorkflowInputDTO](../../../types/types/types.CreateProductVariantWorkflowInputDTO/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The id of the product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The EAN of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The UPC of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The HS Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The origin country of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The MID Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The material of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The weight of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The length of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The height of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The width of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"The options of the variant. Each key is an option's title, and value\nis an option's value. If an option with the specified title doesn't exist,\na new one is created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[CreateMoneyAmountDTO](../../../pricing/interfaces/pricing.CreateMoneyAmountDTO/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createProductsWorkflow"/>
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductDTO[]","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductDTO","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product collection was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product collection was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product collection was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [ProductTypeDTO](../../../prodLine truncated
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### productsCreated
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { createProductsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
createProductsWorkflow.hooks.productsCreated(
|
||||||
|
async (({ products, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"products","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [ProductTypeDTO](../../../product/interfaces/product.ProductTypeDTO/page.mdx)","description":"The associated product type.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The associated product type id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"[ProductTagDTO](../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","description":"The associated product tags.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"variants","type":"[ProductVariantDTO](../../../product/interfaces/product.ProductVariantDTO/page.mdx)[]","description":"The associated product variants.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"options","type":"[ProductOptionDTO](../../../product/interfaces/product.ProductOptionDTO/page.mdx)[]","description":"The associated product options.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"images","type":"[ProductImageDTO](../../../product/interfaces/product.ProductImageDTO/page.mdx)[]","description":"The associated product images.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain\na reference to the ID in the integrated service.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"namLine truncated
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## deleteCollectionsWorkflow
|
||||||
|
|
||||||
|
This workflow deletes one or more collection.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"deleteCollectionsWorkflow","steps":[{"type":"step","name":"deleteCollectionsStep","description":"This step deletes one or more collections.","link":"../../core_flows.Steps_Product/page.mdx#deletecollectionsstep","depth":1},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":2},{"type":"hook","name":"collectionsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#collectionsDeleted","depth":3}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"DeleteCollectionsWorkflowInput","type":"[DeleteCollectionsWorkflowInput](../../types/core_flows.DeleteCollectionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteCollectionsWorkflow"/>
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### collectionsDeleted
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { deleteCollectionsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
deleteCollectionsWorkflow.hooks.collectionsDeleted(
|
||||||
|
async (({ ids }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="collectionsDeleted"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## deleteProductOptionsWorkflow
|
||||||
|
|
||||||
|
This workflow deletes one or more product options.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"deleteProductOptionsWorkflow","steps":[{"type":"step","name":"deleteProductOptionsStep","description":"This step deletes one or more product options.","link":"../../core_flows.Steps_Product/page.mdx#deleteproductoptionsstep","depth":1},{"type":"hook","name":"productOptionsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productOptionsDeleted","depth":2}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"DeleteProductOptionsWorkflowInput","type":"[DeleteProductOptionsWorkflowInput](../../types/core_flows.DeleteProductOptionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteProductOptionsWorkflow"/>
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### productOptionsDeleted
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { deleteProductOptionsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
deleteProductOptionsWorkflow.hooks.productOptionsDeleted(
|
||||||
|
async (({ ids }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productOptionsDeleted"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## deleteProductTagsWorkflow
|
||||||
|
|
||||||
|
This workflow deletes one or more product tags.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"deleteProductTagsWorkflow","steps":[{"type":"step","name":"deleteProductTagsStep","description":"This step deletes one or more product tags.","link":"../../core_flows.Steps_Product/page.mdx#deleteproducttagsstep","depth":1},{"type":"hook","name":"productTagsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTagsDeleted","depth":2}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"DeleteProductTagsWorkflowInput","type":"[DeleteProductTagsWorkflowInput](../../types/core_flows.DeleteProductTagsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteProductTagsWorkflow"/>
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### productTagsDeleted
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { deleteProductTagsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
deleteProductTagsWorkflow.hooks.productTagsDeleted(
|
||||||
|
async (({ ids }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTagsDeleted"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## deleteProductTypesWorkflow
|
||||||
|
|
||||||
|
This workflow deletes one or more product types.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"deleteProductTypesWorkflow","steps":[{"type":"step","name":"deleteProductTypesStep","description":"This step deletes one or more product types.","link":"../../core_flows.Steps_Product/page.mdx#deleteproducttypesstep","depth":1},{"type":"hook","name":"productTypesDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTypesDeleted","depth":2}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"DeleteProductTypesWorkflowInput","type":"[DeleteProductTypesWorkflowInput](../../types/core_flows.DeleteProductTypesWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteProductTypesWorkflow"/>
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### productTypesDeleted
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { deleteProductTypesWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
deleteProductTypesWorkflow.hooks.productTypesDeleted(
|
||||||
|
async (({ ids }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTypesDeleted"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## deleteProductVariantsWorkflow
|
||||||
|
|
||||||
|
This workflow deletes one or more product variants.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"deleteProductVariantsWorkflow","steps":[{"type":"step","name":"removeRemoteLinkStep","description":"This step deletes linked records of a record.\n\nLearn more in the [Remote Link documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#cascade-delete-linked-records)\n\n","link":"../../core_flows.Steps_Common/page.mdx#removeremotelinkstep","depth":1},{"type":"step","name":"deleteProductVariantsStep","description":"This step deletes one or more product variants.","link":"../../core_flows.Steps_Product/page.mdx#deleteproductvariantsstep","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":3},{"type":"hook","name":"productVariantsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productVariantsDeleted","depth":4}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"DeleteProductVariantsWorkflowInput","type":"[DeleteProductVariantsWorkflowInput](../../types/core_flows.DeleteProductVariantsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteProductVariantsWorkflow"/>
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### productVariantsDeleted
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { deleteProductVariantsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
deleteProductVariantsWorkflow.hooks.productVariantsDeleted(
|
||||||
|
async (({ ids }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productVariantsDeleted"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## deleteProductsWorkflow
|
||||||
|
|
||||||
|
This workflow deletes one or more products.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"deleteProductsWorkflow","steps":[{"type":"step","name":"getProductsStep","description":"This step retrieves products.","link":"../../core_flows.Steps_Product/page.mdx#getproductsstep","depth":1},{"type":"step","name":"removeRemoteLinkStep","description":"This step deletes linked records of a record.\n\nLearn more in the [Remote Link documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#cascade-delete-linked-records)\n\n","link":"../../core_flows.Steps_Common/page.mdx#removeremotelinkstep","depth":2},{"type":"step","name":"deleteProductsStep","description":"This step deletes one or more products.","link":"../../core_flows.Steps_Product/page.mdx#deleteproductsstep","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":3},{"type":"hook","name":"productsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productsDeleted","depth":4}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"DeleteProductsWorkflowInput","type":"[DeleteProductsWorkflowInput](../../types/core_flows.DeleteProductsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteProductsWorkflow"/>
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### productsDeleted
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { deleteProductsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
deleteProductsWorkflow.hooks.productsDeleted(
|
||||||
|
async (({ ids }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productsDeleted"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## exportProductsWorkflow
|
||||||
|
|
||||||
|
This workflow exports products matching the specified filters.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"exportProductsWorkflow","steps":[{"type":"step","name":"getAllProductsStep","description":"This step retrieves all products.","link":"../../core_flows.Steps_Product/page.mdx#getallproductsstep","depth":1},{"type":"step","name":"generateProductCsvStep","description":"This step generates a CSV file to be exported.","link":"../../core_flows.Steps_Product/page.mdx#generateproductcsvstep","depth":2},{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":3}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ExportProductsDTO","type":"`ExportProductsDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="exportProductsWorkflow"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## importProductsWorkflow
|
||||||
|
|
||||||
|
This workflow imports products from a CSV file.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"importProductsWorkflow","steps":[{"type":"step","name":"parseProductCsvStep","description":"This step parses a CSV file holding products to import.","link":"../../core_flows.Steps_Product/page.mdx#parseproductcsvstep","depth":1},{"type":"step","name":"groupProductsForBatchStep","description":"This step groups products to be created and updated.","link":"../../core_flows.Steps_Product/page.mdx#groupproductsforbatchstep","depth":2},{"type":"step","name":"waitConfirmationProductImportStep","description":"This step waits until a product import is confirmed.","link":"../../core_flows.Steps_Product/page.mdx#waitconfirmationproductimportstep","depth":3}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ImportProductsDTO","type":"`ImportProductsDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="importProductsWorkflow"/>
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ImportProductsSummary","type":"`ImportProductsSummary`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="importProductsWorkflow"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## updateCollectionsWorkflow
|
||||||
|
|
||||||
|
This workflow updates collections matching the specified filters.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateCollectionsWorkflow","steps":[{"type":"step","name":"updateCollectionsStep","description":"This step updates collections matching the specified filters.","link":"../../core_flows.Steps_Product/page.mdx#updatecollectionsstep","depth":1},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":2},{"type":"hook","name":"collectionsUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#collectionsUpdated","depth":3}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateCollectionsWorkflowInput","type":"[UpdateCollectionsWorkflowInput](../../types/core_flows.UpdateCollectionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"selector","type":"[FilterableProductCollectionProps](../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductCollectionProps](../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductCollectionProps](../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductCollectionProps](../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductCollectionProps](../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductCollectionProps](../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductCollectionProps](../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the collections' titles.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product collections by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string` \\| `string`[]","description":"The handles to filter product collections by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"The title to filter product collections by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableProductCollectionProps](../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductCollectionProps](../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductCollectionProps](../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductCollectionProps](../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductCollectionProps](../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductCollectionProps](../../../product/interfaces/product.FilterableProductCollectionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandabLine truncated
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductCollectionDTO[]","type":"[ProductCollectionDTO](../../../product/interfaces/product.ProductCollectionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductCollectionDTO","type":"[ProductCollectionDTO](../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product collection's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product collection was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product collection was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product collection was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValue":"","expandable":false,"children"Line truncated
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### collectionsUpdated
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { updateCollectionsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
updateCollectionsWorkflow.hooks.collectionsUpdated(
|
||||||
|
async (({ additional_data, collections }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collections","type":"[ProductCollectionDTO](../../../product/interfaces/product.ProductCollectionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product collection was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product collection was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product collection was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="collectionsUpdated"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## updateProductOptionsWorkflow
|
||||||
|
|
||||||
|
This workflow updates product options matching the specified filters.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateProductOptionsWorkflow","steps":[{"type":"step","name":"updateProductOptionsStep","description":"This step updates product options matching the specified filters.","link":"../../core_flows.Steps_Product/page.mdx#updateproductoptionsstep","depth":1},{"type":"hook","name":"productOptionsUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productOptionsUpdated","depth":2}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateProductOptionsWorkflowInput","type":"[UpdateProductOptionsWorkflowInput](../../types/core_flows.UpdateProductOptionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"selector","type":"[FilterableProductOptionProps](../../../product/interfaces/product.FilterableProductOptionProps/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductOptionProps](../../../product/interfaces/product.FilterableProductOptionProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductOptionProps](../../../product/interfaces/product.FilterableProductOptionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductOptionProps](../../../product/interfaces/product.FilterableProductOptionProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductOptionProps](../../../product/interfaces/product.FilterableProductOptionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductOptionProps](../../../product/interfaces/product.FilterableProductOptionProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductOptionProps](../../../product/interfaces/product.FilterableProductOptionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the options' titles.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product options by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"The titles to filter product options by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string` \\| `string`[]","description":"Filter the product options by their associated products' IDs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableProductOptionProps](../../../product/interfaces/product.FilterableProductOptionProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductOptionProps](../../../product/interfaces/product.FilterableProductOptionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductOptionProps](../../../product/interfaces/product.FilterableProductOptionProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductOptionProps](../../../product/interfaces/product.FilterableProductOptionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductOptionProps](../../../product/interfaces/product.FilterableProductOptionProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductOptionProps](../../../product/interfaces/product.FilterableProductOptionProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through tLine truncated
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductOptionDTO[]","type":"[ProductOptionDTO](../../../product/interfaces/product.ProductOptionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductOptionDTO","type":"[ProductOptionDTO](../../../product/interfaces/product.ProductOptionDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product option's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[ProductOptionValueDTO](../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product option values.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option value was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option value was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option","type":"`null` \\| [ProductOptionDTO](../../../product/interfaces/product.ProductOptionDTO/page.mdx)","description":"The associated product option. It may only be available if the `option` relation is expanded.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"option_id","type":"`null` \\| `string`","description":"The associated product option id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product option value was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)","description":"The associated product.","optional":true,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"dLine truncated
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### productOptionsUpdated
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { updateProductOptionsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
updateProductOptionsWorkflow.hooks.productOptionsUpdated(
|
||||||
|
async (({ product_options, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_options","type":"[ProductOptionDTO](../../../product/interfaces/product.ProductOptionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[ProductOptionValueDTO](../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product option values.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)","description":"The associated product.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"product_id","type":"`null` \\| `string`","description":"The associated product id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product option was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productOptionsUpdated"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## updateProductTagsWorkflow
|
||||||
|
|
||||||
|
This workflow updates product tags matching the specified filters.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateProductTagsWorkflow","steps":[{"type":"step","name":"updateProductTagsStep","description":"This step updates product tags matching the specified filters.","link":"../../core_flows.Steps_Product/page.mdx#updateproducttagsstep","depth":1},{"type":"hook","name":"productTagsUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTagsUpdated","depth":2}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateProductTagsWorkflowInput","type":"[UpdateProductTagsWorkflowInput](../../types/core_flows.UpdateProductTagsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"selector","type":"[FilterableProductTypeProps](../../../product/interfaces/product.FilterableProductTypeProps/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductTypeProps](../../../product/interfaces/product.FilterableProductTypeProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductTypeProps](../../../product/interfaces/product.FilterableProductTypeProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductTypeProps](../../../product/interfaces/product.FilterableProductTypeProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductTypeProps](../../../product/interfaces/product.FilterableProductTypeProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductTypeProps](../../../product/interfaces/product.FilterableProductTypeProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductTypeProps](../../../product/interfaces/product.FilterableProductTypeProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the types' values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product types by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value to filter product types by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableProductTypeProps](../../../product/interfaces/product.FilterableProductTypeProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductTypeProps](../../../product/interfaces/product.FilterableProductTypeProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductTypeProps](../../../product/interfaces/product.FilterableProductTypeProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductTypeProps](../../../product/interfaces/product.FilterableProductTypeProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductTypeProps](../../../product/interfaces/product.FilterableProductTypeProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductTypeProps](../../../product/interfaces/product.FilterableProductTypeProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the types' values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product types by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`strinLine truncated
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductTagDTO[]","type":"[ProductTagDTO](../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductTagDTO","type":"[ProductTagDTO](../../../product/interfaces/product.ProductTagDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product tag's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [ProductTypeDTO](../../../product/interfaces/product.ProductTypeDTO/page.mdx)","description":"The associated product type.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The associated product type id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"[ProductTagDTO](../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","description":"The associated product tags.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"variants","type":"[ProductVariantDTO](../../../product/interfaces/product.ProductVariantDTO/page.mdx)[]","description":"The associated product variants.","optional":false,"defaulLine truncated
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### productTagsUpdated
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { updateProductTagsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
updateProductTagsWorkflow.hooks.productTagsUpdated(
|
||||||
|
async (({ product_tags, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_tags","type":"[ProductTagDTO](../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTagsUpdated"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## updateProductTypesWorkflow
|
||||||
|
|
||||||
|
This workflow updates product types matching the specified filters.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateProductTypesWorkflow","steps":[{"type":"step","name":"updateProductTypesStep","description":"This step updates product types matching the specified filters.","link":"../../core_flows.Steps_Product/page.mdx#updateproducttypesstep","depth":1},{"type":"hook","name":"productTypesUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTypesUpdated","depth":2}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateProductTypesWorkflowInput","type":"`UpdateProductTypesWorkflowInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateProductTypesWorkflow"/>
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductTypeDTO[]","type":"[ProductTypeDTO](../../../product/interfaces/product.ProductTypeDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductTypeDTO","type":"[ProductTypeDTO](../../../product/interfaces/product.ProductTypeDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product type's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateProductTypesWorkflow"/>
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### productTypesUpdated
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { updateProductTypesWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
updateProductTypesWorkflow.hooks.productTypesUpdated(
|
||||||
|
async (({ product_types, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_types","type":"[ProductTypeDTO](../../../product/interfaces/product.ProductTypeDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTypesUpdated"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## updateProductVariantsWorkflow
|
||||||
|
|
||||||
|
This workflow updates one or more product variants.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateProductVariantsWorkflow","steps":[{"type":"step","name":"updateProductVariantsStep","description":"This step updates one or more product variants.","link":"../../core_flows.Steps_Product/page.mdx#updateproductvariantsstep","depth":1},{"type":"step","name":"updatePriceSetsStep","description":"This step updates price sets.","link":"../../core_flows.Steps_Pricing/page.mdx#updatepricesetsstep","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":3},{"type":"hook","name":"productVariantsUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productVariantsUpdated","depth":4}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateProductVariantsWorkflowInput & AdditionalData","type":"[UpdateProductVariantsWorkflowInput](../../types/core_flows.UpdateProductVariantsWorkflowInput/page.mdx) & [AdditionalData](../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"UpdateProductVariantsWorkflowInput","type":"[UpdateProductVariantsWorkflowInput](../../types/core_flows.UpdateProductVariantsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"selector","type":"[FilterableProductVariantProps](../../../product/interfaces/product.FilterableProductVariantProps/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductVariantProps](../../../product/interfaces/product.FilterableProductVariantProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductVariantProps](../../../product/interfaces/product.FilterableProductVariantProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductVariantProps](../../../product/interfaces/product.FilterableProductVariantProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductVariantProps](../../../product/interfaces/product.FilterableProductVariantProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the title and different code attributes on the variant","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product variants by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string` \\| `string`[]","description":"The SKUs to filter product variants by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string` \\| `string`[]","description":"Filter the product variants by their associated products' IDs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"Filter product variants by their associated options.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update","type":"[UpdateProductVariantDTO](../../../product/interfaces/product.UpdateProductVariantDTO/page.mdx) & `object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The SKU of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The barcode of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The EAN of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The UPC of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product variant.",Line truncated
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"object[]","type":"`object`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"price_set","type":"`undefined` \\| [PriceSetDTO](../../../pricing/interfaces/pricing.PriceSetDTO/page.mdx)","description":"","optional":false,"defaultValue":"priceSetForVariant","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the price set.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[MoneyAmountDTO](../../../pricing/interfaces/pricing.MoneyAmountDTO/page.mdx)[]","description":"The prices that belong to this price set.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"calculated_price","type":"[CalculatedPriceSet](../../../pricing/interfaces/pricing.CalculatedPriceSet/page.mdx)","description":"The calculated price based on the context.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"id","type":"`string`","description":"The ID of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The SKU of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The barcode of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The EAN of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The UPC of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the product variant's requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[ProductOptionValueDTO](../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product options.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option value was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option value was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option","type":"`null` \\| [ProductOptionDTO](../../../product/interfaces/product.ProductOptionDTO/page.mdx)","description":"The associated product option. It may only be available if the `option` relation is expanded.","oLine truncated
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### productVariantsUpdated
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { updateProductVariantsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
updateProductVariantsWorkflow.hooks.productVariantsUpdated(
|
||||||
|
async (({ product_variants, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_variants","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"price_set","type":"`undefined` \\| [PriceSetDTO](../../../pricing/interfaces/pricing.PriceSetDTO/page.mdx)","description":"","optional":false,"defaultValue":"priceSetForVariant","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The SKU of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The barcode of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The EAN of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The UPC of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the product variant's requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[ProductOptionValueDTO](../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product options.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`null` \\| `string`","description":"The associated product id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product variant was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product variant was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product variant was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)","description":"The associated product.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"variant_rank","type":"`null` \\| `number`","description":"he ranking of the variant among other variants associated with the product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optLine truncated
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## updateProductsWorkflow
|
||||||
|
|
||||||
|
This workflow updates one or more products.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateProductsWorkflow","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"type":"step","name":"updateProductsStep","description":"This step updates one or more products.","link":"../../core_flows.Steps_Product/page.mdx#updateproductsstep","depth":2},{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":3},{"type":"workflow","name":"upsertVariantPricesWorkflow","description":"This workflow creates or updates variants' prices.","link":"../../core_flows.Workflows_Product/page.mdx#upsertvariantpricesworkflow","depth":4},{"type":"step","name":"dismissRemoteLinkStep","description":"This step removes remote links between two records of linked data models.\n\nLearn more in the [Remote Link documentation.](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#dismiss-link).\n\n","link":"../../core_flows.Steps_Common/page.mdx#dismissremotelinkstep","depth":5},{"type":"step","name":"createRemoteLinkStep","description":"This step creates remote links between two records of linked data models.\n\nLearn more in the [Remote Link documentation.](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#create-link).\n\n","link":"../../core_flows.Steps_Common/page.mdx#createremotelinkstep","depth":6},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":7},{"type":"hook","name":"productsUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productsUpdated","depth":8}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateProductWorkflowInput","type":"[UpdateProductWorkflowInput](../../types/core_flows.UpdateProductWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"selector","type":"[FilterableProductProps](../../../product/interfaces/product.FilterableProductProps/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductProps](../../../product/interfaces/product.FilterableProductProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductProps](../../../product/interfaces/product.FilterableProductProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductProps](../../../product/interfaces/product.FilterableProductProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductProps](../../../product/interfaces/product.FilterableProductProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductProps](../../../product/interfaces/product.FilterableProductProps/page.mdx) \\| [BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<[FilterableProductProps](../../../product/interfaces/product.FilterableProductProps/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the products' attributes, such as titles and descriptions, using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../product/types/product.ProductStatus/page.mdx) \\| [ProductStatus](../../../product/types/product.ProductStatus/page.mdx)[]","description":"The status to filter products by","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"The titles to filter products by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string` \\| `string`[]","description":"The handles to filter products by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter products by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Filters only or excluding gift card products","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`object`","description":"Filters on a product's tags.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variants","type":"`object`","description":"Filters on a product's variant properties.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string` \\| `string`[]","description":"Filter a product by the ID of the associated type","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`object` \\| `object`","description":"Filter a product by the IDs of their associated categories.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../product/types/product.OperatorMap/page.mdx)<string>","description":"Filters a product by its associated collections.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../product/types/product.OperatorMap/page.mdx)<string>","description":"Filters a product based on when it was created","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../product/types/product.OperatorMap/page.mdx)<string>","description":"Filters a product based on when it was updated","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"[OperatorMap](../../../product/types/product.OperatorMap/page.mdx)<string>","description":"Filters soft-deleted products based on the date they were deleted at.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../product/interfaces/product.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply Line truncated
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ProductDTO[]","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductDTO","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product collection was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product collection was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product collection was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"products","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"The associated products.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [ProductTypeDTO](../../../prodLine truncated
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### productsUpdated
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { updateProductsWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
updateProductsWorkflow.hooks.productsUpdated(
|
||||||
|
async (({ products, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"products","type":"[ProductDTO](../../../product/interfaces/product.ProductDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product. The handle can be used to create slug URL paths.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The subttle of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../product/types/product.ProductStatus/page.mdx)","description":"The status of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The URL of the product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection","type":"`null` \\| [ProductCollectionDTO](../../../product/interfaces/product.ProductCollectionDTO/page.mdx)","description":"The associated product collection.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The associated product collection id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [ProductTypeDTO](../../../product/interfaces/product.ProductTypeDTO/page.mdx)","description":"The associated product type.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The associated product type id.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"[ProductTagDTO](../../../product/interfaces/product.ProductTagDTO/page.mdx)[]","description":"The associated product tags.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"variants","type":"[ProductVariantDTO](../../../product/interfaces/product.ProductVariantDTO/page.mdx)[]","description":"The associated product variants.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"options","type":"[ProductOptionDTO](../../../product/interfaces/product.ProductOptionDTO/page.mdx)[]","description":"The associated product options.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"images","type":"[ProductImageDTO](../../../product/interfaces/product.ProductImageDTO/page.mdx)[]","description":"The associated product images.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain\na reference to the ID in the integrated service.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"namLine truncated
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## upsertVariantPricesWorkflow
|
||||||
|
|
||||||
|
This workflow creates or updates variants' prices.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"upsertVariantPricesWorkflow","steps":[{"type":"step","name":"removeRemoteLinkStep","description":"This step deletes linked records of a record.\n\nLearn more in the [Remote Link documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#cascade-delete-linked-records)\n\n","link":"../../core_flows.Steps_Common/page.mdx#removeremotelinkstep","depth":1},{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":2},{"type":"step","name":"updatePriceSetsStep","description":"This step updates price sets.","link":"../../core_flows.Steps_Pricing/page.mdx#updatepricesetsstep","depth":3},{"type":"step","name":"createPriceSetsStep","description":"This step creates one or more price sets.","link":"../../core_flows.Steps_Pricing/page.mdx#createpricesetsstep","depth":4},{"type":"step","name":"createVariantPricingLinkStep","description":"This step creates links between variant and price set records.","link":"../../core_flows.Steps_Product/page.mdx#createvariantpricinglinkstep","depth":5}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpsertVariantPricesWorkflowInput","type":"[UpsertVariantPricesWorkflowInput](../../types/core_flows.UpsertVariantPricesWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"variantPrices","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variant_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"([CreatePricesDTO](../../../pricing/interfaces/pricing.CreatePricesDTO/page.mdx) \\| `UpdatePricesDTO`)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../pricing/interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are the attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"previousVariantIds","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="upsertVariantPricesWorkflow"/>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# Product
|
||||||
|
|
||||||
|
## Namespaces
|
||||||
|
|
||||||
|
- [Steps\_Product](../core_flows.Steps_Product/page.mdx)
|
||||||
|
- [Workflows\_Product](../core_flows.Workflows_Product/page.mdx)
|
||||||
Reference in new issue
Block a user