Non-Contract Shipping

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

Get Non-Contract Shipment Details – REST

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

Request Details

Request – Structure for Get Non-Contract Shipment Details

Endpoint

POST https://XX/rs/{mailed by customer}/ncshipment/{shipment id}/details

Replace... With...

XX (Development)

ct.soa-gw.canadapost.ca

XX (Production)

soa-gw.canadapost.ca

{mailed by customer}

your customer number*

{shipment id}

the appropriate shipment ID*

*The link provided by Create Non-Contract Shipment or Get Non-Contract Shipment will replace {mailed by customer} with your customer number and
{shipment id} with the appropriate shipment ID.

HTTP Headers

HTTP Header Variable

Value

Accept

application/vnd.cpc.ncshipment-v4+xml (Note: */* in place of the header value will return an error)

Content-Type

application/vnd.cpc.ncshipment-v4+xml (Note: */* in place of the header value will return an error)

Authorization

Basic {Base64 encoding of userid:password}

Accept-language

en-CA or fr-CA

Body

None

Request – Elements

The Get Non-Contract Shipment Details service does not require any input XML data.

Response Details

Response – Elements

The following table describes the XML fields in the response to Get Non-Contract Shipment Details.

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

non-contract-shipment-details

Complex

The top level element of the XML response structure.

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

Errors are not expected for invocation of this link provided by Create Non-Contract Shipment or Get Non-Contract Shipment. However, for general error responses see HTTP status codes.

Examples

Sample REST XML Request – Get Non-Contract Shipment Details

There is no XML related to this REST request. Use the link provided by a prior request or see the soapUI project files for request examples.

Sample REST XML Response – Get Non-Contract Shipment Details

<non-contract-shipment-details>
<final-shipping-point>J4W4T0</final-shipping-point>
<tracking-pin>11111118901234</tracking-pin>
<delivery-spec>
<service-code>DOM.EP</service-code>
<sender>
<company>Canada Post Corporation</company>
<contact-phone>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 Doe</name>
<company>Consumer</company>
<address-details>
<address-line-1>2701 Receiver Drive</address-line-1>
<city>Ottawa</city>
<prov-state>ON</prov-state>
<country-code>CA</country-code>
<postal-zip-code>K1A0B1</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>