Non-Contract Shipping

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

Get Non-Contract Shipment Receipt – SOAP

Summary

Name: Get Non-Contract Shipment Receipt
Reason to Call: This call is used to get the label charges and settlement information in XML format. The data in the response can be formatted to print a credit card receipt.
Input: Shipment Id
Output: XML receipt details
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: GetNonContractShipmentReceipt

SOAP Body

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

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

get-non-contract-shipment-receipt-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 Receipt – Structure of XML Request

Get Non-Contract Shipment Receipt – Structure of XML Request

Response Details

Response – Elements

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

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

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

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 shipment is to be dropped off.

shipping-point-name

simple

This is the descriptive name of the shipping point.

shipping-point-id

simple

This is the Canada Post identification number of the shipping point.

mailed-by-customer

simple

This is the 10-digit customer number of the mailed by customer.

cc-receipt-details

complex

This structure contains details required for a credit card receipt.

merchant-name

simple

Will have the value: “Canada Post”

merchant-url

simple

Will have the value: “www.canadapost.ca”

name-on-card

simple

The name on the default credit card stored by Canada Post.

auth-code

simple

The authorization code received from the credit card issuer.

auth-timestamp

simple

Date and time that the authorization was obtained.
The date and time are specified in standard XML date/time 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
  • mm indicates the minute
  • ss indicates the second

card-type

simple

The type of card used for the purchase.

Must have one of the following values:
- MC
- VIS
- AME

charge-amount

simple

The total amount charged to the credit card for the shipping service / label.

currency

simple

The currency of the transaction: CAD

transaction-type

simple

The type of credit card transaction: Sale

service-code

simple

This is the Canada Post delivery service used for shipping the item.

May be any of:

Service-Code Description
Domestic
DOM.RP Regular Parcel
DOM.EP Expedited Parcel
DOM.XP Xpresspost
DOM.PC Priority
USA
USA.XP Xpresspost USA
USA.EP Expedited Parcel USA
USA.SP.AIR Small Packet USA Air
USA.SP.SURF Small Packet USA Surface
International
INT.XP Xpresspost International
INT.SP.AIR Small Packet International Air
INT.SP.SURF Small Packet International Surface

This identifies the delivery service-code used for delivery of the shipment.

base-amount

simple

This is the base amount cost for shipping in $CAD.

priced-options

complex

This structure contains the list of options applied to this shipment and the associated price impact.

This will be absent if there are no options applied to the price of this shipment.

priced-option

complex

May occur 1 … N times.

Each occurrence is a structure that represents a shipping option that applies to the shipment, and which may affect the price of the shipment.

option-code

simple

This is the option code for an option applied to this shipment.

Option code examples are as follows
COD – Collect on delivery
COV – Insurance coverage
CYL – Mailing tube
DC – Delivery confirmation
PA18 – Proof of age 18 years
PA19 – Proof of age 19 years
SO – Signature option
UP – Unpackaged

option-price

simple

This is the total component of the price that is attributable to the option. Units are $CAD.

adjustments

complex

This structure contains the list of adjustments applied to this shipment and the associated price impact.

This will be absent if there are no adjustments applied to the price of this shipment.

adjustment

complex

May occur 1 … N times.

This structure represents a shipping adjustment that applies to the shipment, and which may affect the price of the shipment.

adjustment-code

simple

This is the adjustment code indicating which adjustment is applied to this shipment.

adjustment-amount

This is the total cost attributable to the adjustment.

pre-tax-amount

simple

This is the pre-tax total amount of the shipment cost.

gst-amount

simple

This is the amount of the GST added to the base cost.

pst-amount

simple

This is the amount of the PST added to the base cost.

hst-amount

simple

This is the amount of the HST added to the base cost.

service-standard

complex

This structure represents the service standard to which this shipment will be delivered.

am-delivery

simple

{true, false}

This indicates whether morning delivery is part of the service standard.

guaranteed-delivery

simple

{true, false}

This indicates whether guaranteed delivery is part of the service standard.

expected-transit-time

simple

This indicates the number of days the package is expected to be in the mail stream from induction to delivery.

expected-delivery-date

simple

This indicates the estimated delivery date based from the creation date of the shipment or the expected mailing date provided in the “create” request if greater.

rated-weight

simple

This indicates the actual weight or volumetric equivalent used to determine the base price, within the prescribed weight and size limits of the specific product, on the greater of Canada Post’s calculation and your declaration.

Response – XML Diagram

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

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

Sample SOAP XML Response – Get Non-Contract Shipment Receipt

<get-non-contract-shipment-receipt-response>
<non-contract-shipment-receipt>
<final-shipping-point>K1A0B1</final-shipping-point>
<shipping-point-name>CANADA POST PLACE PO #1</shipping-point-name>
<shipping-point-id>2011</shipping-point-id>
<mailed-by-customer>0003798235</mailed-by-customer>
<service-code>DOM.EP</service-code>
<rated-weight>15.000</rated-weight>
<base-amount>16.38</base-amount>
<pre-tax-amount>17.16</pre-tax-amount>
<gst-amount>0.00</gst-amount>
<pst-amount>0.00</pst-amount>
<hst-amount>2.23</hst-amount>
<priced-options>
<priced-option>
<option-code>DC</option-code>
<option-price>0</option-price>
</priced-option>
</priced-options>
<adjustments>
<adjustment>
<adjustment-code>AUTDISC</adjustment-code>
<adjustment-amount>-0.49</adjustment-amount>
</adjustment>
<adjustment>
<adjustment-code>FUELSC</adjustment-code>
<adjustment-amount>1.27</adjustment-amount>
</adjustment>
</adjustments>
<cc-receipt-details>
<merchant-name>Canada Post</merchant-name>
<merchant-url>www.canadapost.ca</merchant-url>
<name-on-card>John Doe</name-on-card>
<auth-code>454819</auth-code>
<auth-timestamp>2012-04-15T12:17:16-04:00</auth-timestamp>
<card-type>MC</card-type>
<charge-amount>19.39</charge-amount>
<currency>CAD</currency>
<transaction-type>Sale</transaction-type>
</cc-receipt-details>
<service-standard>
<am-delivery>false</am-delivery>
<guaranteed-delivery>true</guaranteed-delivery>
<expected-transit-time>1</expected-transit-time>
<expected-delivery-date>2012-04-17</expected-delivery-date>
</service-standard>
</non-contract-shipment-receipt>
</get-non-contract-shipment-receipt-response>