Contract Shipping

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

Get Shipment – REST


Name: Get Shipment
Reason to Call: To retrieve the links and tracking PIN related to a previously created shipment.
Input: Invoke the link returned from a prior call.
Output: The shipment tracking PIN, and links to the shipment artifacts (labels). The shipment status is also provided. Note: The output of the Get Shipment service is identical to that of the Create Shipment service.
Error Examples: 404 - Not Found
Typical Prior Call: Create Shipment, Get Shipments
Typical Next Call: Get Artifact, Get Shipment Price, Get Shipment Details
Version history: Release notes
Get Shipment – Summary of Service

Get Shipment – Summary of Service

Request Details

Request – Structure for Get Shipment


Invoke the link from one of these prior calls:

Create shipment where rel="self"

Get Shipments where rel="shipment"

(see Provided endpoints)

HTTP Headers

HTTP Header Variable



from media-type in original link (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 Get Shipment service does not require any input XML data.

Response Details

Response – Elements

The Get Shipment service response is identical to the response of the Create Shipment service and would also include:

  • The rel=”refund” link if the shipment has been transmitted and a refund has not already been requested.
  • The rel=”price” link if provide-pricing-info was set to true in the Create Shipment request.
  • The rel=”receipt” link if provide-receipt-info was set to true in the Create Shipment request.

Refer to Response – Data Element Details for the details of the response.

Response – XML Diagram

Get Shipment – Structure of XML Response
Get Shipment – 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 Shipment more than 90 days after the link was provided.

See HTTP status codes for more information


Sample REST XML Request – Get Shipment

GET https://XX/rs/12341234/123456789/shipment/123456789012345678
Authorization:Basic s7HD7gwsennesc==

Sample REST XML Response – Get Shipment


<link rel="self" href="https://XX/rs/111111111/2222222222/shipment/347881315405043891" media-type="application/vnd.cpc.shipment-v8+xml"></link>
<link rel="details" href="https://XX/rs/111111111/2222222222/shipment/347881315405043891/details" media-type="application/vnd.cpc.shipment-v8+xml"></link>
<link rel="price" href="https://XX/rs/111111111/2222222222/shipment/347881315405043891/price" media-type="application/vnd.cpc.shipment-v8+xml"></link>
<link rel="receipt" href="https://XX/rs/111111111/2222222222/shipment/347881315405043891/receipt" media-type="application/vnd.cpc.shipment-v8+xml"></link>
<link rel="label" href="https://XX/rs/artifact/11111111/5555555/0" media-type="application/pdf" index="0"></link>