Contract Shipping

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

Void Shipment – REST


Name: Void Shipment
Reason to Call:

To delete a specific shipment prior to transmit. As an alternative, a shipment can be excluded from a transmit request and therefore remain active for inclusion in a subsequent transmit request.

Making this call indicates that the previously printed label is spoiled or will otherwise not be used.
Input: Invoke a link from a prior call where rel=shipment
Output: none
Error Example: 404 – not found
Typical Prior Call: Create Shipment, Get Shipment or Get Shipments
Typical Next Call: none
Version history: Release notes
Void Shipment – Summary of Service

Void Shipment – Summary of Service

Request Details

Request – Structure for Void Shipment


Invoke the link returned from a prior call to Get Shipment or Create Shipment where rel=”self”


Invoke the link returned from a prior call to 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 Void Shipment service does not require any input XML data.

Response Details

Response – Elements

The Void Shipment service does not respond with any XML elements. A successful HTTP response code is 204, which means the operation was performed successfully but there is no content in the XML body.

Response – Possible Error Responses

Code Message Meaning


Messages structure is empty.

The resource was not found so the shipment id is incorrect or the shipment has already been voided.


A shipment can only be void if it is in a PROCESSED or PRINTED state.

The shipment has already been transmitted. A refund must be requested.


Sample REST XML Request – Void Shipment

DELETE https://XX/rs/345345/123456789/shipment/123456789012345678
Authorization:Basic 32j32h2jk23j-23==

Sample REST XML Response – Void Shipment

HTTP/1.1 204 OK
Content-type:text/html; charset=UTF-8

The Void Shipment service does not respond with any XML data elements.