deleteEntitiesStep - Helper Steps API Reference

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

This step deletes one or more entities using methods in a module's service.

Example#

Code
1deleteEntitiesStep({2  moduleRegistrationName: Modules.CART,3  invokeMethod: "softDeleteCreditLines",4  compensateMethod: "restoreCreditLines",5  data: input.id,6})

Input#

DeleteEntitiesStepTypeDeleteEntitiesStepType
moduleRegistrationNamestring
The regitration name of the module that contains the method to be invoked.
invokeMethodstring
The method to be invoked.
compensateMethodstring
The method to be invoked in case of compensation (when an error occurs).
dataany[]
The data to pass to the invoke method. For example, an array of IDs to delete.
entityIdentifierstringOptional
A string to pass to the compensate method. For example, an ID of the entity to be deleted.
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