1 {"slug":"/references/helper-steps/createEntitiesStep","title":"createEntitiesStep - Helper Steps API Reference","frontmatter":{"slug":"/references/helper-steps/createEntitiesStep","sidebar_label":"createEntitiesStep"},"toc":[{"title":"Example","id":"example","level":2},{"title":"Input","id":"createentitiesstep-input","level":2},{"title":"Output","id":"createentitiesstep-output","level":2}],"blocks":[{"kind":"markdown","html":"This documentation provides a reference to the `createEntitiesStep` step. It belongs to the `@medusajs/medusa/core-flows` package."},{"kind":"heading","level":2,"text":"Example","id":"example"},{"kind":"markdown","html":"```ts\ncreateEntitiesStep({\n moduleRegistrationName: Modules.CART,\n invokeMethod: \"createCreditLines\",\n compensateMethod: \"deleteCreditLines\",\n data: {\n cart_id: \"cart_123\",\n amount: 10,\n reference: \"payment\",\n reference_id: \"payment_123\",\n metadata: {\n key: \"value\",\n },\n },\n})\n```"},{"kind":"heading","level":2,"text":"Input","id":"createentitiesstep-input"},{"kind":"typeList","sectionTitle":"createEntitiesStep","openedLevel":1,"types":[{"name":"CreateEntitiesStepType","type":"[CreateEntitiesStepType](/references/helper_steps/interfaces/helper_steps.CreateEntitiesStepType)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"moduleRegistrationName","type":"`string`","description":"The regitration name of the module that contains the method to be invoked.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"invokeMethod","type":"`string`","description":"The method to be invoked.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"compensateMethod","type":"`string`","description":"The method to be invoked in case of compensation (when an error occurs).","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entityIdentifier","type":"`string`","description":"A string to pass to the compensate method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`any`[]","description":"The data to pass to the invoke method.\nFor example, an array of objects to create.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"kind":"heading","level":2,"text":"Output","id":"createentitiesstep-output"},{"kind":"typeList","sectionTitle":"createEntitiesStep","openedLevel":1,"types":[{"name":"any[]","type":"`any`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"any","type":"`any`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]}]}