Contract Shipping

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

Get Manifest Details – REST

Summary

Name: Get Manifest Details
Reason to Call: To retrieve information found on the hardcopy manifest such as total cost of the manifest.
Input: Invoke the link returned from Get Manifest where rel="details"
Output: The total shipping costs for all shipments in the manifest and the credit card or Supplier Account receipt information if applicable.
Error Example: 404 – not found
Typical Prior Call: Get Manifest
Typical Next Call: Get Artifact (if that service has not already been called)
Version history: Release notes
Get Manifest Details – Summary of Service

Get Manifest Details – Summary of Service

Request Details

Request – Structure for Get Manifest Details

Endpoint

Invoke the link from Get Manifest where rel="details"

(see Provided endpoints)

HTTP Headers

HTTP Header Variable

Value

Accept

from media-type in original link (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

None

Request – Elements

The Get Manifest Details service does not require any input XML data.

Response Details

Response – Elements

The following table describes the top level view of the XML fields in the response.

Get Manifest Details - Top Level View of Response Elements
Element Name Type Description

manifest-details

Complex

The overall structure for the body of the request input information in XML format.

po-number

Simple

(Alphanumeric String - up to 10 letters/digits)

Contained within manifest-details.

This is the PO number used for billing and displayed on the manifest.

final-shipping-point

Simple

(6-character alphanumeric string)

Contained within manifest-details.

This is the Postal Code of the Post Office where the shipment is to be dropped off.

shipping-point-name

Simple

(Character String - up to 35 characters)

Contained within manifest-details.

This is the descriptive name of the shipping point.

shipping-point-id

Simple

(Character String - up to 4 characters)

Contained within manifest-details.

This is the Canada Post identification number of the shipping point.

cpc-pickup-indicator

Simple

{true}

Returned if you specified that your mail is picked up by Canada Post at your site.

Only supplied when true.

mailed-by-customer

Simple

(1-10 digit numeric)

Contained within manifest-details.

This is the 10-digit customer number of the mailed-by-customer.

mailed-on-behalf-of

Simple

(1-10 digit numeric)

Contained within manifest-details.

This is the 10-digit customer number of the mail owner.

paid-by-customer

Simple

(1-10 digit numeric)

Contained within manifest-details.

This is the 10-digit customer number of the customer who is paying for the shipment. This is often the same as the mailed-on-behalf-of customer number.

customer-ref

Simple

(Alphanumeric String – up to 12 letters/digits)

Contained within manifest-details.

This is the reference field provided by the client in the transmit request.

manifest-date

Simple

(YYYY-MM-DD)

Contained within manifest-details.

This is the date the manifest was generated.

Note: on the printed manifest, there is both a "manifest date" and a "shipment date" printed.  The  shipment date is the same as the manifest date.

manifest-time

Simple

(HH:MM TZ) where
HH = the 24-hour based hour
MM = the minutes
TZ = the time zone abbreviation (for the server)

Contained within manifest-details.

This is the time when the manifest was generated.

contract-id

Simple

(1-15 digit numeric)

Contained within manifest-details.

This is the contract number that was used for pricing this manifest, if applicable (i.e. if you are using a service not on your contract, contract-id is not required)

method-of-payment

Simple

{Character String - up to 10 characters}

Contained within manifest-details.

This indicates the method of payment by the customer.

cc-receipt-details

Complex

This structure will be provided if the manifest was paid for by credit card through the Transmit Shipments request.

This structure contains the elements required for a hardcopy credit card receipt.

supplier-account-receipt-details

Complex

This structure will be provided if the manifest was paid for by Supplier Account in the Transmit Shipments request.

This structure is not returned in the sandbox environment.

manifest-pricing-info

Complex

Contained within manifest-details.

This structure contains the information about the total pricing of all items on the manifest.

manifest-address

Complex

Contained within manifest-details.

This structure contains the address information for the manifest that appears on the manifest label.

The following table describes a more detailed view of the XML data in the response.

The exact hierarchical structure of the XML outputs is shown in the XML diagram.

Get Manifest Details - Detailed View of Response Elements
Element Name Type Description

merchant-name

simple

Contained with cc-receipt-details

Will have the value: "Canada Post"

merchant-url

simple

Contained with cc-receipt-details

Will have the value: "www.canadapost.ca"

name-on-card

simple

Contained with cc-receipt-details

The name on the default credit card stored by Canada Post.

auth-code

simple

Contained with cc-receipt-details

The authorization code received from the credit card issuer.

auth-timestamp

simple

Contained with cc-receipt-details

The date and time that the credit card company authorized the transaction.

card-type

simple

Contained with cc-receipt-details

The type of credit card used for the purchase.

currency

simple

Contained with cc-receipt-details

The currency of the transaction: CAD

transaction-type

simple

Contained with cc-receipt-details

Will have the value: "Sale"

merchant-name

Simple

Contained within supplier-account-receipt-details.

Will have the value: "Canada Post"

merchant-url

Simple

Contained within supplier-account-receipt-details.

Will have the value: "www.canadapost.ca"

auth-code

Simple

Contained within supplier-account-receipt-details.

The authorization code received from the supplier.

auth-timestamp

Simple

Contained within supplier-account-receipt-details.

The date and time the supplier authorized the transaction.

supplier-id

Simple

Contained within supplier-account-receipt-details.

The supplier that authorized the transaction. Values are:

  • FP = FrancoTyp Postalia
  • NE = Neopost
  • PB = Pitney Bowes

charge-amount

Simple

Contained within supplier-account-receipt-details.

The total amount charged to the account.

currency

Simple

Contained within supplier-account-receipt-details.

The currency of the transaction; always CAD.

transaction-type

Simple

Contained within supplier-account-receipt-details.

Will have the value: "Sale".

base-cost

simple

(Numeric field of pattern 6.2 i.e. 999999.99)

Contained within manifest-pricing-info.

This is the base-cost total for all shipments on the manifest.

automation-discount

simple

(Numeric field of pattern 6.2 i.e. 999999.99)

Contained within manifest-pricing-info.

This is the automation discount total for all shipments on the manifest.

options-and-surcharges

simple

(Numeric field of pattern 6.2 i.e. 999999.99)

Contained within manifest-pricing-info.

This is the options-and-surcharges total for all shipments on the manifest.

gst

simple

(Numeric field of pattern 6.2 i.e. 999999.99)

Contained within manifest-pricing-info.

This is the GST total for all shipments on the manifest.

pst

simple

(Numeric field of pattern 6.2 i.e. 999999.99)

Contained within manifest-pricing-info.

This is the PST total for all shipments on the manifest.

hst

simple

(Numeric field of pattern 6.2 i.e. 999999.99)

Contained within manifest-pricing-info.

This is the HST total for all shipments on the manifest.

total-due-cpc

simple

(Numeric field of pattern 6.2 i.e. 999999.99)

Contained within manifest-pricing-info.

This is the total due to Canada Post for all shipments on the manifest.

manifest-address The elements within manifest-address are identical to the elements described under manifest-address in request elements for Transmit Shipments. These include manifest-name, address-details, address-line-1, address-line-2, city, prov-state, country-code and postal-zip-code.

Response – XML Diagram

Get Manifest Details – Top Level Structure of XML Response
Get Manifest Details – Top Level Structure of XML Response

Response – Possible Error Responses

No errors are expected for invocation of this link, but you will receive a 404 error if you invoke Get Manifest Details more than 90 days after the link was provided or invoke it for an empty manifest (see Transmit Shipments for details)

See HTTP status codes for more information.

Examples

Sample REST XML Request – Get Manifest Details

GET https://XX/rs/0001234567/0001234567/manifest/123456789012345678/details
Accept:application/vnd.cpc.manifest-v8+xml
Authorization:345j34j3j34k=435==

Sample REST XML Response – Get Manifest Details

<manifest-details>
<po-number>D906367941</po-number>
<final-shipping-point>K1G1C0</final-shipping-point>
<shipping-point-name>OTTAWA T PO</shipping-point-name>
<shipping-point-id>0015</shipping-point-id>
<mailed-by-customer>0001234567</mailed-by-customer>
<mailed-on-behalf-of>0001234567</mailed-on-behalf-of>
<paid-by-customer>0001234567</paid-by-customer>
<manifest-date>2011-09-01</manifest-date>
<manifest-time>16:42 EDT</manifest-time>
<contract-id>0012345678</contract-id>
<method-of-payment>account</method-of-payment>
<manifest-pricing-info>
<base-cost>39.57</base-cost>
<automation-discount>0</automation-discount>
<options-and-surcharges>26.37</options-and-surcharges>
<gst>0.00</gst>
<pst>0</pst>
<hst>8.58</hst>
<total-due-cpc>74.52</total-due-cpc>
</manifest-pricing-info>
<manifest-address>
<manifest-name>MajorShop</manifest-name>
<phone-number>514 829 5879</phone-number>
<address-details>
<address-line-1>1230 Tako RD.</address-line-1>
<city>Ottawa</city>
<prov-state>ON</prov-state>
<country-code>CA</country-code>
</address-details>
</manifest-address>
</manifest-details>