B2B Edit Order

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

Overview


This API enables enterprises to edit specific details for a shipment that has already been manifested with new B2Bs API.

Use-cases Supported

  • Update Box Details

  • Update B2B Invoice Details


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.


Carrier Partners who support the update of Box details

  1. Delhivery B2B MPS (partner id : 66)

  2. Delhivery B2C MPS (partner id : 289)

Invoice Update Process Flow

Enterprises may not have the Invoice details like invoice number, invoice value, ewaybill serial number that are required at the time of shipment creation. So they pass placeholder data in the box object.

Important Notes

  1. You can update invoice and ewaybill 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. Since the Delhivery B2B MPS Shipment Update API is asynchronous in nature, we need to call the GET API (details provided below) to fetch the actual status of the invoice update request.

Carrier Partners who support the update of Invoice details

  1. Delhivery B2B MPS (partner id : 66)



URL

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

Query Parameters

Field NameData TypeFieldDescriptionMax LengthExample
usernameStringMandatoryUsername100Provided by Clickpost team
keyStringMandatoryUnique license key100Provided by Clickpost team


Request Payload

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_codeStringMandatoryPass 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"
box_infoobjectMandatory if box details to be updatedUpdated details of all the boxes
invoice_infoobjectMandatory if invoice details to be updatedUpdated details of all the invoices.


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


Invoice Info(invoice_info)

Field NameData TypeField TypeDescription
numberStringOptionalUnique Id number of the invoice
valueFloatOptionalValue of the shipment as mentioned in the invoice.
dateDateOptionalDate of issuance of the invoice of the shipment. (YYYY-MM-DD format only)
ewaybill_serial_numberStringOptionalEwaybill serial number of the invoice. It is needed when the invoice value is >=Rs 50K. Some carriers like VRL Logistics, SR Cargo, Xpressbees Cargo require this as a mandatory field so OC will fail without this.
ewaybill_expiry_dateDateOptionalExpiry date of the Ewaybill
descriptionStringOptionalInvoice description, can be used to provide details about the invoice like quantity contained in the invoice



Sample Payload

{
    "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": "02082025TEST-001",
    "courier_partner": 66,
    "account_code": "1",
    "reference_number": "TEST28072025-002",
    "cod_value": 10,
    "weight":40,
    "drop_info": {
        "name": "Mr Himesh",
        "phone": "999999999",
        "city": "Puducherry",
        "state": "Puducherry",
        "pincode": "605001",
        "country": "India",
        "address": "104, Kamaraj Salai,",
        "email": "[email protected]",
        "tin": null,
        "lat": null,
        "long": null,
        "district": "Puducherry",
        "landmark": "test_landamrk",
        "organisation": "test_organisation"

    },
    "box_info": [
        {
            "child_waybill": "",
            "box_reference_number": "TEST28072025-002.002",
            "height": 10,
            "length": 10,
            "weight": 10,
            "breadth": 10
        }
    ],
    "invoice_info": [
        {
            "date": null,
            "value": null,
            "number": null,
            "description": null,
            "ewaybill_expiry_date": null,
            "ewaybill_serial_number": null
        }
    ]
}

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 Response

{
    "meta": {
        "message": "Success",
        "success": true,
        "status": 200
    }
}
{
  "meta": {
    "message": "Edit Order is in progress",
    "success": true,
    "status": 102,
    "job_id": "<delhivery_job_id>"
  }
}
{
  "meta": {
    "message": "<error detail>",
    "success": false,
    "status": 400
  }
}


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 Invoice details

HTTP Status CodestatusmessageDescription
400400Dynamic Error messageEx: Courier API Failed, Invalid Details.



GET API

If Courier API is async in nature we need to call GET API to fetch status.

Query Parameters

Field NameData TypeFieldDescriptionMax LengthExample
usernameStringMandatoryUsername100Provided by Clickpost team
keyStringMandatoryUnique license key100Provided by Clickpost team
awb_numberStringMandatory
courier_partnerNumberMandatory
account_codeStringMandatory


curl --location 'https://www.clickpost.in/api/v1/edit-order?key=KEY&awb_number=AWB&courier_partner=PARTNER_ID&account_code=ACCOUNT_NAME&username=T'

Sample Response

{
  "meta": {
    "message": "Edit order successful",
    "success": true,
    "status": 200,
    "job_id": "<delhivery_job_id>"
  }
}
{
    "meta": {
        "message": "courier_partner is mandatory", // dynamic messages
        "success": false,
        "status": 400
    }
}

Did this page help you?