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

  1. India
  2. North America
  3. Europe
  4. Middle East
  5. South East Asia
🚧

NOTE

For 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.

❗

NOTE

Certain 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 NameData TypeFieldDescriptionMax LengthExample
usernameStringMandatoryUsername of your Clickpost account, provided by Clickpost team100
keyStringMandatoryUnique license key for your Clickpost account, provided by Clickpost team100
waybillStringMandatoryWaybill, which needs to be cancelled100
cp_idIntMandatoryCourier Partner ID of the courier from which shipment was dispatched. List: https://carriers.clickpost.ai/44
account_codeStringMandatoryCourier partner account name configured on the Clickpost dashboard100"test_account"
manually_update_statusBooleanOptionalIf 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 NameData TypeFieldDescriptionMax LengthExample
usernameStringMandatoryUsername of your Clickpost account, provided by Clickpost team100
keyStringMandatoryUnique license key for your Clickpost account, provided by Clickpost team100
reference_numberStringMandatoryReference number of the re-allocation20REFHLD0000123

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 Codestatussuccessmessage
200200trueSUCCESS
200316falseYou do not have credentials for the Courier Partner
400350falseInvalid Waybill / Waybill cannot be cancelled
200351falseClickpost Account: Does not exist
200352falseMultiple account exists
200353falseClickpost Account: Inactive
400400falseGeneric error message of what is wrong/missing in the request
500590falseOps! Internal service error in Clickpost
500500falseOps! Internal server error in Clickpost
200600trueORDER ALREADY CANCELLED

Status Code & Messages (For Re-allocation Termination)

HTTP Status Codestatussuccessmessage
200604trueRe-allocation flow already terminated
200605trueRe-allocation flow aborted and latest AWB cancelled
200606trueRe-allocation flow aborted but latest AWB could not be cancelled
200607trueRe-allocation flow already terminated and latest AWB cancelled
200608trueRe-allocation flow already terminated but latest AWB could not be cancelled
400610falseNo shipment found for the given reference_number
400611falseMultiple shipments found for reference_number; pass cp_id and account_code to disambiguate
400612falseShipment belongs to a reallocation flow; pass the reallocation reference_number

Did this page help you?