PHP code example of ayasoftware / magento2-mcp-api
1. Go to this page and download the library: Download ayasoftware/magento2-mcp-api library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ayasoftware / magento2-mcp-api example snippets
bash
composer nto module:enable Ayasoftware_McpApi
php bin/magento setup:upgrade
php bin/magento cache:flush
bash
curl -X PUT "https://your-store.com/rest/V1/mg_coupon/123" \
-H "Authorization: Bearer your-access-token" \
-H "Content-Type: application/json" \
-d '{
"couponData": {
"code": "SUMMER2026",
"usage_limit": 1000,
"usage_per_customer": 5,
"expiration_date": "2026-08-31"
}
}'