> For the complete documentation index, see [llms.txt](https://docs.toomuchmedia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.toomuchmedia.com/api/api-endpoints/codes.md).

# codes

Handles the entire lifecycle of promotional, discount, and access codes. Endpoints allow administrators to generate single-use or multi-use coupons, set expiration dates, define discount amounts (percentage or flat rate), and restrict codes to specific programs or sites. It also provides endpoints for the checkout system to validate a code before applying it to a user's cart.
