Postman Collection to Place M2 API Calls


The Postman Collection M2 Order Placement contains a set of requests that can be run using the Postman Collection runner to test the ordering process with your Magento 2 store.

Using the collection requires the creation of a CSV file which contains the iteration data for the variables used in the requests along with variables for authorization that should be set as an environment variable. Details on using the postman collection running can be found here.

The collection can be used to mock Subscribe Pro for testing and debugging. The script follows the same steps and API calls that the Subscribe Pro ordering generation process uses to place orders. This can help diagnose and troubleshoot connection and order creation issues.

NOTE: This collection will not make any changes to data stored in Subscribe Pro, such as updating the Last or Next Order Dates, and will not trigger any emails from Subscribe Pro. However, if Magento 2 is configured to send an email to the customer upon a successful or failed order, the customer will still receive that email.

Steps

Run In Postman

  1. Using the Run in Postman button you can Fork/Import the collection and environment to your own Postman Workspace.
  2. The environment will have the following variables that should be set according to your store.
    • api_url
    • store_code
    • customer_id
    • m2_consumer_key
    • m2_consumer_secret
    • m2_access_key
    • m2_access_secret
    Postman Environment Variables
  3. Download and populate the CSV file with information relevant to your store.
  4. From the collection folder run the collection with the exception of the Deactivate Cart call
  5. Your order should be successful.

Downloads

Postman Collection M2 Order Placement

Postman Environment M2 Order Placement

Iteration Data CSV Example