getVariantAvailabilityStep - Medusa Core Workflows Reference

This documentation provides a reference to the getVariantAvailabilityStep. It belongs to the @medusajs/medusa/core-flows package.

This step computes the inventory availability for a list of variants in a given sales channel.

Example#

Code
1const data = getVariantAvailabilityStep({2  variant_ids: ["variant_123"],3  sales_channel_id: "sc_123"4})

Input#

GetVariantAvailabilityStepInputGetVariantAvailabilityStepInput
The details required to compute the inventory availability for a list of variants in a given sales channel.
variant_idsstring[]
The IDs of the variants to retrieve their availability.
sales_channel_idstring
The ID of the sales channel to retrieve the variant availability in.

Output#

VariantAvailabilityResultVariantAvailabilityResult
VariantAvailabilityResultobject
The computed inventory availability for variants in a given sales channel. The object's keys are the variant IDs.
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break