Skip to content

Command line script for interacting with M2 REST API to mock Subscribe Pro

License

Notifications You must be signed in to change notification settings

subscribepro/m2-api-ordering-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Command line script for interacting with M2 REST API to mock Subscribe Pro

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages