Creating An Order

Welcome,

Below is an example of how to use the Midwest Order API. The Midwest Order API allows you to post orders in JSON format to the URL https://connect.midwest-logistics.com/api/. The API will automatically add the orders and their products to Midwest's order process. If a product being added to the order has an invalid SKU the entire order will be rejected.

Upon successful submission of orders to the system, email developer@midwest-logistics.com for confirmation of the orders in the test environment and so we can add tracking to allow testing of order status lookup.

The following JSON format needs to be posted to the API.

            
    {
        "apiKey" : "Provided API KEY",
        "customerId" : "Provided Customer KEY",
        "request" : "addorders",
        "orders" : [
            {
                "orderId" : "1",
                "ShipToName" : "test",
                "ShipToCompany" : "test",
                "ShipToStreet" : "test",
                "ShipToStreetTwo" : "test",
                "ShipToCity" : "test",
                "ShipToState" : "test",
                "ShipToCountry" : "test",
                "ShipToZip" : "test",
                "ShipVia" : "USPS",
                "ShipViaCode" : ""
	            "products" : [
		            {"QTY" : "1","SKU" : "1234"},
		            {"QTY" : "10","SKU" : "1234"}
	            ]
            }		 
        ]
    }
            
        

The Midwest Order API will respond with a status and a list of orders.

The API will respond with a status of either 200 or 500 for the API call as a whole and each individual order as well as products. 200 is good, 500 is bad. If a product cannot be added or does not currently exist in the Midwest CRM then a status of 500 will be returned and the errorMsg field will contain the reason that the product could not be added. If at any time a product cannot be added due to an error or the product does not exist in the Midwest CRM the entire order will be rejected by the Midwest Order API.

An example of a response that succeeded:

            
    {
	    "result": "200",
	    "orderCount": "2",
	    "message": "",
	    "orders": [{
		    "orderId": "1",
		    "CRMOrderId": "12345646",
		    "status": "200",
		    "message": "",
		    "products": [{
			    "SKU": "123456",
			    "status": "200",
			    "errorMsg": ""
		    }, {
			    "SKU": "123456",
			    "status": "200",
			    "errorMsg": ""
		    }]
	    }, {
		    "orderId": "2",
		    "CRMOrderId": "12345647",
		    "status": "200",
		    "message": "",
		    "products": [{
			    "SKU": "123456",
			    "status": "200",
			    "errorMsg": ""
		    }, {
			    "SKU": "123456",
			    "status": "200",
			    "errorMsg": ""
		    }]
	    }]
    }
            
        

An example of a response that failed:

            
    {
	    "result": "200",
	    "orderCount": "2",
	    "message": "",
	    "orders": [{
		    "orderId": "1",
		    "CRMOrderId": "0",
		    "status": "500",
		    "message": "The Ship to name is empty",
		    "products": [{
			    "SKU": "",
			    "status": "500",
			    "errorMsg": ""
		    }]
	    }, {
		    "orderId": "2",
		    "CRMOrderId": "12312312312",
		    "status": "500",
		    "message": "",
		    "products": [{
			    "SKU": "123123",
			    "status": "500",
			    "errorMsg": "The Product could not be found."
		    }, {
			    "SKU": "123123",
			    "status": "200",
			    "errorMsg": ""
		    }]
	    }]
    }
            
        

Below is a list of ShipViaCode options that are available from the Midwest Logisitcs System. If a ShipViaCode is not supplied then the API will derive the code from the ShipVia field. If the shipping cannot be derived, the default will be USPS.

Code Service
7 Delivery
2 DHL
100000008 FedEx 2Day
100000022 Fedex 2day AM
100000024 Fedex Express Saver
100000023 Fedex First Overnight
3 FedEx Ground
100000025 Fedex Home Delivery
100000039 Fedex International Economy
100000040 Fedex International Ground
100000041 Fedex International Priority
100000019 Fedex Priority Overnight
100000020 Fedex Standard Overnight
100000050 FedexGround Economy Parcel SL
100000049 FedexGround Economy under 1lb
100000001 Freight
6 Full Load
100000047 International Standard
100000017 Newgistics Parcel Select
100000018 Newgistics Parcel Select Light
100000053 ONE RATE FedEx 2Day
100000054 ONE RATE FedEx Express Saver
100000051 ONE RATE FedEx Priority Overni
100000052 ONE RATE FedEx Standard Overni
100000043 Overnight Express
100000000 Pick Up
100000046 Quote Shipment
100000045 Standard Service Group
100000044 Three-Day Express
100000042 Two-Day Express
100000003 UPS 2nd Day Air
100000005 UPS 2nd Day Air A.M.
100000006 UPS 3 Day Select
100000032 UPS 3 Day Select CA
100000028 UPS Express Early
100000030 UPS Express Saver
4 UPS Ground
100000007 UPS Next Day Air
100000037 UPS Next Day Air Early
52 UPS Worldwide Expedited
100000027 UPS Worldwide Expedited CA
100000036 UPS Worldwide Express
100000035 UPS Worldwide Express CA
100000034 UPS Worldwide Express Plus
100000033 UPS Worldwide Express Plus CA
100000031 UPS Worldwide Express Saver
100000002 USPS Express
100000015 USPS Express Flat Rate Padded
100000016 USPS First Class International
100000055 USPS GRND ADV CUBIC
100000048 USPS Ground Advantage
100000009 USPS Ground Advantage under1LB
100000014 USPS Priority Flat Rate Padded
100000004 USPS Priority International
100000012 USPS Priority Large Flat Rate
100000010 USPS Priority Mail
100000011 USPS Priority Medium Flat Rate
100000013 USPS Priority Small Flat Rate

The Ship Via field can have the follow options:

  1. USPS
  2. UPS
  3. UPS GROUND
  4. DHL
  5. FEDEX
  6. FEDEX GROUND

If the Ship Via field does not match any of the above listed items, the default will be USPS.


Below is an example form that will allow you to create the JSON that will be needed for an order.

Example Form

Shipping Info


Products

Current Products for this order

None

Current Orders

none

Full Json.

Testing

Enter the Json you wish to send