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",
        "request" : "addorders",
        "orders" : [
            {
                "orderId" : "1",
                "ShipToName" : "test",
                "ShipToCompany" : "test",
                "ShipToStreet" : "test",
                "ShipToStreetTwo" : "test",
                "ShipToCity" : "test",
                "ShipToState" : "test",
                "ShipToCountry" : "test",
                "ShipToZip" : "test",      
                "ShipToPhone" : "555-1234",      
                "ShipViaCode" : "",
                "OrderType" : "B2B",
                "OrderComment" : "order comment",
                "OrderCommentType" : "PACK",
                "Comments" : [
                    {
                        "Comment": "testing BOL",
                        "Type": "BOL"
                    },
                    {
                        "Comment": "testing PACK",
                        "Type": "PACK"
                    }
                ],
	            "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 Order Type options that are available from the Midwest Logisitcs System. If an Order Type is not supplied then the API will default to B2C.

Code Meaning
B2C Business to Customer
B2B Business to Business
Transfer Internal Transfer

Below is a list of Order Comment Type options that are available from the Midwest Logisitcs System. If an Order Comment Type is not supplied then the API will default to PACK. The maximum allowed characters allowed for a comment is 350 characters.

The field "OrderComment" and "OrderCommentType" are for legacy support and will be phased out in future version. To add comments for an order use the "Comments" field and pass an array of comments.

Code Meaning
BOL Bill of Lading
PACK Packing Slip
PICK Picking Ticket.

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 default to 100000045 (Standard Service)

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

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