Contract Shipping

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

Transmit Shipments – SOAP

Summary

Name: Transmit Shipments
Reason to Call: Used when one or more groups of shipments is ready for pickup by Canada Post or drop-off to a Canada Post location. This can be used for shipments belonging to any customer who has a contract.
Input:

The inputs include:

  • the mailed-on-behalf-of customer number
  • the list of groups that are ready for pickup/drop-off
  • the pickup or deposit location for your shipments
  • the method of payment
  • an optional list of shipments to be excluded from the pickup
Output:

The output is a set of manifest ID numbers. You must use these numbers to call the Get Manifest service to successfully create a manifest.

Error Example: Group does not exist.
Typical Prior Call: Create Shipment
Typical Next Call: Get Manifest
Version history: Release notes
Transmit Shipments – Summary of Service

Transmit Shipments – Summary of Service

Call Details

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

SOAP Body

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

Transmit Shipments – Request Elements
Element Name Type Required / Optional Description

transmit-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.

mobo

simple

optional

(1-10 digit numeric)

The 10-digit customer number of the mailed-on-behalf-of customer.

If this element is missing, it will default to the mailed-by customer number.

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.

transmit-set

complex

required

The XML element/structure containing the input information for a shipment.

customer-request-id

Simple

Optional

For Future Use.

group-ids

complex

required

This is a list of group-ids. The Transmit Shipments service will create a manifest for each group. The manifest will list the shipments included in the group (with the exception of shipments you exclude).

group-id

simple

required

(Character String – up to 32 characters)

May occur 1 … N times.

The Group ID of any group, whose shipments are to be included in the Transmit Shipments action.

The purpose of a group-id is to group several shipments together to include on the same manifest. For example, grouping is useful in the following scenarios:

  • You have multiple fulfillment locations.
  • You want all shipments in a group to be shipped on the same day.
  • You want to group shipments together for internal reference or billing purposes.

Note: domestic, U.S., and international shipments will be placed on separate manifests even if they contain the same group-id.

Performance limitations
To avoid a timeout of our servers, please follow these recommendations:

  • Do not include more than 30 groups per manifest (i.e., maximum of 30 group-ids in one Transmit Shipments request.)
  • Do not put more than 5,000 shipments in one group.

System limitations
To avoid an error, please do not exceed the following limits before performing a Transmit Shipments call:

  • Maximum of 50 groups per manifest (error 9109 if exceeded).
  • Maximum of 10,000 shipments in one group (error 9110 if exceeded).
  • Maximum of 10,000 shipments across multiple groups (error 9108 if exceeded).

requested-shipping-point

Simple

Required

(6-character alphanumeric string)

Must be in valid Postal Code format

e.g. A9A9A9

Pattern is [A-Z]\d[A-Z]\d[A-Z]\d

If you deposit your shipments yourself, you have 2 choices:

  • Omit this element and provide the site number of your deposit location in shipping-point-id. (recommended), or
  • Provide the postal code of your deposit location here and omit shipping-point-id.

Note: Using requested-shipping-point to indicate your deposit location postal code will be discontinued in a future release. If you deposit your shipments yourself, we recommend using the shipping-point-id element.

Mandatory when cpc-pickup-indicator is provided.

Mutually exclusive with shipping-point-id, but one of the two must be provided.

If you provide the same Postal Code here that you used in your Create Shipment requests, then there will be no pricing adjustments related to the starting point for shipping. If you use a different Postal Code here than in Create Shipment, it may result in a pricing adjustment depending on the distance between the original shipping point (in the Create Shipment request) and the final shipping point (in the Transmit Shipments) request.

cpc-pickup-indicator

Simple

Optional

(true)

Set this element to true if your shipments are picked up by Canada Post or a third party. Do not provide this element when false. Provide the Postal Code of your pickup location in requested-shipping-point. If you use the same indicator and requested-shipping-point as you did in Create Shipment, there will be no pricing adjustment; see details in requested-shipping-point.

Omit this element if you deposit your shipments yourself.

Mutually exclusive with shipping-point-id.

Note: In a future release it will become mandatory to explicitly identify whether your shipment is picked up by Canada Post (by providing both this indicator and requested-shipping-point) or deposited at a Canada Post site (by providing shipping-point-id).

We recommend preparing for this change by providing this indicator (and requested-shipping-point) if your shipment is picked up by Canada Post.

shipping-point-id

Simple

Conditionally required

(4-character alphanumeric string)

If you deposit your items at a Post Office or other Canada Post facility, provide the site number of the deposit location. Look up the site number using Find a Deposit Location. This information is used for pricing.

If you enter a different site number than you provided in your Create Shipment request, pricing may be affected.

Mutually exclusive with requested-shipping-point but one of the two must be provided.

Note: If you deposit your items yourself, we recommend using this element rather than the requested-shipping-point element to indicate your deposit location.

detailed-manifests

simple

required

{true,false}

This indicates whether a full detailed manifest document will be rendered, or a summarized manifest document will be rendered.

