Edit Order

Edit Order API allows the enterprise to edit specific details for a shipment that has already been manifested.

Overview

This API enables enterprises to edit specific details for a shipment that has already been manifested. This API only works for the following mentioned fields, for the respective mentioned carrier partners.

Enterprise can use this API to edit the re-allocation order (for HLD).

Use-cases Supported

  1. Conversion of order from QC to NON-QC
    1. You can use this API to convert a shipment from QC to Non QC flow in case the shipment pickup has to be done and QC check if failing within carrier systems. Once this API is called, Carrier partner will pick the shipment next day without doing QC.
  2. Conversion of Order from COD to Prepaid.
  3. Conversion of Order from Prepaid to COD.
  4. Update Eway Bill Number
  5. Update Box details

Process Flow for COD to Prepaid Conversion:

The COD to Prepaid conversion API allows you to convert a shipment from COD to Prepaid till a particular state of the shipment [in general: Out For Delivery].

  1. Once the COD order is placed by the customer, show them an option to convert the order from COD to Prepaid on My orders section, via SMS/Whatsapp communications.
  2. When the customer makes the payment for the order, if the label is generated for the shipment, you can call the COD to Prepaid conversion API for the corresponding courier partner to convert the order to Prepaid.
  3. Once the courier sends a confirmation, you can make the transaction successful. In case you receive any failure from the courier partner, revert the transaction and disable conversion on the product.

Eway Bill Update Process

What is an Eway Bill Number?

An Eway Bill Number is a unique identifier mandated by the government for the transportation of goods valued at more than ₹50,000.

Flow

  1. During the order creation process, enterprises may not have the Eway Bill Number readily available. As a result, they often input empty or placeholder values in the API.
  2. Subsequently, enterprises generate the Eway Bill Number from the designated portal. This number then needs to be updated at the carrier partner's end.
  3. ClickPost's edit order API facilitates enterprises in updating the Eway Bill Number post-order creation, ensuring compliance and smooth logistics operations.

Important Notes:

  1. Enable webhooks enabled from the courier partners on Clickpost and you are consuming the same for getting the status updates. You would want to disable the payment link as soon as the order is marked as Out for Delivery.
  2. Before you start using the APIs, have a discussion with your courier partner POCs to keep them aligned that you are planning to use “edit order API” (couriers call the COD to Prepaid conversion API as Edit order) to convert orders from COD to Prepaid.

Box details Update Process

Flow

  1. Enterprises may not have the accurate box details like dimensions, dry weight that are required at the time of shipment creation. So they pass placeholder data in the box object.
  2. After the shipment creation is done, enterprises print the waybill copy and box stickers.
  3. Then, after the accurate box dimensions and weight is measured, enterprises can use ClickPost's edit order API to update the Box Details.

Important Notes

  1. You can update box details using this API only if the shipment was manifested via New B2B MPS Order Creation API or the AWB was registered for tracking.
  2. The count of boxes in edit order API should match exactly with the count during order creation.
  3. User should either pass child awb/box reference number for all boxes OR not pass for any box. Invalid case- sending child AWB/box reference for some boxes and not sending it for others.
  4. If child AWB or box reference is not present in all box objects then we will completely overwrite all the box details available against that shipment earlier and create entirely new ones according to the details present in edit order API.
  5. In case the AWB was created through ClickPost and the users passes a child AWB or box reference number in Edit Order API which is not present in our system then the user will get an error.
  6. User can pass both valid child waybill and its linked box reference number in a box object.
  7. Depending on carrier API, if the carrier accepts changes at child AWB level then we will pass it at Child AWB level otherwise just overwrite the entire box array in carrier system.

Geography

This API supports conversions for carriers in India.

📘

Please refer to the list of supported carrier partners below

Supported Carrier Partners for COD to Prepaid

Carrier Partners who support conversion of COD orders to PREPAID and are active on this API:

  1. Shadowfax
  2. XpressBees
  3. EcomExpress
  4. Delhivery
  5. Loadshare
  6. Delhivery B2B MPS
  7. Ithink Logistics
  8. Shadowfax Now Slot HLD
  9. Zomato HLD
  10. Blitz HLD
  11. Skye Air
  12. Elastic Run HLD

Carrier Partner who supports conversion of orders from QC to Non-QC:

  1. Shadowfax Reverse

Carrier Partner who supports update of E-way Bill Number

  1. Ekart
  2. Bluedart
  3. Delhivery (SPS, MPS)
  4. Xpressbee
  5. Shadowfax
  6. Shadowfax Heavy B2B

Carrier Partner who supports updating address info

  1. Delhivery
  2. Ekart Large SPS
  3. Ekart Large MPS
  4. Shadowfax

Carrier Partners who support the update of Box details

  1. Delhivery B2B MPS
  2. Delhivery B2C MPS

URL

POST <https://www.clickpost.in/api/v1/edit-order/>

Query Parameters

Field NameData TypeFieldDescriptionMax LengthExample
usernameStringMandatoryUsername of the registered enterprise100Provided by Clickpost team
keyStringMandatoryUnique license key100Provided by Clickpost team

Request Payload (For AWB Edit)

Field NameData TypeFieldDescriptionMax LengthExample
awb_numberStringMandatoryThe Air Waybill of the shipment that needs to be edited"TESTAWB1"
courier_partnerIntegerMandatoryPartner ID of the carrier partner. List of partner id123
account_codeStringConditional MandatoryPass this if more than one account created under same courier_partner.

Courier partner account name configured on the ClickPost dashboard. Will return a 400 Bad Request response if the given account is inactive or does not exist.
"SFX-ACC-1"
order_typeStringMandatoryOrder type of the shipment
  1. COD
  2. PREPAID
100"PREPAID"
cod_valueFloatOptionalAmount to be collected at the doorstep for cash on delivery mode. (Only required when prepaid to cod conversion is being done)123.50
invoice_valueFloatOptionalInvoice amount of the shipment (in INR)123.50
qc_typeEnumOptionalThe values it takes
  1. doorstep
  2. null``doorstep denotes Quality Check should be done at the doorstepnull denotes that a Quality Check is not required
"doorstep"
skuStringOptional

SKU of the item.

If the customer wishes QC on the entire shipment they should ignore this field.

If they wish QC on a specific shipment they should pass the SKU value of the shipment.

ewaybill_serial_numberStringOptionalEway Bill Number which needs to be updated against a shipment12234567799999
invoice_numberStringOptionalInvoice Number of the shipment"INV12123"
invoice dateDateOptionalDate of the invoice2024-01-20
box_infoStringMandatory if box details to be updatedUpdated details of all the boxes
reference_numberStringConditional MandatoryReference number of the shipment. Mandatory to pass when you want to edit the order using reference number and when awb_number is not provided."TEST-REF-01"

Request Payload (For Re-allocation Edit)

Field NameData TypeFieldDescriptionMax LengthExample
reference_numberStringMandatoryreference number of the reallocation order i.e. original_reference_number"TESTREF1"
order_typeStringMandatoryExisting or to be updated value of the order type. Accepted Values:
  1. COD
  2. PREPAID
100"PREPAID"
cod_valueFloatConditional MandatoryAmount to be collected at the doorstep for cash on delivery mode. (Only required when PREPAID to COD conversion is being done or actual order_type is COD)123.50
invoice_valueFloatConditional MandatoryTotal invoice amount of the order in INR. Mandatory when it needs to be edited.123.50

Box Info

In the 'box_info' object, provide the updated details related to a box like length, breadth, height, weight.

Field NameData TypeField TypeDescription
reference_number_prefixStringConditional
Optional
Unique Id of the box that was passed at the time of shipment creation.
child_awbStringConditional
Optional
child_awb of the box was received in response from the ClickPost Order Creation API when the shipment was originally manifested.
heightIntegerMandatoryHeight of the box in cm
lengthIntegerMandatoryLength of the box in cm
breadthIntegerMandatoryBreadth of the box in cm
weightIntegerMandatoryDry weight of the box in gm

Response

The sample response can have the following fields

Field NameData TypeDescription
metaObjectMetadata for the result, e.g. status code, error messages.

Response Meta

Field NameData TypeDescription
statusIntegerStatus code of the response (including, but not limited to HTTP Status codes)
messageStringError message (if any errors) for the request.
successBooleanWhether the request is successful or not.

Sample Payload

