Rating

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

Get Option – SOAP

Summary

Name: Get Option
Reason to Call: Used to retrieve details of a given option.
Input: Option code
Output: Option description, prerequisites and conflicts
Typical prior call: Get Service
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: GetOption

SOAP Body

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

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

get-option-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.

option-code

simple

required

Code associated with the option.
Alphanumeric string of up to 10 letters/digits.

Request – XML Diagram

Get Option – Structure of the XML Request

Get Option – Structure of the XML Request

Response Details

Response – Elements

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

Get Option – Response Elements
Element Name type Description

get-option-request

complex

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

option

complex

Structure containing the option and its attributes.

option-code

simple

The code for the shipping option whose attributes are being detailed.

option-name

simple

The full name of the option in the language you requested.

option-class

simple

FEAT | DI | NDI

FEAT indicates that this option is a service feature.
DI indicates that this is a delivery instruction.
NDI indicates that this is an instruction in the case of unsuccessful delivery.

prints-on-label

simple

True | False
Indicates that evidence of this option selection is printed on the label.

qualifier-required

simple

True | False
True indicates that when this option is used in a rate request or when creating a shipment, a qualifier for the option is required.

conflicting-options

complex

List of codes that cannot occur when this option is used.

option-code

simple

An option that is mutually exclusive with the option specified in the option request.

prerequisite-options

complex

List of codes that are required to support this option.

option-code

simple

An option that must also be selected when the option specified in the option request is selected.

Response XML Diagram

Get Option – Structure of the XML Response

Get Option – 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 Option

<get-option-request>
<locale>EN</locale>
<option-code>D2PO</option-code>
</get-option-request>

Sample SOAP XML Response – Get Option

<get-option-response>
<option>
<option-code>D2PO</option-code>
<option-name>Deliver to Post Office</option-name>
<option-class>DI</option-class>
<prints-on-label>true</prints-on-label>
<qualifier-required>true</qualifier-required>
<conflicting-options>
<option-code>HFP</option-code>
<option-code>DNS</option-code>
<option-code>COD</option-code>
<option-code>LAD</option-code>
</conflicting-options>
</option>
</get-option-response>