• Home
  • Contacts
  • On The Go
  • Track
  • Settings
  • Search

Warehousing (Logistics) API

The Logistic API allows users to create, update and delete orders and also retrieve stock on hand for products at Mainfreight.

All methods utilise a RESTful approach; supporting both XML and JSON formats. 

Available Methods


An API key is required for all requests. Please contact the Mainfreight team to receive an API key. These API keys will only be valid in the environment it is created for.

API Terms of Use

By registering for and/or accessing any API found on this developer website, you understand and have agreed to our API Terms of Use.

Click here to read our API Terms of Use.

Model Drop in DLL

Mainfreight provides a .NET compatible library with model for all the entities that can be used to make it easier for developers to communicate with the Mainfreight APIs.

Service consumer Drop in DLL

Mainfreight also provides a .NET compatible library which provides wrapping methods to easily consume the Mainfreight Status API.

You can find a copy of these drop in dlls here.

Please note, Mainfreight.Api.Logistics.Client.dll requires Mainfreight.Api.Logistics.Model.dll and Mainfreight.Api.Common.Client.dll.

Drop in DLL usage example

References Example

To list all available anonymous notifications for a particular document you have to post a json similar to this (notice that no session secret is used):

  • C#
< > grab code
	StatusClient client = new StatusClient("YOUR_API_KEY");
	References references = client.References(ServiceTypes.TransportNz, "ABC900000999", ReferenceTypes.ConsignmentNumber);

	if (references.Count > 0)
		Console.WriteLine(string.Format("Code = {0}\r\nOurReference = {1} \r\nYourReference: \r\n{2}\r\nTrackingUrl: \r\n{3}",
			references[0].OurReference, references[0].YourReference, references[0].TrackingUrl));
		Console.WriteLine(string.Format("Code = {0}\r\nThere are no results for that reference."));
catch (StatusClientException scx)
	if (scx.Error != null)
		Console.WriteLine(string.Format("Code = {0}\r\nResponseCode = {1} \r\nMessage: \r\n{2}\r\nTarget: \r\n{3}",
			scx.Error.Code, scx.Error.ResponseCode, scx.Error.Message, scx.Error.Target));
		if (scx.Error.Details != null)
			foreach (Detail error in scx.Error.Details)
				Console.WriteLine(string.Format("INNER ERROR: Code = {0} \r\nMessage: \r\n{1}\r\nTarget: \r\n{2}",
					error.Code, error.Message, error.Target));
catch (Exception ex)
	Console.WriteLine(string.Format("Message = {0}", ex.Message));

Console.WriteLine("Request completed...");



To access to Mainfreight APIs, you have to Register

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.