How to Process Orders Using the Infoplus API

You can set up orders to automatically process and go through fulfillment either with a script within Infoplus or via an external API call.

You can use the Infoplus API, either from a system outside of Infoplus, or from a Script within Infoplus, to automate the processing of Orders, by running a Fulfillment Plan that you have previously set up in Infoplus.  The options that are specified on the Fulfillment Plan will be used, such as the option to Auto Ship Orders, allowing you to customize this workflow to your specific needs. 

To use this API call, you must use a version of the API greater than 2.0 (that is only beta as of the time of this writing, January 2018).  

A pre-requisite to using this API call is that you have created a Fulfillment Plan in Infoplus, with the appropriate settings for your use case.  See Create / Edit a Fulfillment Plan for help setting up a Fulfillment Plan.

Issuing the API Call to Run a Fulfillment Plan

To run this process through a raw API call, you must issue a POST request to the /infoplus-wms/api/beta/order/runFulfillmentPlan endpoint, passing it a JSON object with 3 fields:

  • orderNoList - a list of orderNos (this can be one or more orderNos)
    • NOTE: orderNoList is a required field when issuing the API call to run the fulfillment plan. Please ensure your orderNoList field is not empty. 
  • fulfillmentPlanId - the Id from the Fulfillment Plan table in Infoplus that you want to run against the orderNoList
  • shipDate - Formatted YYYY-MM-DD, the date that the orders will be shipped.  If you are unsure what to use here, use the current date.  

Here's an example of a curl command-line to run this process:

Response from the API call

Upon success, this API call will return a list JSON objects, one for each order specified in the orderNoList, structured as follows:

  • id - the orderNo that the object refers to
  • entity- an object containing the following relevant data fields for the order in question
    • orderNo - primary id for the order.
    • processNo - identifier for the Fulfillment Process that the order has been assigned to (assuming it was successful - if it was not, this key may not be present in the entity object).
    • customerOrderNo - value from order table - identifier for order from a system outside of infoplus. 
  • status - one of the strings: "OK", "Warning", or "Error"
  • messageList - a list of string messages either detailing the warning or error, or referencing the Fulfillment Process that the order has been assigned to.  

Here's an example for the call made above:

Verifying the status of the process and orders

Issuing the runFulfillmentPlan API call will create a Fulfillment Processes in Infoplus and assign orders to it.  This Fulfillment Process will then be executed by Infoplus asynchronously, and as it completes, the statuses of the orders in the process will be updated.  Note that more one process could be created, depending on the settings of the Fulfillment Plan. 

To monitor the status of a Fulfillment Process, you can fetch using a GET request to the fulfillmentProcess resource of the Infoplus API, using the process no. returned in the runFulfillmentPlan call.  While the fulfillment process is running, its status field will initially be null, but then will start with the word "Running".  After the process has finished running, depending on the results and the settings in the Fulfillment Plan, the status will have different possible values, such as "Ready", "Not Started", or "Completed".

After a fulfillment process has finished running, the status of the orders in the process may be checked via a GET request to the order resource of the Infoplus API.  If an order was successfully processed (meaning it had adequate inventory available for allocation, and no rules blocking its processing), its status will be "Processed", or, if the Auto Ship option is enabled in the Fulfillment Plan that was used, it will be "Shipped".  If the order failed to process for any reason, its status will be "On Order".  Resolving such issues is best handled in the Infoplus web application by reviewing the Audits on the order, the Allocation Details on the Fulfillment Plan, and other data available in Infoplus.  

Issuing the call from a client library

In the Infoplus client libraries, this API call can be made by invoking the RunFulfillmentPlan method on the OrderApi object, passing it a RunFulfillmentPlanInputAPIModel object as input, and getting back a list of ProcessOutputAPIModel objects as output.  Consult the documentation and/or distributed source code of the API Client libraries for language-specific details.  

Usage from a Script in Infoplus

In a script within Infoplus, this call would be made as follows: