Order Update

Allows customers to update an existing warehousing 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 get access to this API, please fill in the Developer Registration form

Resource URI

Make an HTTP PUT request to:

https://api.mainfreight.com/Warehousing/1.1/Customers/Order/{orderID}/?region={add region}

Resource Information

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

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...

Parameters

You must provide the parameters marked as required:

HTTP Request Parameters

HeaderDescriptionTypeRequired
order id

Provided in the API response when order is created

string Yes
region Region code, a list of supported regions for each country can be found here

 

string Yes

Fields

You must provide the following Fields:

Request Body

FieldsTypeDescription
id   guid
orderReference Your unique order reference identifying the Order  string  50 Yes
customerOrderReference Your customer reference for the Order string  50   
receiverReference Your customer's receiver reference for the Order string  50   
crossDocReference Cross docking reference string  50   
carrierReference Not required in your request. Carrier Reference is populated when finalising/despatching your order string  50   
warehouse The warehouse involved in the Order object    Yes
code Shorthand code to identify the warehouse Integer   Yes
receiverGroup General purpose field to group Receivers that have the same business rules, e.g. documentation object    
code Shorthand code to identify the receiver group string 50   
customer Customer involved in the Order object   Yes 
code Shorthand code to identify the customer string 50  Yes 
receiver Receiver contact details object   Yes
address1 Street address string 50 Yes
address2 Additional street address details string 50  
code Shorthand code to identify the receiver string 50 Yes
country Country for the Receiver address string 50 Yes
name The name of the Receiver string 50  
phone The phone number of the Receiver string 50  
place City/Place for the Receiver address string 50  
postCode PostCode/Zip for the Receiver address string 50  
state State for the Receiver address string 50  
suburb Suburb for the Receiver address string 50  
soldTo Contact details for the party the goods were sold to. If this party is used, code is required. object    
address1 Street address string 50  
address2 Additional street address details string 50  
code Shorthand code to identify the party the goods were sold to string 50 Yes
country Country for the party the goods were sold to address string 50  
name The name of the party the goods were sold to string 50  
phone The phone number of the party the goods were sold to string 50  
place City/Place for the party the goods were sold to address string 50  
postCode PostCode/Zip for the party the goods were sold to address string 50  
state State for the party the goods were sold to address string 50  
suburb Suburb for the party the goods were sold to address string 50  
contact contact name for the party the goods were sold to string 50  
charge   object    
code Charge code string  50  
sender   object    
code Sender code string 50   
consigneeDeliveryLocation   object    
code   string    
deliveryInstructions Delivery instructions for the order string 500  
comment1 Comment1 used to display additional information in packing slip string  50  
comment2 Comment2 used to display additional information in packing slip string 50   
comment3 Comment3 used to display additional information in packing slip string 50   
serviceProvider The service provider that will transport the order object    
name The name of the service provider, e.g. Mainfreight string 50  
orderType Order type list of available of types can be found here string 50  
repCode General purpose use field, discuss usage with the integration team string 50  
repName General purpose use field, discuss usage with the integration team string 50  
requiredDate Required date that order needs to be dispatched by
Format yyyy-MM-dd
date   Yes
etaDate Estimated date that order will be dispatched by
Format yyyy-MM-dd
date    
miscChargeAmount Miscellaneous charge amount for the order decimal    
freightCharge Freight charge amount for the order decimal    
taxAmount Tax amount charge for the order decimal    
pallets Number of pallets required for the order integer    
weight Total weight for the order decimal    
volume Total volume for the order decimal    
invoicedNetAmount Invoiced amount charge for the order decimal    
vipEmailAddress VIP email notification email address string 500  
customStockStatusCode Custom stock status code, discuss usage with the integration team string 50  
urgent Indicates that the order should be dispatched with urgent priority boolean    
dutyFree Indicates that the order is shipped as duty free boolean    
timesLotRequired Indicates that a timeslot is required for delivery in relation to the booking time boolean    
booking Booking details for the Order object    
fromDateTime Booking from date used for booking with Mainfreight Transport Format yyyy-MM-dd HH:mm:ss dateTime    
toDateTime Booking to date used for booking with Mainfreight Transport Format yyyy-MM-dd HH:mm:ss dateTime    
reference Booking reference value string 20  
comment Booking comment value string 50  
serviceLevel The required service levels for service providers object    
callRequired Indicates that a call is required to confirm the booking time boolean    
externalReferences External reference's, list of available of external reference types can be found here object    
externalSystem   object    
code   string 50  
references   array 50  
reference   array 50  
referenceType External reference types, list of available of types can be found here string 50  
value   string 50  
orderLines List of products related to this order array   Yes
orderLine Product related to this order object   Yes
lineNo Number identifying the order in your order integer   Yes
units Number of units for this product decimal   Yes
backOrderUnits Number of back order units integer    
retailPrice Number of back order units decimal    
discountPrice Number of back order units decimal    
costPrice Number of back order units decimal    
extendedPrice Number of back order units integer    
miscCharge Miscellaneous charge amount for ordered product object    
amount   decimal    
description   string    
receiverStock Reciver product details object    
code Receiver product code string 50  
packType Pack type ordered for product string 50  
weight Weight for product decimal    
volume Volume for product decimal    
contingencyPrice Contingency price for product decimal    
freightClass Freight class code for product list of available codes can be found here string 6  
kitsetCode Kitset code identifying the kitset. string 50  
product   object   Yes, if kitset not provided
code Product code
When providing a product code as well as a kitset code, all products for the kitset
should be provided with the correct ratios
string 50 Yes
description Product description, only required if configured to automatically create new products string 50 Conditional
alternativeDescription Alternative product description string 50  
grade1 Grade 1 attribute field against products in the WMS string   50  
grade2 Grade 2 attribute field against products in the WMS string  50   
grade3 Grade 3 attribute field against products in the WMS string  50   
expiryDate Expiry date attribute field against products in the WMS date    
packingDate Packing date attribute field against products in the WMS date    
underBond Under bond integer    
note Value for the note to appear against the line string 250  
externalReferences External references, list of available of external references can be found here  
externalSystem   object    
code   string 50  
references   object 50  
reference   array 50  
referenceType External reference types, list of available of types can be found here string 50  
value   string 50  

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 JSON Object and pass the Order ID into the URL as a parameter:

  • URL
