Pickup

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

Get Pickup Availability – SOAP

Summary

Name: Get Pickup Availability
Reason to Call: To retrieve information on pickup availability and cut-off times available based on pickup location
Input: Postal Code
Output: true / false for pickup available, cut-off times
Error Examples: Invalid Postal Code
Version history: Release notes

Call Details

WSDL: pickup.wsdl
Endpoint (Development): https://ct.soa-gw.canadapost.ca/ad/soap/pickup/availability
Endpoint (Production): https://soa-gw.canadapost.ca/ad/soap/pickup/availability
Namespace: http://www.canadapost.ca/ws/soap/pickup/availability
Operation: GetPickupAvailability

SOAP Body

Get Pickup Availability – Request Elements
Element Name Type Required / Optional Description

get-pickup-availability-request

complex

required

The top level XML element for the request input information.

postal-code

simple

required

Full Postal Code
6-character Postal Code in valid Postal Code format, e.g. A9A9A9

Note: If you wish to use Postal Codes with an embedded space (e.g. A9A 9A9), you must convert these spaces to %20 in your code before passing the value to the web service.

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 Pickup Availability – Structure of the XML Request

Get Pickup Availability – Structure of the XML Request

Response Details

Response – Elements

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

Get Pickup Availability – Response Elements

Element Name

Type

Description

get-pickup-availability-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.

postal-code

simple

Full Postal Code

7 character postal code in valid postal code format

(i.e. all capitalized and including an embedded space).

on-demand-cutoff

simple

Time nn:nn (24 hour clock) expressed in local time of the specified postal code.

Indicates the latest time that a pickup can be requested for the same day for parcels.

Will be empty if on-demand-tour is false.

on-demand-tour

simple

true | false

Indicates whether on demand pickups can be requested for the specific area.

scheduled-pickups-available

simple

true | false

Indicates whether scheduled pickups are available to this postal code.

Response – XML Diagram

Get Pickup Availability – Structure of the XML Response

Get Pickup Availability – 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:

Code Message

No_PostalCode_Provided

This is returned when a blank Postal Code is provided in the request.

Invalid_PostalCode_format

This is returned when the Postal Code provided does not pass a basic format check.

(Note: the basic format check only confirms that there is a valid number of characters.)

No_Record_Found

This is returned when the system is unable to find information on the Postal Code that was provided. The most likely cause of this error is that an invalid Postal Code was provided.

Examples

Sample SOAP XML Request – Get Pickup Availability

<get-pickup-availability-request>
<locale>EN</locale>
<postal-code>K2B8J6</postal-code>
</get-pickup-availability-request>

Sample SOAP XML Response – Get Pickup Availability

<get-pickup-availability-response>
<pickup-availability>
<postal-code>K2B 8J6</postal-code>
<on-demand-cutoff>16:00</on-demand-cutoff>
<on-demand-tour>true</on-demand-tour>
<scheduled-pickups-available>true</scheduled-pickups-available>
</pickup-availability>
</get-pickup-availability-response>