Service Factory Reference

This section of the documentation provides a reference of the methods generated for services extending the service factory (MedusaService), and how to use them.

TipLearn more about the service factory in this documentation.

Method Names#

Generated method names are of the format {operationName}_{dataModelName}, where:

  • {operationName} is the name of the operation. For example, create.
  • {dataModelName} is the pascal-case version of the data model's key that's passed in the object parameter of MedusaService. The name is pluralized for all operations except for the retrieve operation.

Some examples of method names:

  • createPosts
  • createMyPosts
  • retrievePost
  • listPosts

Methods Reference#

NoteThe reference uses only the operation name to refer to the method.
Was this page helpful?
Edit this page
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