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:
Optional step: Call a service to retrieve a list of standard parcel sizes available for purchase at Australia Post retail outlets.
The Postage Assessment Calculation API requests follow a consistent pattern
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.
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).
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.
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