method-of-payment

simple

required

{15-character string}

This indicates what the method of payment is for the manifests that are to be generated.

Valid methods of payment are as follows:

  • Account = the payment will be via an existing contract with the paid-by-customer.
  • CreditCard = the payment will be made by credit card.
  • SupplierAccount = the payment will be through the Supplier Account identified as default in the customer profile (only available to Supplier Account providers).

Note: Different shipments may have different paid-by-customers. Separate manifests will be generated for shipments with different paid-by-customers.

manifest-address

complex

required

This structure contains the address that is printed on the manifest label.

manifest-name

simple

optional

(Character String up to 44 characters)

Contact name for the manifest address

This is printed on the manifest document.

phone-number

simple

required

(Character String – up to 32 characters)

Phone number to be printed on the manifest.

address-details

complex

required

This structure contains the address details for the manifest address. The address is printed on the manifest document.

address-line-1

simple

required

(Character String up to 44 characters)

Address line 1 for the manifest address.

address-line-2

simple

optional

(Character String up to 44 characters)

Address line 2 for the manifest address.

city

simple

required

(Character String up to 40 characters)

City for the manifest address.

prov-state

simple

required

(Character String up to 20 characters)

Province (or state) for the manifest address.

country-code

Simple

Conditionally
Required

(2-character string)

Country code for the manifest address; CA and US are accepted.

Required if US. Optional if CA.

postal-zip-code

simple

required

Postal (or zip) code for the manifest address. Can be one of the following:

  1. 6-character alphanumeric for Canada (A9A9A9)
    Pattern is [A-Z]\d[A-Z]\d[A-Z]\d

  2. 5-digit or 5-4 digit numeric code for U.S.
    Pattern is \d{5}(-\d{4})?

customer-reference

simple

optional

(Alphanumeric String - up to 12 letters/digits)

A customer reference number you provide and which is placed on the manifest and returned in a Get Manifest Details request.

excluded-shipments

complex

optional

The list of shipment-ids that are to be excluded from transmission. These shipments will remain in their group and will automatically be picked up for the next transmit.

shipment-id

simple

optional

(Alphanumeric String – up to 32 letters/digits)

This is an identification number representing an existing shipment that is to be excluded from the Transmit Shipments.

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

manifest-company

simple

required

(Character String up to 44 characters)

The Company component of the manifest address.

This is printed on the manifest label.

Request – XML Diagram

Transmit Shipments – Structure of the XML Request
Transmit Shipments – Structure of the XML Request

Response Details

Response – Elements

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

Transmit Shipments – Response Elements
Element Name Type Description

transmit-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.

manifests

complex

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

manifest-id

simple

May occur 0 .. N times

The manifest identifier. It is unique within the domain of the mailed-on-behalf-of customer and is used for all other calls (Get Manifest, Get Manifest Details, Get Shipments) where a unique manifest identifier is required.

If you attempt to transmit shipments that we billed you for automatically (in cases where you inducted shipments before performing a Transmit Shipments call), you will receive a link to an empty manifest. The empty manifest informs you that you were billed automatically and provides details about how to avoid this in the future.

The empty manifest does not contain shipments or details, cannot be retrieved through Get Manifests and cannot be used to induct mail. The detailed manifest we created for you with the shipments that you were billed for automatically will be sent to the email address in your online Canada Post profile.

Response – XML Diagram

Transmit Shipments – Structure of the XML Response

Transmit 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 for this service include the following.

Code Message

7313

Supplier Account payment can only be submitted by the account provider.

7317

The issuer of the default Supplier Account in your Canada Post online profile does not match the platform you are using.

9118

Group id: "99" was not found for transmission. Please remove or correct.

9119

Shipment id: "12373264234" was not found for exclusion. Please remove or correct.

9122

All groups in the transmit request were empty or all shipments were excluded; there was nothing to transmit.

9186

Only one of shipping-point-id or cpc-pickup-indicator can be provided.

9187

requested-shipping-point is mandatory when cpc-pickup-indicator is provided.

9188

shipping-point-id is not valid.

9189

requested-shipping-point and shipping-point-id are mutually exclusive.

Examples

Sample SOAP XML Request – Transmit Shipments

<transmit-shipments-request>
<mailed-by>1111111</mailed-by>
<transmit-set>
<group-ids>
<group-id>123456</group-id>
</group-ids>
<requested-shipping-point>K1K4T3</requested-shipping-point>
<cpc-pickup-indicator>true</cpc-pickup-indicator>
<detailed-manifests>true</detailed-manifests>
<method-of-payment>Account</method-of-payment>
<manifest-address>
<manifest-company>Canada Post Corporation</manifest-company>
<phone-number>555-555-5555</phone-number>
<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>
</manifest-address>
</transmit-set>
</transmit-shipments-request>

Sample SOAP XML Response – Transmit Shipments

<transmit-shipments-response>
<manifests>
<manifest-id>347891314723499921</manifest-id>
</manifests>
</transmit-shipments-response>