Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 946 Bytes

README.md

File metadata and controls

34 lines (23 loc) · 946 Bytes

Magento 2 API Ordering Script

This script places an order via the Magento 2 REST API, allowing you to mock orders placed by Subscribe Pro.

Configuration

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)

Usage

Install dependencies with composer:

composer install

Run the script from a network-enabled shell with PHP installed:

php index.php

Enabling Additional Debug Logging

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