mtrzk / module-promotions
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:magento2-module
Requires
- php: >=8.1
This package is auto-updated.
Last update: 2025-05-30 17:17:22 UTC
README
Overview
Mtrzk_Promotions is a Magento 2 module designed to manage promotions and promotion groups within the Magento platform. This module allows you to easily create, retrieve, update, and delete promotions and promotion groups through a REST API.
Installation
You can install the module using Composer. Run the following command in your Magento 2 root directory:
composer require mtrzk/module-promotions
After installation, enable the module and update the database schema by running:
bin/magento module:enable Mtrzk_Promotions bin/magento setup:upgrade
Testing
To run the unit tests for the module, use the following commands:
vendor/bin/phpunit -c dev/tests/unit/phpunit.xml app/code/Mtrzk/Promotions/Test/Unit/Model/PromotionGroupRepositoryTest.php vendor/bin/phpunit -c dev/tests/unit/phpunit.xml app/code/Mtrzk/Promotions/Test/Unit/Model/PromotionRepositoryTest.php
API Endpoints
The Mtrzk_Promotions module exposes several REST API endpoints for managing promotions and promotion groups:
Promotions API
-
GET /V1/promotions
- Retrieves a list of promotions.
- ACL:
Mtrzk_Promotions::promotions_view
-
GET /V1/promotions/:id
- Retrieves a specific promotion by ID.
- ACL:
Mtrzk_Promotions::promotions_view
-
POST /V1/promotions
- Creates or updates a promotion.
- ACL:
Mtrzk_Promotions::promotions_save
-
DELETE /V1/promotions/:id
- Deletes a specific promotion by ID.
- ACL:
Mtrzk_Promotions::promotions_delete
Promotion Groups API
-
GET /V1/promotion-groups
- Retrieves a list of promotion groups.
- ACL:
Mtrzk_Promotions::promotion_groups_view
-
GET /V1/promotion-groups/:id
- Retrieves a specific promotion group by ID.
- ACL:
Mtrzk_Promotions::promotion_groups_view
-
POST /V1/promotion-groups
- Creates or updates a promotion group.
- ACL:
Mtrzk_Promotions::promotion_groups_save
-
DELETE /V1/promotion-groups/:id
- Deletes a specific promotion group by ID.
- ACL:
Mtrzk_Promotions::promotion_groups_delete