Inward Update

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

Note: No Content will be returned in the reponse

Required fields are in bold text.

Access

To access to Mainfreight APIs, you have to Register

Resource URI

Make an HTTP POST request to:

https://api.mainfreight.com/logistics/1.0/customers/inward/ { inward 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:

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

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

e.g: Secret wdnOId93-VXZECxvVRPQEJZNxPB5XZ...

string Yes

Parameters

You have to provide the parameters marked as required:

Request Parameters

ParameterDescriptionTypeLengthRequired
references List of References associated with the inward to help identify unique inwards array   Yes
referenceType Reference type, list of available types can be found here string 50 Yes
value Reference value string 50 Yes
parties List of parties associated with the inward, e.g. warehouse, consignee, etc. array   Yes
partyType Type of party, list of available types can be found here string 50 Yes
code Shorthand code to identify the party string 50 Yes
displayName The display name for the party, usually relates to Receiver, SoldTo string 50  
address1 Street address string 50  
address2 Additional street address details string 50  
suburb Suburb for the party address string 50  
postCode PostCode/Zip for the party address string 50  
place City/Place for the party address string 50  
state State for the party address string 50  
country Country for the party address string 50  
notes List of notes that can be identified in our system array    
noteType Note type, list of available of types can be found here string 50  
value Value to appear against the note string 50-500  
serviceProvider The service provider that will transport the inward object    
displayName The name of the service provider, e.g. Mainfreight string 50  
serviceLevel The required service levels for service providers object    
displayName The name of service level, e.g. Next Day string 50  
inwardType Inward type list of available of types can be found here string 50  
bookingDate Booking date for the inward
Format yyyy-MM-dd
date    
arrivalDate Arrival date for the inward
Format yyyy-MM-dd
date    
units Total number of units for the inward decimal    
weight Total weight for the inward decimal    
volume Total volume for the inward decimal    
pallets Total number of pallets integer    
plant Indiicates the Plant where the inward came from string 50  
isDutyFree Indicates that the inward is shipped as duty free boolean    
freeStore A free text field string 50  
externalReferences List of external system references array    
externalSystem   object    
code External system code string 50  
references List of References associated with the external system array    
referenceType External reference type, list of available types can be found here string 50  
value Reference value string 50  
inwardLines List of products related to this inward array   Yes
lineNo Number identifying the inward line in your inward integer   Yes
units Number of units for this product decimal   Yes
weight Weight for product decimal    
volume Volume for product decimal    
packType Pack type ordered for product string 50  
stockStatus Set Stock Status for product, list of available stock statuses can be found here 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
displayName Product description, only required if configured to automatically create new products string 50 Conditional
alternativeDisplayName Alternative product description string 50  
kitset   object   Yes, if product not provided
code Kitset code identifying the kitset.
When providing a kitset code, product code is optional
string 50 Yes
attributes List of available attributes available for products array    
attributeType Attribute type, list of available attribute types can be found here string 50  
value Attribute value
Date type attributes must have a format yyyy-MM-dd
string, date 50  
references List of Inward line References associated with the product array    
referenceType Reference type, list of available types can be found here string 50  
value Reference value string 50  
note   object    
value Value for the note to appear against the line string 250  
externalReferences List of external system references associated with the line array    
externalSystem   object    
code External system code string 50  
references List of References associated with the external system array    
referenceType External reference type, list of available types can be found here string 50  
value Reference value string 50  

Response Parameters

Responds with an HTTP 204 response code on success 

Code samples

JSON Example

To Create an Inward in JSON format you will need to POST a JSON object:

  • URL
< > grab code
https://api.mainfreight.com/logistics/1.0/customers/inward/00000000-0000-0000-0000-000000000000

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

  • REQUEST JSON
