Order Update

Allows customers to update an existing logistics order in the internal WMS, as long as the order has not been processed.

Note: No Content will be returned in the reponse

Access

To access to Mainfreight APIs, you have to Register

Resource URI

Make an HTTP PUT request to:

https://api.mainfreight.com/Logistics/1.0/Customers/Order/{ order id }

Resource Information

TypeValue 
Authentication API Key  
Response Formats JSON / XML  
HTTP Methods PUT  
API Version 1.0  

HTTP Headers

You must add the following HTTP Headers to your request:

HeaderTypeDescription
Content-Type string Request content type. Supported types are "application/json" or "application/xml."
Authorization string

The word "Secret" followed by a space, then your unique Logistics API Key.

e.g: Secret wdnOId93-VXZECxvVRPQEJZNxPB5XZ...

RequestedBy string Please provide your application name.

Parameters

You must provide the following parameters:

Request Parameters

ParameterTypeDescription
order string  
 references array List of References that can be identified in our system.
 referenceType string Reference type, list of avaiable types can be found here
 value string Reference value.
 parties array List of References that can be indentified in our system.
 partyType string Party type, list of available types can be found here
 code string Party code.
 displayName string Display name for Receiver,SoldTo
address1 string Address 1 
address2 string Address 2 
suburb string Suburb 
postCode string PostCode/Zip 
place string City/Place
country string Country
 notes array List of Notes that can be indentified in our sysytem
noteType string Note type, list of available of types can be found here
value string Note value
 serviceProvider array List of Service Providers that can be identified in our system
displayName string Name of Service Provider
serviceLevel array List of Service Levels for Service Providers that can be identified in our system
displayName string Name of serivce level
 orderType string Order Type list of available of types can be found here
 repCode string Rep Code value
 repName string Rep Name value
 requiredDate date Required Date that order needs to be dispatched
Format yyyy-MM-dd 
 etaDate date Estimated Date that order will be dispatched
Format yyyy-MM-dd 
 miscCharge decimal Miscellaneous Charge amount for the order 
 freightCharge decimal Freight Charge amount for the order
 taxAmount decimal Tax Amount charge for the order 
 pallets integer Number of Pallets required for the order  
 weight decimal Total Weight for the order 
 volume decimal Total Volume for the order 
 invoicedNetAmount decimal Invoiced Amount charge for the order 
 signedBy string Signed by value for the order 
 vipEmailAddress string VIP Email Notification email address 
 customStockStatusCode string Custom Stock Status Code  
 isUrgent boolean Urgent order flag
 isDutyFree boolean Duty Free order flag 
 isBookingRequired boolean Booking Required for order 
 bookingFromDateTime dateTime Booking From Date used for booking with Mainfreight Transport
Format yyyy-MM-dd HH:mm:ss
 bookingToDateTime dateTime Booking To Date used for booking with Mainfreight Transport
Format yyyy-MM-dd HH:mm:ss 
 bookingReference string Booking Reference value
 bookingComment string Booking Comment value
 orderLines array  
lineNo integer Order Line number
units integer Order units 
backOrderUnits integer Order Back Order units 
retailPrice decimal Retail Price for ordered product
discountPrice decimal Discount Price for ordered product
costPrice decimal Cost Price for ordered product
extendedPrice decimal Extended Price for ordered product
miscChargeAmount decimal Miscellaneous Charge amount for ordered product 
miscChargeDisplayName string Miscellaneous Charge Display name.
receiverStockCode string Receiver Product code
receiverStockDisplayName string Receiver Product description
packType string Pack Type ordered for product
weight decimal Weight for product
volume decimal Volume for product 
contingencyPrice decimal Contingency Price for product
freightClass string Freight Class code for product list of avaiable codes can be found here
product array  
code string Product code
displayName string Product Description 
alternativeDisplayName string Alternative Product Description 
attributes array List of available atrributes available for products
attributeType string Attribute type, list of available attribute types can be found here
value string,date Attribute value
notes array Notes against order line
noteType note Note Type
value string Note Value

Response Parameters

Responds with an HTTP 204 response code on success.

Code samples

JSON Example

To Update an Order in the JSON format you will need to PUT a JOSN Object and pass the Order ID into the URL as a parameter:

  • URL
< > grab code
https://api.mainfreight.com/Logistics/1.0/Customer/Order/091BE892-E95B-4E47-8CA8-AB730C7E0528

You are going to send a JSON object similar to this:

  • REQUEST JSON
