Rating
Discover Services – SOAP
Summary
Name: | Discover Services |
---|---|
Reason to Call: | To discover the list of postal services that can be used for a given destination country, customer, contract, origin and/or destination postal code. |
Input: | Destination Country |
Output: | Option descriptions, prerequisites and conflicts |
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: | DiscoverServices |
SOAP Body
This section describes the XML input elements to this service. For the hierarchical structure, see the XML diagram.
Discover Services – Request Elements | |||
---|---|---|---|
Element Name | Type | Required / Optional | Description |
discover-services-request |
complex |
required |
The top level XML element for the request input information. |
locale |
simple |
optional |
Indicates your language preference for receiving error messages. |
destination-country-code |
simple |
optional |
The 2-character country code representing the destination country for which available services are requested. |
customer-number | simple | optional | (1-10 digit numeric) |
contract-id | simple | optional | (1-10-digit numeric) |
Request – XML Diagram
Response Details
Response – Elements
The following table describes the XML elements in the response to Discover Services. For the hierarchy of the response, see the
XML diagram.
Discover Services – Response Elements | ||
---|---|---|
Element Name | Type | Description |
discover-services-response |
complex |
The top level XML element for the response. |
services |
complex |
Contains the list of shipping services that can be used for the specified parameters. |
service |
complex |
Contains information about a single Canada Post shipping service. |
service-code |
simple |
The code used to request the service. |
service-name |
simple |
The full name of the shipping service in the language you requested. |
Response – XML Diagram
Response – Possible Error Responses
Code | Description |
---|---|
2550 |
The contract number is not valid. |
7266 | Postal Code must be in format A9A or A9A9A9. |
8534 | A valid destination country must be supplied. |
9194 | origin-postal-code must also be provided when destination-postal-code is provided. |
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 – Discover Services
<discover-services-request>
<locale>EN</locale>
<destination-country-code>GB</destination-country-code>
</discover-services-request>
Sample SOAP XML Response – Discover Services
<discover-services-response>
<services>
<service>
<service-code>INT.XP</service-code>
<service-name>Xpresspost International</service-name>
</service>
<service>
<service-code>INT.SP.SURF</service-code>
<service-name>Small Packet International Surface</service-name>
</service>
<service>
<service-code>INT.SP.AIR</service-code>
<service-name>Small Packet International Air</service-name>
</service>
</services>
</discover-services-response>