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

Get Pickup Availability – REST


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

Request Details

Request – Structure for Get Pickup Availability


GET https://XX/ad/pickup/pickupavailability/{postal code}

Replace... With...

XX (Development)


XX (Production)


{postal code}

the Postal Code of the desired Post Office

HTTP Headers

HTTP Header Variable



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


Basic {Base64 encoding of userid:password}


en-CA or fr-CA



Request – Elements

The Postal Code is the only parameter required or allowed for the Get Pickup Availability service, as shown below.

Get Pickup Availability – REST – Request Parameters
Type of

{postal code}

Directly embedded
in URI

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.

The {postal code} is embedded in the URI as follows:

XX/ad/pickup/pickupavailability/{postal code}

Response Details

Response – Elements

Only simple types of response elements are shown in the table below. For complex types, see the diagram.

Get Pickup Availability – REST – Detailed View of Response Elements
Tag/Label Description/Format


The top level XML element of the response structure.


Full Postal Code

7 character postal code in valid postal code format,
(i.e. all capitalized and including an embedded space).

i.e. A9A 9A9.


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 other than Priority Worldwide.

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


true | false

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


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 Priority Worldwide parcels.

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


true | false

Indicates whether scheduled pickups are available to this postal code.

Response – Possible Error Responses

A correctly structured request may receive one of the following application error responses:

Code Message


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


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


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. 

Response – XML Diagram

Diagram of XML Response to Get Pickup Availability

Figure 2: Diagram of XML Response to Get Pickup Availability


Sample REST XML Request – Get Pickup Availability

GET https://XX/ad/pickup/pickupavailability/K2B8J6

Sample REST XML Response – Get Pickup Availability

<postal-code>K2B 8J6</postal-code>

Example error response