{
    "awb_number": "20719799",
    "order_type": "PREPAID",
    "courier_partner": 220
}
{
    "awb_number": "999999999",
    "qc_type": "doorstep",
    "courier_partner": 11
}
{   
    "awb_number": "76973977426",
    "ewaybill_serial_number":"234567799999", 
    "invoice_number":"new123", 
    "invoice_date":"2024-01-20", 
    "courier_partner": 5
}
{
    "awb_number": "02082025TEST-001",
    "courier_partner": 129,
    "account_code":"1",
    "reference_number":"TEST28072025-002",
    "box_info": [
        {
            "child_waybill": "",
            "box_reference_number": "TEST28072025-002.002",
            "height": 10,
            "length": 10,
            "weight": 10,
            "breadth": 10
        }
    ]
}
{
    "awb_number": "GS2913038487",
    "courier_partner": 632,
    "order_type": "COD",
    "cod_value": 120,
    "invoice_value": 220 //blitz only
}
{
  "reference_number": "ORDER123",
  "invoice_value": 110,
  "cod_value": 10,
  "order_type": "COD"
}
//For ekart
{
    "awb_number": "YOUR_AWB",
    "courier_partner": 55,
    "account_code": "YOUR_ACCOUNT_CODE",
    "drop_address": "123, New Colony, Near Metro",
    "drop_city": "New Delhi",
    "drop_state": "Delhi",
    "drop_pincode": "110001",
    "drop_phone": "9876543210",
    "drop_alternate_phone": "9123456780"
}

// Delhivery
{
    "awb_number": "YOUR_AWB",
    "courier_partner": 4,
    "account_code": "YOUR_ACCOUNT_CODE",
    "drop_address": "123, New Colony, Near Metro Station",
    "drop_phone": "9876543210",
    "drop_name": "John Doe"
}

//Shadowfax
{
    "awb_number": "YOUR_AWB",
    "courier_partner": 9,
    "account_code": "YOUR_ACCOUNT_CODE",
    "drop_address": "253, 2nd cross Hebbal",
    "drop_pincode": "560008",
    "drop_phone": "9999999999",
    "drop_lat": "12.9226",
    "drop_long": "77.6174"
}
{
    "awb_number": "Test4E3DDC8B6CRF",
    "order_type": "PREPAID",
    "length": 50,
    "breadth": 10,
    "height": 23,
    "weight": 12,
    "courier_partner": 631,
}
{
      "awb_number": "<awb>",
      "courier_partner": 1,
      "account_code": "<account_code>",
      "letterhead_base_64": "<base64 png or gif>",
      "signature_base_64": "<base64 png or gif>",
      "pdf_invoice": "<base64 pdf>"
}

Sample Response

{
    "meta": {
        "message": "ACCEPTED",
        "success": true,
        "status": 200
    }
}
{
    "meta": {
        "message": "Order edit not allowed: latest reallocated shipment has already been picked up",
        "success": false,
        "status": 614
    }
}

Meta Codes

HTTP Status CodestatusmessageDescription
200200< Dynamic success message indicating order edited successfully >Order Edited Successfully.
500500Oops! Internal server error in ClickpostAny internal clickpost server error occurred.
400590Oops! Internal service error in ClickpostAny internal clickpost service error occurred.
400400< Dynamic Error message explaining the error >This error can occurred when request body is invalid or courier throws any error while editing order.
400616Multiple shipments found for reference_number; pass courier_partner and account_code to disambiguateWhen more than one shipment found with same reference_number. Please provide specific courier partner and account code optionally.

Error Codes for Updating box details

HTTP Status CodestatusmessageDescription
400200Box count mismatch with existing shipment.The count of box objects in the edit order API should match exactly with the count during order creation if the original shipment was manifested via ClickPost.
400200Either provide child AWB/box reference for ALL boxes or for NONEUser should either pass child AWB/box reference number for all boxes OR not pass for any box. Invalid case: sending child AWB/ box reference for some boxes and not sending it for others.
400200Child AWB not found, use valid child AWB.User passes a child AWB for some box and it is not present in our system.
400200Box reference not found, use valid box reference number.User passes a box reference number for some box and it is not present in our system.

Error Codes for Updating Re-allocation Order

HTTP Status CodestatusmessageDescription
400612Shipment belongs to a reallocation flow; pass the reallocation original reference_numberShipment part of the reallocation flow is not allowed to edit.
400613Order edit not allowed: reallocation terminated with no active AWB
400614Order edit not allowed: latest reallocated shipment has already been picked up
400615Carrier edit successful; reallocation edit failedCarrier edit was successful, but updating the corresponding details for the reallocation order in ClickPost failed.

Error Codes for Updating Re-allocation Order

HTTP Status Codemessage
400courier_partner is mandatory
400account_code is mandatory
400awb_number is mandatory
400GET API is only supported for Async Courier Ex:Delhivery B2B
400AWB number not found in the system

Did this page help you?