This script places an order via the Magento 2 REST API, allowing you to mock orders placed by Subscribe Pro.
Configuration must be done in the PHP file by updating the variables set in the index.php file. The following information is needed to configure the script:
- Magento 2 Base URL
- OAuth Consumer and Access keys
- Magento 2 Customer ID
- Product SKU, quantity, subscription ID and interval
- Shipping/Billing Address
- Shipping Carrier and Method
- Payment Profile ID
- Coupon Code (if applicable)
Install dependencies with composer:
composer install
Run the script from a network-enabled shell with PHP installed:
php index.php
If you need to log API requests and responses, set the $saveDebuggingLogs
variable to true
. Logs will be output in the following location: log/magento-api-{YYYY-MM-DD}.log