You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current Canada Post cancellation process appears to be broken. When Canada Post returns an empty message, Karrio incorrectly interprets it as a successful cancellation.
For contract shipping, Canada Post provides two types of cancellation processes:
Void a shipment: Cancels a shipment that has not yet been manifested.
Request a shipment refund: Cancels a shipment that has already been manifested but not shipped.
For non-contract shipping, the cancellation process may differ, and Karrio needs to account for this difference. Non-contract shipments do not rely on manifests, so the logic should handle direct refund requests for these shipments.
A successful response will return a 204 No Content status.
Any other response or content indicates a failure.
If the shipment was already manifested the response will be a 400 along with a message:
<?xml version="1.0" encoding="UTF-8"?>
<messagesxmlns="http://www.canadapost.ca/ws/messages">
<message>
<code>8064</code>
<description>A Shipment can only be void if it is in a PROCESSED or PRINTED state. If it has been transmitted, a Refund request should be submitted.</description>
</message>
</messages>
Scenario 2: Request a Refund for a Manifested Shipment
If the shipment was already requested for a refund the response will be a 409 conflict along with a message:
<?xml version="1.0" encoding="UTF-8"?>
<messagesxmlns="http://www.canadapost.ca/ws/messages">
<message>
<code>7292</code>
<description>A refund has already been requested for this shipment. Note that refund requests may take a few days to be processed.</description>
</message>
</messages>
Non-Contract Shipping
For non-contract shipments, the cancellation process does not involve manifests, since these shipments are paid immediately upon label creation there's only one endpoint for Request Shipment Refund
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
@minchaminder
The current Canada Post cancellation process appears to be broken. When Canada Post returns an empty message, Karrio incorrectly interprets it as a successful cancellation.
Example of Empty Message:
Context
For contract shipping, Canada Post provides two types of cancellation processes:
For non-contract shipping, the cancellation process may differ, and Karrio needs to account for this difference. Non-contract shipments do not rely on manifests, so the logic should handle direct refund requests for these shipments.
Contract Shipping Scenarios
Scenario 1: Void a Shipment (Unmanifested)
The process to void a shipment involves the following steps:
Retrieve the shipment ID:
Call the following endpoint to get the shipment URL (including the shipment ID):
Sample Response:
Note: The shipment ID is also returned when the shipment is initially created. (Karrio likely already has the ID saved)
Void the shipment:
Use the shipment ID from the previous step and make the following request:
204 No Content
status.Scenario 2: Request a Refund for a Manifested Shipment
To cancel a shipment that has already been included in a manifest but not shipped, follow these steps:
Retrieve the shipment ID:
Similar to Scenario 1, use the following endpoint to get the shipment URL and ID:
Request a refund:
Use the shipment ID to call the following endpoint with an XML body:
Sample Request Body:
Non-Contract Shipping
For non-contract shipments, the cancellation process does not involve manifests, since these shipments are paid immediately upon label creation there's only one endpoint for Request Shipment Refund
Expected Behavior
204 No Content
response as a successful cancellation.Suggested Fix
Differentiate between contract and non-contract shipping:
Verify and handle responses:
204 No Content
response is treated as successful.<messages>
tags).Add support for refunds in manifested shipments (Scenario 2):
Beta Was this translation helpful? Give feedback.
All reactions