Cancellation API
Cancellation API allows you to cancel the shipment in the carrier partner's system
Overview
In order to cancel placed orders, Clickpost provides an easy-to-use Cancellation API. Enterprise can cancel the shipment manifested via Clickpost , for faster returns.
Enterprise can use this API to terminate the re-allocation flow (for HLD).
Usecase
This is a standard API which applies to all MPS (Multi-Piece Shipment) and SPS (Single Piece Shipment) orders as well as the Re-allocation flow for HLD.
API Flow Diagram
Geography
This is a standard API which supports all shipments created and transported within
- India
- North America
- Europe
- Middle East
- South East Asia
NOTEFor tracking, after cancellation, some carrier partners do not update it in their tracking API ,so you will not see any update on Clickpost dashboard as well for these shipments.
Please note, If the carrier partner updates a status after cancellation API, it will reflect on our dashboard.
As a standard practice, if you get HTTP status code: 200 and and API response: "meta" --> "status_code" 200 / 600 [order already cancelled] in the cancellation API, you can assume that the shipment is marked void/cancelled if it is pre dispatch or has been RTOed if the order is cancelled post dispatch.
For all other cases, consider that shipment is not cancelled yet.
NOTECertain carrier aggregators like Shiprocket do not mark the shipment cancelled synchronously. In such cases, the API will return status 202 [HTTP status as 202 as well] in case the carrier has accepted the request for cancellation.
Sample cURL
curl -X GET 'https://www.clickpost.in/api/v1/cancel-order/?key=****&username=****&waybill=****&cp_id=****&account_code=****'curl -X GET 'https://www.clickpost.in/api/v1/cancel-order/?key=****&username=****&reference_number=****'Query Params (For Waybill Cancellation)
| Field Name | Data Type | Field | Description | Max Length | Example |
|---|---|---|---|---|---|
username | String | Mandatory | Username of your Clickpost account, provided by Clickpost team | 100 | |
key | String | Mandatory | Unique license key for your Clickpost account, provided by Clickpost team | 100 | |
waybill | String | Mandatory | Waybill, which needs to be cancelled | 100 | |
cp_id | Int | Mandatory | Courier Partner ID of the courier from which shipment was dispatched. List: https://carriers.clickpost.ai/ | 4 | 4 |
account_code | String | Mandatory | Courier partner account name configured on the Clickpost dashboard | 100 | "test_account" |
manually_update_status | Boolean | Optional | If the value of this field is "True", then Clickpost will update the tracking status of AWB to "Cancelled" manually once a successful response is received from the courier partner. | True |
Query Params (For Re-allocation Termination)
| Field Name | Data Type | Field | Description | Max Length | Example |
|---|---|---|---|---|---|
username | String | Mandatory | Username of your Clickpost account, provided by Clickpost team | 100 | |
key | String | Mandatory | Unique license key for your Clickpost account, provided by Clickpost team | 100 | |
reference_number | String | Mandatory | Reference number of the re-allocation | 20 | REFHLD0000123 |
Sample Responses
{
"meta": {
"message": "SUCCESS",
"success": true,
"status": 200
}
}{
"meta": {
"message": "ORDER ALREADY CANCELLED",
"success": true,
"status": 600
}
}{
"meta": {
"message": "Invalid Waybill/ Waybill cannot be cancelled",
"success": false,
"status": 350
}
}{
"meta": {
"status": 351,
"message": "Clickpost Account: Does not exist",
"success": false
}
}{
"meta": {
"status": 604,
"message": "Re-allocation flow already terminated",
"success": true
}
}Status Code & Messages
| HTTP Status Code | status | success | message |
|---|---|---|---|
| 200 | 200 | true | SUCCESS |
| 200 | 316 | false | You do not have credentials for the Courier Partner |
| 400 | 350 | false | Invalid Waybill / Waybill cannot be cancelled |
| 200 | 351 | false | Clickpost Account: Does not exist |
| 200 | 352 | false | Multiple account exists |
| 200 | 353 | false | Clickpost Account: Inactive |
| 400 | 400 | false | Generic error message of what is wrong/missing in the request |
| 500 | 590 | false | Ops! Internal service error in Clickpost |
| 500 | 500 | false | Ops! Internal server error in Clickpost |
| 200 | 600 | true | ORDER ALREADY CANCELLED |
Status Code & Messages (For Re-allocation Termination)
| HTTP Status Code | status | success | message |
|---|---|---|---|
| 200 | 604 | true | Re-allocation flow already terminated |
| 200 | 605 | true | Re-allocation flow aborted and latest AWB cancelled |
| 200 | 606 | true | Re-allocation flow aborted but latest AWB could not be cancelled |
| 200 | 607 | true | Re-allocation flow already terminated and latest AWB cancelled |
| 200 | 608 | true | Re-allocation flow already terminated but latest AWB could not be cancelled |
| 400 | 610 | false | No shipment found for the given reference_number |
| 400 | 611 | false | Multiple shipments found for reference_number; pass cp_id and account_code to disambiguate |
| 400 | 612 | false | Shipment belongs to a reallocation flow; pass the reallocation reference_number |
Updated 4 months ago
