createProductsWorkflow that creates the Product record,
attaches attributes and variants, records the submission for audit, and
optionally allowlists the submitting store. Run it from any place that has access
to the Medusa container.
Run the workflow
src/api/custom/route.ts
Passing
seller_ids allowlists those stores for the product as it’s created,
so the submitting store can immediately create an
offer against it. created_by records who
submitted the product for the audit trail.Default status
A product created without an explicitstatus follows the marketplace’s review
flow. Vendor-created products default to proposed, submitted for operator
review rather than published outright. Set status: "draft" to keep a product
private until it’s ready, or status: "published" from a trusted operator flow
to skip review. See the
status lifecycle.
Attach custom data
The workflow accepts anadditional_data payload passed to its hooks, letting
you persist marketplace-specific data alongside the product without forking the
workflow.