Pickup

Get Pickup Price – REST

Summary

Name: Get Pickup Price
Reason to Call: To find out the price charged to a customer for an on-demand pickup. (Ranges from "free" for contract customers to a range of charges, depending on the number and type of parcels picked up).

Note: This service confirms a price that would be charged on a certain date.

Don't use it to confirm if pickup is available on that date.
Input:
  • Customer Number
  • Contract number, if applicable
  • Indicate if the pickup item is for Priority shipping (These items are picked up for free)
Output: Price info
Typical Prior Call: Get Pickup Availability
Typical Next Call: Create Pickup Request
Version history: Release notes

Request Details

Request – Structure for Get Pickup Price

Endpoint

POST https://XX/enab/\{customer}/pickuprequest/price

Replace... With...

XX (Development)

ct.soa-gw.canadapost.ca

XX (Production)

soa-gw.canadapost.ca

{customer}

your customer number

HTTP Headers

HTTP Header Variable

Value

Accept

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

Content-Type

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

Authorization

Basic {Base64 encoding of userid:password}

Accept-language

en-CA or fr-CA

Body

<?xml version="1.0" encoding="utf-8"?>
<pickup-request-price xmlns="http://www.canadapost.ca/ws/pickuprequest">
xxx
</pickup-request-price>

Request – Elements

The table below describes the XML input elements for Get Pickup Price. For the hierarchical structure of the inputs, see the XML diagram.

Get Pickup Price – Request Elements
Element Name Type Required/Optional Description/Size/Format

pickup-details

Complex

Required

This is the top level XML element for the request input information. Reminder: These requests are for on-demand pickups

contract-id

Simple

Optional

Your Parcels agreement number, if you have one.

(numeric – up to 10 digits)
Note: You can omit this element. It will be used in a future release.

date

Simple

Optional

Pickup date. Date format (yyyy-mm-dd).

Defaulted to today’s date.
Important: Only used to determine the price on that date; no validation is done that pickup is actually possible on that date.

priority-flag

Simple

Optional

{true}, {false}
Identifies that Priority™ items will be in the pickup request.
Defaults to false.

alternate-address-postal-code

Simple

Optional

The postal code of the address where the pickup is to be done.

Only required if the pickup is to be done at an alternate address than the business address specified in your Canada Post profile.
Format A9A9A9 or A9A 9A9.
Note: Province would be derived from this postal code when calculating taxes.

Request – XML Diagram

Get Pickup Price – Structure of the XML Request

Get Pickup Price – Structure of the XML Request

Response Details

Response – Elements

The table below describes the XML fields in the response. For the hierarchy of the response, see the XML diagram.

Get Pickup Price – Response Elements
Element Name Type Description

pickup-request-price

Complex

This is the top level XML element of the response structure.
It provides the charges for an on-demand pickup based on the parameters provided in the request.

pre-tax-amount

Simple

Base charges for the pickup.

gst-amount

Simple

GST amount.

pst-amount

Simple

Provincial Sales Taxes amount.

hst-amount

Simple

HST amount.

due-amount

Simple

Total charges.

Response – XML Diagram

Get Pickup Price - Structure of the XML Response

Get Pickup Price - Structure of the XML Response

Response – Possible Error Responses

Code Description

11003

The date is in the past or invalid.

11005

Customer not valid or blocked.

See also HTTP status codes and Error messages and mitigation strategies.

Examples

Sample REST XML Request – Get Pickup Price

POST https://XX/enab/\{customer}/pickuprequest/price

<pickup-details>
<date>2016-07-18</date>
<contract-id>12345678</contract-id>
<pww-flag>false</pww-flag>
<priority-flag>false</priority-flag>
</pickup-details>

Example error response

<pickup-details>
<date>2016-07-18</date>
<contract-id>12345678</contract-id>
<pww-flag>false</pww-flag>
<priority-flag>false</priority-flag>
</pickup-details>

Development (Sandbox) Environment XML Response – Get Pickup Price

The response is stubbed (static) in the Development environment; you will always receive a response of $3.50 plus 15% GST (as in samples above). In real-life taxes will reflect those in your province, or those in alternate-address-province if provided.