Store Credit Module
In this section of the documentation, you will find resources to learn more about the Store Credit Module and how to use it in your application.
Note: The Store Credit Module is part of the Loyalty Plugin. It's compatible with Medusa v2.14.0+.
Looking for no-code docs? Refer to the Medusa Admin User Guide to learn how to manage store credit using the dashboard.
Medusa has store-credit related features available through the Store Credit Module. A module is a standalone package that provides features for a single domain. Each of Medusa's commerce features are placed in Commerce Modules, such as this Store Credit Module.
Note: Learn more about why modules are isolated in this documentation.
Features#
- Store Credit Accounts: Create and manage customer store credit accounts
- Credit Transactions: Credit and debit operations with full transaction history
- Balance Tracking: Real-time balance calculation and reporting
- Cart Integration: Apply store credits as payment during checkout
How to Use the Store Credit Module#
1. Enable the Plugin#
The plugin is part of the MedusaGo repository. Import its package in the main.go file of your project to register it with the framework:
// Importing the package registers the plugin with the framework.
_ "github.com/hitkey-io/medusago/packages/plugins/loyalty/src"
Then add it to the Plugins of your configuration in medusa-config.go:
2. Run Migrations#
Run the migrations to create the plugin's tables in the database: