Non-Contract Shipping

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

Get Non-Contract Shipments – SOAP

Summary

Name: Get Non-Contract Shipments
Reason to Call: To search for recently created non-contract shipments for the purpose of recovery or re-print.
Input: From and to dates and times or tracking PIN
Output:

Shipment-ids for shipments within the date/time range

Typical Next Call: Get 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: GetNonContractShipments

SOAP Body

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

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

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

from

simple

conditionally required

The start date/time of the range for which non-contract shipments are sought. Use xsd dateTime format (YYYY-MM-DDTHH:MM:SS) where:

  • YYYY indicates the year
  • MM indicates the month
  • DD indicates the day
  • T indicates the start of the required time section
  • hh indicates the hour (in 24-hr format)
  • mm indicates the minute
  • ss indicates the second

Example:
2012-02-30T09:00:00

All dates and times are in the Eastern Time Zone. If the to date/time is not provided, it defaults to the current date/time.

Mutually exclusive with tracking-pin

to

simple

optional

The end date/time of the range of date/time for which for which non-contract shipments are sought. Use xsd dateTime format (YYYY-MM-DDTHH:MM:SS) where:

  • YYYY indicates the year
  • MM indicates the month
  • DD indicates the day
  • T indicates the start of the required time section
  • hh indicates the hour (in 24-hr format)
  • mm indicates the minute
  • ss indicates the second

All dates and times are in the Eastern Time Zone. If the to date/time is not provided, it defaults to the current date/time.

tracking-pin

simple

conditionally required

(Alphanumeric string – 11 to 16 letters/digits)

The tracking ID of the existing shipment for which information is being requested.

Mutually exclusive with “from date”.

Note: In the sandbox (development) environment, the same tracking PIN is always returned (123456789012), so this query would not return representative results in that environment.

Request – XML Diagram

Get Non-Contract Shipments – Structure of the XML Request

Get Non-Contract Shipments – Structure of the XML Request

Response Details

Response – Elements

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

Get Non-Contract Shipments – Response Elements
Element Name Type Description

get-non-contract-shipments-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-shipments

complex

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

shipment-id

simple

The set of shipment-ids for the shipments that fall within the date/time range specified.

May occur 0 .. N times

Response – XML Diagram

Get Non-Contract Shipments – Structure of the XML Response

Get Non-Contract Shipments – 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.

Possible error messages include:

Code Message
9105 A required parameter was not provided in the request.
9116 The "from" date cannot be a later date than the "to" date.
9196 Only one of from (date) and tracking PIN must be provided.

Examples

Sample SOAP XML Request – Get Non-Contract Shipments

<get-non-contract-shipments-request>
<mailed-by>1111111</mailed-by>
<locale>EN</locale>
<from>2012-01-10T13:06:07</from>
</get-non-contract-shipments-request>

Sample SOAP XML Response – Get Non-Contract Shipments

<get-non-contract-shipments-response>
<non-contract-shipments>
<shipment-id>406951321983787352</shipment-id>
</non-contract-shipments>
</get-non-contract-shipments-response>