{{title}}

In this tutorial, we'll learn how to calculate the postage cost for a domestic parcel delivery using the Postage Assessment Calculation API.

Create an account to access the Postage Assessment Calculation API.


The following steps will be completed:

  1. Retrieve a list of available postage services based on the dimensions, weight and destination of the item to be sent and choose a postage service
  2. Calculate the cost of sending the parcel based on the postage service chosen in step 1

Optional step: Call a service to retrieve a list of standard parcel sizes available for purchase at Australia Post retail outlets.


Authentication

The Postage Assessment Calculation API requests follow a consistent pattern


Optional Step: Retrieve Australia Post standard parcel sizes

The Domestic Parcel Size data service to lookup the standard parcel box sizes available for purchase at all Australia Post retail outlets:

The code above generates the following HTTP request:

The response contains

In the next step, you can use the dimensions returned for one of these standard box sizes, or input your own custom dimensions.


Step 1: Retrieve a list of available domestic postage services

In this step, we’ll call the the domestic parcel service to retrieve a list of available postage services that Australia Post provides for delivering a parcel.

The postage services available will be based on the input parameters you provide. For example, origin and destination postcodes in rural areas will exclude Express Post delivery options as rural postcodes are not covered by the Express post network.

Input parameters required

Note: There are maximum allowed values for the dimensions and weight parameters! You can read more about those here).

Note: this request (and all Postage Assessment API requests) are HTTP GET; parameters should be set in the query string.

The code above generates the following HTTP request:

The response contains

Choose a service code that corresponds to a postal service matching the speed, size and price requirements for your delivery. This code will be used in the next step to calculate the total delivery price for your item.

Step 2: Calculate total delivery price

In this step, we’ll call the domestic parcel calculate service to calculate the total delivery price. This call is similar to that made in step 1 but now includes the service ‘code’ you have chosen for your delivery.

Input parameters required

The code above generates the following HTTP request:

The response contains