< > grab code
https://api.mainfreight.com/Warehousing/1.1/Customers/Order/091BE892-E95B-4E47-8CA8-AB730C7E0528/?region=US

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

  • REQUEST JSON
< > grab code
{
   "id" : "{{replace-id}}",
   "orderReference": "{OurReference}",
   "customerOrderReference": "{YourReference}",
   "receiverReference": "{YourReceiverReference}", 
   "carrierReference": "{CarrierReference}",
   "crossDocReference": "{CrossDocReference}",
   "warehouse": {
      "code": "{{warehouseCode}}"
   },
   "receiverGroup": {
     "code": "2"
   },
   "customer": {
     "code": "{{customerCode}}"
   },
   "receiver": {
     "address1": "1115 broadway floor 3",
     "address2": "",
     "code": "179707",
     "country": "US",
     "name": "Sage,Ashique",
     "phone": "(718) 926-7450",
     "place": "New York",
     "postCode": "10010",
     "state": "NY",
     "suburb": ""
  },
  "soldTo": {
    "address1": "111",
    "address2": "",
    "code": "1723",
    "country": "New Zealand",
    "name": "Consignee ABCD",
    "phone": "",
    "place": "AUCKLAND",
    "postCode": "",
    "state": "",
    "suburb": "NEWTON",
    "contact": "Contact"
 },
 "charge": {
    "code": "54"
 },
"sender": {
   "code": "23"
 },
"consigneeDeliveryLocation": {
   "code": "23"
  },
 "deliveryInstructions": "deliveryInstructions",
 "comment1": "Comment1",
 "comment2": "Comment2",
 "comment3": "Comment3",
 "serviceProvider": {
    "name": "Mainfreight"
  },
  "orderType": "N",
  "repCode": "4",
  "repName": "[repName]",
  "requiredDate": "2017-05-31",
  "etaDate": "2000-06-02",
  "miscChargeAmount": "4.50",
  "freightCharge": "23.14",
  "taxAmount": "54.66",
  "pallets": "1",
  "weight": "2.7",
  "volume": "4.99",
  "invoicedNetAmount": "54.54",
  "vipEmailAddress": "{{emailAddress}}",
  "customStockStatusCode": "3",
  "urgent": "true",
  "dutyFree": "true",
  "timesLotRequired": "1",
  "booking": {
     "fromDateTime": "2021-06-02 11:11:00",
    "toDateTime": "2022-06-14 11:11:00",
    "reference": "[reference]",
    "comment": "[comment]"
   },
  "serviceLevel": "Metro",
  "callRequired": "false",
  "externalReferences": {
      "externalSystem": {
           "code": "SPSCommerce",
     "references": [
       {
          "referenceType": "Department",
          "value": "PurchaseOrderNumber"
       } 
     ]
   }
  },
  "orderLines": [
  {
     "lineNo": "1",
     "units": "1.67",
     "backOrderUnits": "2",
     "retailPrice": "54.0",
     "discountPrice": "23.5",
     "costPrice": "3.5",
     "extendedPrice": "5.50",
     "miscCharge": {
         "amount": "11.0",
        "description": "[name]"
      },
     "receiverStock": {
          "code": "123"
      },
     "packType": "EACH",
     "weight": "23.66",
     "volume": "23.33",
     "contingencyPrice": "332.5",
     "freightClass": "50",
     "kitsetCode": "",
      "product": {
           "code": "{{productCode}}",
           "description": "My Product",
           "alternativeDescription": "{ProductAltDescription}"
     },
     "grade1": "[grade1]", 
     "grade2": "[grade2]",
     "grade3": "[grade3]",
     "expiryDate": "2049-03-03",
     "packingDate": "2059-02-12",
     "underBond": "1",
     "note": "Product Line",
     "externalReferences": {
          "externalSystem": {
                "code": "SPSCommerce",
          "references": [
           {
              "referenceType": "BuyerPartNumber",
              "value": "BuyerPartNumber"
           }
         ]
       }
     }
   }
  ]
}

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/Warehousing/1.1/Customers/Order/091BE892-E95B-4E47-8CA8-AB730C7E0528/?region=US

