Contract Shipping

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

Get Groups – SOAP

Summary

Name: Get Groups
Reason to Call:

To confirm the full list of groups eligible for use in a Transmit Shipments request.

Input:

Mailed-by; locale (optional)

Output:

List of group IDs

Error Example:

Invalid mailed-on-behalf-of customer

Typical Next Call: Transmit Shipments, Get Shipments
Version history: Release notes
Get Groups – Summary of Service

Get Groups – Summary of Service

Call Details

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

SOAP Body

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

Get Groups – Request Elements
Element Name Type Required / Optional Description

get-groups-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.

Request – XML Diagram

Get Groups – Structure of the XML Request

Get Groups – Structure of the XML Request

Response Details

Response – Elements

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

Get Groups – Response Elements
Element Name Type Description

get-groups-response

complex

The top level XML element for the response.

It will either contain the results of a successful completion or the error structure.

groups

complex

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

group-id

simple

May occur 0 .. N times

This is the name of the group specified by your system in a prior Create Shipment call. Groups may be empty of shipments due to a prior Transmit Shipments call since they can persist for up to 24 hours while empty.

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

Response – XML Diagram

Get Groups – Structure of the XML Response

Get Groups – 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 Groups

<get-groups-request>
<mailed-by>1111111</mailed-by>
<locale>EN</locale>
</get-groups-request>

Sample SOAP XML Response – Get Groups

<get-groups-response>
<groups>
<group-id>123456</group-id>
</groups>
</get-groups-response>