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: |
|
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 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 |
<?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. |
date |
Simple |
Optional |
Pickup date. Date format (yyyy-mm-dd). |
priority-flag |
Simple |
Optional |
{true}, {false} |
alternate-address-postal-code |
Simple |
Optional |
The postal code of the address where the pickup is to be done. |
Request – XML Diagram
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. |
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
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.