You are going to send XML document similar to this:

  • XML REQUEST
< > grab code
<order>
    <orderReference>{OurReference}</orderReference>
    <customerOrderReference>{YourReference}</customerOrderReference>
    <receiverReference>{YourReceiverReference}</receiverReference>
    <carrierReceiver>{CarrirerReference}</carrierReceiver>
    <crossDocReference>{CrossDocReference}</crossDocReference>
    <warehouse>
        <code>{{warehouseCode}}</code>
    </warehouse>
    <receiverGroup>
        <code>2</code>
    </receiverGroup>
    <customer>
        <code>{{customerCode}}</code>
    </customer>
    <receiver>
        <address1>1115 broadway floor 3</address1>
        <address2/>
        <code>179707</code>
        <country>US</country>
        <name>Sage,Ashique</name>
        <phone>(718) 926-7450</phone>
        <place>New York</place>
        <postCode>10010</postCode>
        <state>NY</state>
        <suburb />
    </receiver>
    <soldTo>
      <address1>111</address1>
      <address2 />
      <code>1723</code>
      <country>New Zealand</country>
      <name>Consignee ABCD</name>
      <phone />
      <place>AUCKLAND</place>
      <postCode />
      <state />
      <suburb>NEWTON</suburb>
      <contact>Contact</contact>
    </soldTo>
    <charge>
      <code>54</code>
    </charge>
    <sender>
      <code>23</code>
    </sender>
    <consigneeDeliveryLocation>
      <code>23</code>
    </consigneeDeliveryLocation>
    <deliveryInstructions>deliveryInstructions</deliveryInstructions>
    <comment1>Comment1</comment1>
    <comment2>Comment2</comment2>
    <comment3>Comment3</comment3>
    <serviceProvider>
      <name>Mainfreight</name>
    </serviceProvider>
    <orderType>N</orderType>
    <repCode>4</repCode>
    <repName>[repName]</repName>
    <requiredDate>2017-05-31</requiredDate>
    <etaDate>2000-06-02</etaDate>
    <miscChargeAmount>4.50</miscChargeAmount>
    <freightCharge>23.14</freightCharge>
    <taxAmount>54.66</taxAmount>
    <pallets>1</pallets>
    <weight>2.7</weight>
    <volume>4.99</volume>
    <invoicedNetAmount>54.54</invoicedNetAmount>
    <vipEmailAddress>test@mainfreight.co.nz</vipEmailAddress>
    <customStockStatusCode>3</customStockStatusCode>
    <urgent>true</urgent>
    <dutyFree>true</dutyFree>
    <timesLotRequired>1</timesLotRequired>
    <booking>
      <fromDateTime>2021-06-02 11:11:00</fromDateTime>
      <toDateTime>2022-06-14 11:11:00</toDateTime>
      <reference>[reference]</reference>
      <comment>[comment]</comment>
    </booking>
    <serviceLevel>Metro</serviceLevel>
    <callRequired>false</callRequired>
	<externalReferences>
	    <externalSystem>
	    	<code>SPSCommerce</code>
		<references>
		      <reference>
		        <referenceType>Department</referenceType>
		        <value>PurchaseOrderNumber</value>
		      </reference>
		 </references>
	    </externalSystem>
	</externalReferences>
    <orderLines>
      <orderLine>
        <lineNo>1</lineNo>
        <units>1.67</units>
        <backOrderUnits>2</backOrderUnits>
        <retailPrice>54.0</retailPrice>
        <discountPrice>23.5</discountPrice>
        <costPrice>3.5</costPrice>
        <extendedPrice>5.50</extendedPrice>
        <miscCharge>
          <amount>11.0</amount>
          <description>[name]</description>
        </miscCharge>
        <receiverStock>
          <code>123</code>
        </receiverStock>
        <packType>EACH</packType>
        <weight>23.66</weight>
        <volume>23.33</volume>
        <contingencyPrice>332.5</contingencyPrice>
        <freightClass>50</freightClass>
        <kitsetCode />
        <product>
          <code>{{productCode}}</code>
          <description>My Product</description>
          <alternativeDescription>{ProductAltDescription}</alternativeDescription>
        </product>
        <grade1>[grade1]</grade1>
        <grade2>[grade2]</grade2>
        <grade3>[grade3]</grade3>
        <expiryDate>2049-03-03</expiryDate>
        <packingDate>2059-02-12</packingDate>
        <underBond>1</underBond>
        <note>Product Line</note>
        <externalReferences>
	      <externalSystem>
		 <code>SPSCommerce</code>
		    <references>
			<reference>
			   <referenceType>BuyerPartNumber</referenceType>
			        <value>BuyerPartNumber</value>
			</reference>
	            </references>
	       </externalSystem>
    	</externalReferences>
        <destinations />
      </orderLine>
    </orderLines>
</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.