Non-Contract Shipping

Code Samples for Non-Contract Shipping: Java (.zip) | PHP (.zip) | C# (.zip)

Get Non-Contract Shipment Details – SOAP

Summary

Name: Get Non-Contract Shipment Details
Reason to Call: This call is used to get details about a shipment including system generated fields such as tracking number.
Input: Shipment ID
Output: XML details of the shipment
Typical Prior Call: Create Non-Contract Shipment or Get Non-Contract Shipment
Typical Next Call: Get Artifact or Create Non-Contract Shipment
Version history: Release notes

Call Details

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

SOAP Body

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

Get Non-Contract Shipment Details – Request Elements
Element Name Type Required / Optional Description

get-non-contract-shipment-details-request

complex

required

The top level XML element for the request input information.

mailed-by

simple

required

(1-10 digit numeric)

The 10-digit customer number of the mailed-by customer.

If the number provided has fewer than 10 digits, the system will add leading zeros.

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.

shipment-id

simple

required

(Alphanumeric String – up to 32 letters/digits)

An identification number representing the existing shipment for which information is being requested.

Note: Retrieve the shipment-id provided by previous calls to Create Non-Contract Shipment or Get Non-Contract Shipment. The output of those services will include a shipment-id element.

Request – XML Diagram

Get Non-Contract Shipment Details – Structure of the XML Request

Get Non-Contract Shipment Details – Structure of the XML Request

Response Details

Response – Elements

The following table describes the XML elements in the response to Get Non-Contract Shipment Details. For the hierarchy of the response, see the XML diagram.

Get Non-Contract Shipment Details – Response Elements
Element Name Type Description

get-non-contract-shipment-details-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.

non-contract-shipment-details

complex

The XML structure containing the results of a successful completion of the service.

final-shipping-point

simple

This is the Postal Code of the Post Office where the shipments are to be dropped off. Every Post Office has a unique Postal Code.

If you provide (using the requested-shipping-point element as input to Create Non-Contract Shipment) a Postal Code of a valid Post Office, then the final-shipping-point will be that value.

However, if you specified (using the requested-shipping-point element as input to Create Non-Contract Shipment) a Postal Code that was not a valid Postal Code of a Post Office, then the value of the final-shipping-point element will be generated as the Postal Code of the Canada Post outlet location that is geographically closest to the requested-shipping-point Postal Code that you provided.

tracking-pin

simple

This is the tracking PIN for the shipment. The tracking PIN can be used as input to other web service calls such as Get Tracking Details.

destination

Complex

This element contains either one of the following:

  • The address of the mail recipient (for regular shipments)
  • The address of the Post Office where the shipment will be delivered to (for shipments sent using the Deliver to Post Office option)

recipient

Complex

This element appears in the response only if you selected the Deliver to Post Office (D2PO) option when you created the shipment. It contains the mail recipient’s address that you provided in the destination element in your request.

delivery-spec

complex

Complex element containing all of the data that was used to create the shipment.

The elements within delivery-spec have the same structure and values as those you provided in the Create Non-Contract Shipment request. See Create Non-Contract Shipment Request Elements and Request XML diagram.

refund-request-info

Complex

This structure is present only if a refund request was submitted for this shipment.

service-ticket-date

Simple

Date when the refund request was submitted.

service-ticket-id

Simple

Service ticket ID number assigned to the refund request. Please use this number in any communications with Canada Post about the refund request.

Response – XML Diagram

Get Non-Contract Shipment Details – Structure of the XML Response
Get Non-Contract Shipment Details – 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 Non-Contract Shipment Details

<get-non-contract-shipment-details-request>
<mailed-by>1111111</mailed-by>
<locale>EN</locale>
<shipment-id>406951321983787352</shipment-id>
</get-non-contract-shipment-details-request>

Sample SOAP XML Response – Get Non-Contract Shipment Details

<get-non-contract-shipment-details-response>
<non-contract-shipment-details>
<final-shipping-point>K1A0B1</final-shipping-point>
<tracking-pin>11111118901234</tracking-pin>
<delivery-spec>
<service-code>DOM.EP</service-code>
<sender>
<company>Canada Post Corporation</company>
<contact-phone>1-555-555-5555</contact-phone>
<address-details>
<address-line-1>2701 Riverside Drive</address-line-1>
<city>Ottawa</city>
<prov-state>ON</prov-state>
<postal-zip-code>K1A0B1</postal-zip-code>
</address-details>
</sender>
<destination>
<name>John Smith</name>
<company>12345678 Ont. Limited</company>
<address-details>
<address-line-1>123 Any Street</address-line-1>
<city>Ottawa</city>
<prov-state>ON</prov-state>
<country-code>CA</country-code>
<postal-zip-code>K1K4T3</postal-zip-code>
</address-details>
</destination>
<options>
<option>
<option-code>DC</option-code>
</option>
</options>
<parcel-characteristics>
<weight>15.000</weight>
<dimensions>
<length>1</length>
<width>1</width>
<height>1</height>
</dimensions>
<document>false</document>
<unpackaged>false</unpackaged>
<mailing-tube>false</mailing-tube>
</parcel-characteristics>
<preferences>
<show-packing-instructions>true</show-packing-instructions>
<show-postage-rate>false</show-postage-rate>
<show-insured-value>false</show-insured-value>
</preferences>
</delivery-spec>
</non-contract-shipment-details>
</get-non-contract-shipment-details-response>