Rating

Code Samples for Rating: Java (.zip) | PHP (.zip) | C# (.zip)

Get Service – SOAP

Summary

Name: Get Service
Reason to Call: To find out details for a given postal service such as the dimension and weight limits and the available options.
Input: Service with optional country
Output: Service description, options and restrictions
Typical Prior Call: Get Rates, Discover Services
Version history: Release notes

Call Details

WSDL: rating.wsdl
Endpoint (Development): https://ct.soa-gw.canadapost.ca/rs/soap/rating/v4
Endpoint (Production): https://soa-gw.canadapost.ca/rs/soap/rating/v4
Namespace: http://www.canadapost.ca/ws/soap/ship/rate/v4
Operation: GetService

SOAP Body

This section describes the XML input elements to this service. For the hierarchical structure, see the XML diagram.

Get Service – Request Elements
Element Name Type Required / Optional Description

get-service-request

complex

required

The top level XML element for the request input information.

locale

simple

optional

Indicates your language preference for receiving error messages.

EN = English
FR = French

If no value is provided, the default language is English.

service-code

simple

required

The service identifier for the shipping service.

Alphanumeric string of up to 10 letters/digits.

destination-country-code

simple

optional

The 2-character country code representing the destination country.

This parameter will fine tune the options available for the shipping service you specified above in service-code. For example, some countries support the signature option for Xpresspost™-International and some do not.

Note: we do not validate whether the shipping service you specified is a valid service for the country you provide. Therefore, even if the service is not offered for the country you specify, a list of the default options will still be returned.

Request – XML Diagram

Get Service – Structure of the XML Request

Get Service – Structure of the XML Request

Response Details

Response – Elements

The following table describes the XML elements in the response to Get Service. For the hierarchy of the response, see the XML diagram.

Get Service – Response Elements
Element Name Type Description

get-service-response

complex

The top level XML element for the response.
It will either contain the results of a successful completion or the error message structure.

service

complex

The structure that contains all of the information regarding the service that was requested.

service-code

simple

Service identifier.

service-name

simple

Description of service in the language of choice.

comment

simple

Coverage message stating the maximum amount of coverage included with this service (which can be none); only returned on a few U.S. and international services where additional coverage cannot be purchased.

Only applicable to schema version 2 and higher.

options

complex

List of options available/applicable to this service.

option

complex

One specific option.

option-name

simple

Option name in language of choice.

option-code

simple

The code used to select the option in Get Rates or Create Shipment

mandatory

simple

True | False

Indicates whether this option is mandatory for the service.

qualifier-required

simple

True | False

True indicates that this option if selected must include a qualifier on the option. This is true for insurance (COV) and collect on delivery (COD) options.

qualifier-max

simple

Numeric – indicates the maximum value of the qualifier for this service. The maximum value of a qualifier may differ between services. This is specific to the insurance (COV) option.

restrictions

complex

Details the weight and size restrictions of parcels shipped via this service.

weight-restriction

complex

Details the weight restrictions of items shipped via this service.

min

attribute on weight-restriction

Minimum weight in grams.

max

attribute on weight-restriction

Maximum weight in grams that can be sent using this service.

dimensional-restrictions

complex

Details the dimension restrictions of items shipped via this service

length

complex

Specifies the dimension range of the longest dimension of an item in cm.

width

complex

Specifies the dimension range of the second longest dimension of an item in cm.

height

complex

Specifies the dimension range of the shortest dimension of an item in cm.

min

attribute on length, width and height

Minimum measurement in centimetres allowed for the dimension.

max

attribute on length, width and height

Maximum measurement in centimetres allowed for the dimension.

length-plus-girth-max

simple

Maximum calculated value of length + 2*width + 2*height in cm.

length-height-width-sum-max

simple

Maximum value of length + width + height in cm.

oversize-limit

simple

If any dimension exceeds this limit an oversize fee will apply to the shipment (cm).

density-factor

simple

Standard density factor used to calculate volumetric equivalent of actual weight (VE).
Note: Canada Post can use another factor to calculate the volumetric equivalent, depending on your parcels agreement.

can-ship-in-mailing-tube

simple

True | False

True indicates that parcels shipped with this service can be shipped in a mailing tube (option CYL can be used).

can-ship-unpackaged

simple

True | False

True indicates that parcels shipped with this service can be shipped unpackaged (option UP can be used).

allowed-as-return-service

simple

True | False

True indicates that this service can be used to generate a return label.

Response – XML Diagram

Get Service – Structure of the XML Response
Get Service – Structure of the XML Response

Response – Possible Error Responses

The response to error conditions for this web service follows the standard SOAP error response approach used for all Canada Post web services. For more information, see SOAP Fundamentals of Canada Post Web Services.

Examples

Sample SOAP XML Request – Get Service

<get-service-request>
<locale>EN</locale>
<service-code>INT.XP</service-code>
<destination-country-code>AU</destination-country-code>
</get-service-request>

Sample SOAP XML Response – Get Service

<get-service-response>
<service>
<service-code>INT.XP</service-code>
<service-name>Xpresspost International</service-name>
<options>
<option>
<option-code>COV</option-code>
<option-name>Coverage</option-name>
<mandatory>false</mandatory>
<qualifier-required>true</qualifier-required>
<qualifier-max>1000</qualifier-max>
</option>
<option>
<option-code>DC</option-code>
<option-name>Delivery confirmation</option-name>
<mandatory>true</mandatory>
<qualifier-required>false</qualifier-required>
</option>
<option>
<option-code>RASE</option-code>
<option-name>Return at sender's expense</option-name>
<mandatory>true</mandatory>
<qualifier-required>false</qualifier-required>
</option>
</options>
<restrictions>
<weight-restrictionmin="0"max="20000"></weight-restriction>
<dimensional-restrictions>
<lengthmin="0.1"max="100"></length>
<widthmin="0.1"max="100"></width>
<heightmin="0.1"max="100"></height>
<length-plus-girth-max>200</length-plus-girth-max>
<oversize-limit>100</oversize-limit>
</dimensional-restrictions>
<density-factor>6000</density-factor>
<can-ship-in-mailing-tube>true</can-ship-in-mailing-tube>
<can-ship-unpackaged>false</can-ship-unpackaged>
<allowed-as-return-service>false</allowed-as-return-service>
</restrictions>
</service>
</get-service-response>