< > grab code
{
	"id": null,
	"references": [{
			"referenceType": "YourReceiverReference",
			"value": "ClientOrderRef"
		}, {
			"referenceType": "OurReference",
			"value": "OrderRef4234"
		}, {
			"referenceType": "YourReference",
			"value": "CustomerOrderRef"
		}, {
			"referenceType": "CarrierReference",
			"value": "CarrierRef"
		}, {
			"referenceType": "CrossDocReference",
			"value": "XDocRef"
		}
	],
	"parties": [{
			"partyType": "Warehouse",
			"code": "77",
			"displayName": null,
			"address1": null,
			"address2": null,
			"suburb": null,
			"postCode": null,
			"place": null,
			"state": null,
			"country": null,
			"phone": null
		}, {
			"partyType": "Customer",
			"code": "43862",
			"displayName": null,
			"address1": null,
			"address2": null,
			"suburb": null,
			"postCode": null,
			"place": null,
			"state": null,
			"country": null,
			"phone": null
		}, {
			"partyType": "Receiver",
			"code": "1234",
			"displayName": "Consignee ABCD",
			"address1": "111",
			"address2": "222",
			"suburb": "NEWTON",
			"postCode": "1010",
			"place": "AUCKLAND",
			"state": null,
			"country": "New Zealand",
			"phone": null
		}, {
			"partyType": "SoldTo",
			"code": "1723",
			"displayName": "Consignee ABCD",
			"address1": "111",
			"address2": null,
			"suburb": "NEWTON",
			"postCode": null,
			"place": "AUCKLAND",
			"state": null,
			"country": "New Zealand",
			"phone": null
		}
	],
	"notes": [{
			"noteType": "Comment1",
			"value": "Comment1"
		}, {
			"noteType": "Comment2",
			"value": "Comment2"
		}, {
			"noteType": "Comment3",
			"value": "Comment3"
		}, {
			"noteType": "DeliveryInstructions",
			"value": "def"
		}
	],
	"serviceProvider": {
		"displayName": "Mainfreight",
		"serviceLevel": {
			"displayName": "Metro"
		}
	},
	"orderType": "Normal",
	"repCode": "repCode",
	"repName": "repName",
	"requiredDate": "2017-05-31",
	"etaDate": "2017-06-02",
	"miscCharge": "5",
	"freightCharge": "5",
	"taxAmount": "1",
	"pallets": "1",
	"weight": "2",
	"volume": "3",
	"invoicedNetAmount": "4",
	"vipEmailAddress": "m3@y0u.co.nz",
	"customStockStatusCode": "",
	"isUrgent": "true",
	"isDutyFree": "false",
	"isBookingRequired": "false",
	"bookingFromDateTime": "2017-05-31 12:05:05",
	"bookingToDateTime": "2017-05-31 13:06:06",
	"bookingReference": "BookingReference",
	"bookingComment": "BookingComment",
	"orderLines": [{
			"lineNo": "1",
			"units": 2,
			"backOrderUnits": 2,
			"retailPrice": 3.0,
			"discountPrice": 4.0,
			"costPrice": 5.0,
			"extendedPrice": 6.0,
			"miscChargeAmount": 7.0,
			"miscChargeDisplayName": "miscChargeDisplayName",
			"receiverStockCode": "receiverStockCode",
			"receiverStockDisplayName": "receiverStockDisplayName",
			"packType": "CARTON",
			"weight": 8.0,
			"volume": 9.0,
			"contingencyPrice": 10.0,
			"freightClass": "50",
			"kitset": null,
			"product": {
				"id": null,
				"code": "269495",
				"displayName": "TENNIS BALL 24CM",
				"alternativeDisplayName": "",
				"balance": null
			},
			"attributes": [{
					"attributeType": "Grade1",
					"value": "Grade1"
				}, {
					"attributeType": "Grade2",
					"value": "Grade2"
				}, {
					"attributeType": "Grade3",
					"value": "Grade3"
				}, {
					"attributeType": "ExpiryDate",
					"value": "2018-05-31"
				}, {
					"attributeType": "PackingDate",
					"value": "2018-05-31"
				}
			],
			"notes": [{
					"noteType": "Note",
					"value": "Product Line"
				}
			]
		}
	]
}

You are going get a HTTP response similar to this:

  • RESPONSE HTTP
< > grab code
Responds with an HTTP 204 response code on success.
XML Example

To Update an Order in XML format, you will need to POST XML object and pass the Order Id parameter into the URL. 

  • URL
< > grab code
https://api.mainfreight.com/Logistics/1.0/Customer/Order/091BE892-E95B-4E47-8CA8-AB730C7E0528

You are going to send XML document similar to this:

  • XML REQUEST
< > grab code
<order>
      <references>
             <reference>
