Files
medusa-store/packages/medusa-plugin-discount-generator
Oliver Windall Juhl afd1b67f1c chore: Clean up deps, devDeps, and peerDeps across all packages (#4276)
* chore: Use caret for all Medusa deps

* Create wild-balloons-push.md

* Address PR feedback

* force build order

* add missing dep

* add missing dev deps

* addresses last comments
2023-06-14 15:18:11 +02:00
..
2023-04-12 11:32:05 +02:00

Discount Generator

Generate dynamic discount codes in your Medusa backend.

Medusa Website | Medusa Repository

Features

  • Provides a service that can be used to generate a dynamic discount with a random code.
  • Provides an endpoint that can be used to generate a dynamic discount with a random code.

Prerequisites


How to Install

1. Run the following command in the directory of the Medusa backend:

npm install medusa-plugin-discount-generator

2. In medusa-config.js add the following at the end of the plugins array:

const plugins = [
  // ...
  `medusa-plugin-discount-generator`
]

Test the Plugin

Try using the DiscountGeneratorService in your code, or using the /discount-code endpoint to generate a random discount code.