< > grab code
{
{
    "id": null,
	"references": [{
			"referenceType": "OurReference",
			"value": "{OurReference}"
		}
	],
	"parties": [{
			"partyType": "Warehouse",
			"code": "{WarehouseCode}"
		},{
			"partyType": "Customer",
			"code": "{CustomerCode}"
		},{
			"partyType": "Pickup",
			"code": "1234",
			"displayName": "Consignee ABCD",
			"address1": "111",
			"address2": "222",
			"suburb": "NEWTON",
			"postCode": "1010",
			"place": "AUCKLAND",
			"state": null,
			"country": "New Zealand",
			"phone": null
		}
	],
	"notes": [{
			"noteType": "Note",
			"value": "Note"
		}
	],
	"bookingDate": "2017-05-31",
	"arrivalDate": "2017-06-02",
	"serviceProvider": {
        "displayName": "MAINFREIGHT"
    },
	"units": "1",
	"pallets": "1",
	"weight": "2.0",
	"volume": "3.1",
	"plant": "",
	"inwardType": "G",
	"freeStore": "",
	"inwardLines": [{
			"lineNo": 1,
			"units": 2,
			"weight": 8.0,
			"volume": 9.0,
			"packType": "",
			"stockStatus": "",
            "kitset": { 
                "code": null 
            },
			"product": {
				"code": "{ProductCode}",
				"displayName": "",
				"alternativeDisplayName": ""
            },
            "references": [
                {
                    "referenceType": "ShippingNotification",
                    "value": ""
                }, {
                    "referenceType": "PurchaseOrderNumber",
                    "value": ""
                }, {
                    "referenceType": "PurchaseOrderLineNumber",
                    "value": ""
                }
            ],
			"attributes": [{
					"attributeType": "Grade1",
					"value": ""
				}, {
					"attributeType": "Grade2",
					"value": ""
				}, {
					"attributeType": "Grade3",
					"value": ""
				}, {
					"attributeType": "ExpiryDate",
					"value": ""
				}, {
					"attributeType": "PackingDate",
					"value": ""
				}, {
					"attributeType": "ArrivalDate",
					"value": ""
				}, {
					"attributeType": "VFD",
					"value": ""
				}, {
					"attributeType": "VTI",
					"value": ""
				}, {
					"attributeType": "UnderBond",
					"value": ""
				}, {
					"attributeType": "LicensePlateNumber",
					"value": ""
				}, {
					"attributeType": "EntryNumber",
					"value": ""
				}, {
					"attributeType": "EntryLineNumber",
					"value": ""
				}
			],
			
			"note": {
					"value": "Product Line"
				}
				
		}
	]
}

You are going get another JSON object similar to this:

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

To Create an Inward in XML format, you will need to POST XML object.

  • URL
< > grab code
https://api.mainfreight.com/logistics/1.0/customers/inward/00000000-0000-0000-0000-000000000000

You are going to send XML document similar to this:

  • XML REQUEST
< > grab code
<inward>
    <references>
        <reference>
            <referenceType>OurReference</referenceType>
            <value>{OurReference}</value>
        </reference>
        <reference>
            <referenceType>InwardsReference1</referenceType>
            <value>{InwardsReference1}</value>
        </reference>
    </references>
    <parties>
        <party>
            <partyType>Warehouse</partyType>
            <code>{WarehouseCode}</code>
        </party>
        <party>
            <partyType>Customer</partyType>
            <code>{CustomerCode}</code>
        </party>
        <party>
            <partyType>Pickup</partyType>
            <code>1234</code>
            <displayName>ABCD</displayName>
            <address1>111</address1>
            <address2>222</address2>
            <country>New Zealand</country>
            <phone />
            <place>AUCKLAND</place>
            <postCode>1010</postCode>
            <state />
            <suburb>NEWTON</suburb>
        </party>
    </parties>
    <bookingDate>2018-06-02</bookingDate>
    <arrivalDate>2018-06-02</arrivalDate>
    <inwardType>G</inwardType>
    <units>2</units>
    <pallets>1</pallets>
    <weight>20.0</weight>
    <volume>2.0</volume>
    <serviceProvider>
        <displayName>Mainfreight</displayName>
        <serviceLevel>
            <displayName>Metro</displayName>
        </serviceLevel>
    </serviceProvider>
    <notes>
        <note>
            <noteType>Note</noteType>
            <value>Note data</value>
        </note>
    </notes>
    <inwardLines>
        <inwardLine>
            <lineNo>1</lineNo>
            <units>2</units>
            <attributes>
                <attribute>
                    <attributeType>Grade1</attributeType>
                    <value>Grade1</value>
                </attribute>
                <attribute>
                    <attributeType>ExpiryDate</attributeType>
                    <value>2018-05-31</value>
                </attribute>
            </attributes>
            <note>
                <value>Product Line</value>
            </note>
            <product>
                <code>{ProductCode}</code>
                <displayName>{ProductDescription}</displayName>
            </product>
        </inwardLine>
    </inwardLines>
</inward>

You are going to get a XML document 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.