<referenceType>ClientOrderRef</referenceType>
<value>ClientOrderRef</value>
</reference>
<reference>
<referenceType>OurReference</referenceType>
<value>OurReference</value>
</reference>
<reference>
<referenceType>YourReference</referenceType>
<value>YourReference</value>
</reference>
<reference>
<referenceType>CarrierReference</referenceType>
<value>CarrierReference</value>
</reference>
<reference>
<referenceType>CrossDocReference</referenceType>
<value>CrossDocReference</value>
</reference>
</references>
<parties>
<party>
<partyType>Warehouse</partyType>
<code>WarehouseCode</code>
</party>
<party>
<partyType>Customer</partyType>
<code>CustomerCode</code>
</party>
<party>
<partyType>Receiver</partyType>
<code>ReceiverCode</code>
<displayName>ReceiverDisplayName</displayName>
<address1>ReceiverAddress1</address1>
<address2>ReceiverAddress2</address2>
<suburb>ReceiverSuburb</suburb>
<postCode>ReceiverPostCode</postCode>
<place>ReceiverPlace</place>
<country>ReceiverCountry</country>
</party>
<party>
<partyType>SoldTo</partyType>
<code>SoldToCode</code>
<displayName>SoldToDisplayName</displayName>
<address1>SoldToAddress1</address1>
<suburb>SoldToSuburb</suburb>
<place>SoldToPlace</place>
<country>SoldToCountry</country>
</party>
</parties>
<notes>
<note>
<noteType>Comment1</noteType>
<value>Comment1</value>
</note>
<note>
<noteType>Comment2</noteType>
<value>Comment2</value>
</note>
<note>
<noteType>Comment3</noteType>
<value>Comment3</value>
</note>
<note>
<noteType>DeliveryInstructions</noteType>
<value>DeliveryInstructions</value>
</note>
</notes>
<serviceProvider>
<displayName>ServiceProviderDisplayName</displayName>
<serviceLevel>
<displayName>ServiceLevelDisplayName</displayName>
</serviceLevel>
</serviceProvider>
<orderType>Normal</orderType>
<repCode>repCode</repCode>
<repName>repName</repName>
<requiredDate>2017-01-01</requiredDate>
<etaDate>2017-01-02</etaDate>
<miscCharge>1</miscCharge>
<freightCharge>1</freightCharge>
<taxAmount>1</taxAmount>
<pallets>1</pallets>
<weight>1</weight>
<volume>1</volume>
<invoicedNetAmount>1</invoicedNetAmount>
<vipEmailAddress>VipEmailAddress</vipEmailAddress>
<customStockStatusCode>CustomStockStatusCode</customStockStatusCode>
<isUrgent>true</isUrgent>
<isDutyFree>true</isDutyFree>
<isBookingRequired>true</isBookingRequired>
<bookingFromDateTime>2017-01-01 12:00:00</bookingFromDateTime>
<bookingToDateTime>2017-01-02 12:00:00</bookingToDateTime>
<bookingReference>BookingReference</bookingReference>
<bookingComment>BookingComment</bookingComment>
<orderLines>
<orderLine>
<lineNo>1</lineNo>
<units>1</units>
<backOrderUnits>1</backOrderUnits>
<retailPrice>1</retailPrice>
<discountPrice>1</discountPrice>
<costPrice>1</costPrice>
<extendedPrice>1</extendedPrice>
<miscChargeAmount>1</miscChargeAmount>
<miscChargeDisplayName>miscChargeDisplayName</miscChargeDisplayName>
<receiverStockCode>receiverStockCode</receiverStockCode>
<receiverStockDisplayName>receiverStockDisplayName</receiverStockDisplayName>
<packType>CARTON</packType>
<weight>1</weight>
<volume>1</volume>
<contingencyPrice>1</contingencyPrice>
<freightClass>1</freightClass>
<product>
<code>1</code>
<displayName>ProductDisplayName</displayName>
<alternativeDisplayName>AlternativeDisplayName</alternativeDisplayName>
</product>
<attributes>
<attribute>
<attributeType>Grade1</attributeType>
<value>Grade1</value>
</attribute>
<attribute>
<attributeType>Grade2</attributeType>
<value>Grade2</value>
</attribute>
<attribute>
<attributeType>Grade3</attributeType>
<value>Grade3</value>
</attribute>
<attribute>
<attributeType>ExpiryDate</attributeType>
<value>2017-01-01</value>
</attribute>
<attribute>
<attributeType>PackingDate</attributeType>
<value>2017-01-01</value>
</attribute>
</attributes>
<notes>
<note>
<noteType>Note</noteType>
<value>Note</value>
</note>
</notes>
</orderLine>
</order>

You are going to get a  HTTP Response similar to this:

  • HTTP RESPONSE
< > grab code
Responds with an HTTP 204 response code on success.
NOTE: Content in the panels below this point are not visible on the site unless used by other features e.g. gadgets, OB&E, etc.