batchProductsWorkflow - Medusa Core Workflows Reference
This documentation provides a reference to the batchProductsWorkflow
. It belongs to the @medusajs/medusa/core-flows
package.
This workflow creates, updates, or deletes products. It's used by the Manage Products Admin API Route.
You can use this workflow within your own customizations or custom workflows to manage products in bulk. This is also useful when writing a seed script or a custom import script.
Source CodeExamples#
Input#
BatchProductWorkflowInput
BatchProductWorkflowInputThe products to manage.
BatchProductWorkflowInput
BatchProductWorkflowInputRecords to create in bulk.
Records to update in bulk.
delete
string[]OptionalRecords to delete in bulk.
delete
string[]OptionalOutput#
BatchWorkflowOutput
BatchWorkflowOutput<ProductDTO>
BatchWorkflowOutput
BatchWorkflowOutput<ProductDTO>id
stringThe ID of the product.
id
stringtitle
stringThe title of the product.
title
stringhandle
stringThe handle of the product. The handle can be used to create slug URL paths.
handle
stringsubtitle
null | stringThe subttle of the product.
subtitle
null | stringdescription
null | stringThe description of the product.
description
null | stringis_giftcard
booleanWhether the product is a gift card.
is_giftcard
booleanstatus
ProductStatusThe status of the product.
status
ProductStatusthumbnail
null | stringThe URL of the product's thumbnail.
thumbnail
null | stringwidth
null | numberThe width of the product.
width
null | numberweight
null | numberThe weight of the product.
weight
null | numberlength
null | numberThe length of the product.
length
null | numberheight
null | numberThe height of the product.
height
null | numberorigin_country
null | stringThe origin country of the product.
origin_country
null | stringhs_code
null | stringThe HS Code of the product.
hs_code
null | stringmid_code
null | stringThe MID Code of the product.
mid_code
null | stringmaterial
null | stringThe material of the product.
material
null | stringThe associated product collection.
collection_id
null | stringThe associated product collection id.
collection_id
null | stringThe associated product type.
type_id
null | stringThe associated product type id.
type_id
null | stringThe associated product tags.
The associated product variants.
The associated product options.
The associated product images.
external_id
null | stringThe 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
a reference to the ID in the integrated service.
external_id
null | stringcreated_at
string | DateWhen the product was created.
created_at
string | Dateupdated_at
string | DateWhen the product was updated.
updated_at
string | Datedeleted_at
string | DateWhen the product was deleted.
deleted_at
string | DateThe associated product categories.
discountable
booleanOptionalWhether the product can be discounted.
discountable
booleanOptionalHolds custom data in key-value pairs.
Was this page helpful?