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
Box details Update Process Flow
- 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.
- After the shipment creation is done, enterprises print the waybill copy and box stickers.
- 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
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.
The count of boxes in edit order API should match exactly with the count during order creation.
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.
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.
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.
User can pass both valid child waybill and its linked box reference number in a box object.
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
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
- 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.
- 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
URL
POST <https://www.clickpost.in/api/v1/edit-order/>
Query Parameters
| Field Name | Data Type | Field | Description | Max Length | Example |
|---|---|---|---|---|---|
username | String | Mandatory | Username | 100 | Provided by Clickpost team |
key | String | Mandatory | Unique license key | 100 | Provided by Clickpost team |
Request Payload
| Field Name | Data Type | Field | Description | Max Length | Example |
|---|---|---|---|---|---|
awb_number | String | Mandatory | The Air Waybill of the shipment that needs to be edited | "TESTAWB1" | |
courier_partner | Integer | Mandatory | Partner ID of the carrier partner. List of partner id | 123 | |
account_code | String | Mandatory | Pass 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_info | object | Mandatory if box details to be updated | Updated details of all the boxes | ||
| invoice_info | object | Mandatory if invoice details to be updated | Updated 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 Name | Data Type | Field Type | Description |
|---|---|---|---|
reference_number_prefix | String | Conditional Optional | Unique Id of the box that was passed at the time of shipment creation. |
child_awb | String | Conditional Optional | child_awb of the box was received in response from the ClickPost Order Creation API when the shipment was originally manifested. |
height | Integer | Mandatory | Height of the box in cm |
length | Integer | Mandatory | Length of the box in cm |
breadth | Integer | Mandatory | Breadth of the box in cm |
weight | Integer | Mandatory | Dry weight of the box in gm |
Invoice Info(invoice_info)
| Field Name | Data Type | Field Type | Description |
|---|---|---|---|
number | String | Optional | Unique Id number of the invoice |
value | Float | Optional | Value of the shipment as mentioned in the invoice. |
date | Date | Optional | Date of issuance of the invoice of the shipment. (YYYY-MM-DD format only) |
ewaybill_serial_number | String | Optional | Ewaybill 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_date | Date | Optional | Expiry date of the Ewaybill |
description | String | Optional | Invoice 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 Name | Data Type | Description |
|---|---|---|
meta | Object | Metadata for the result, e.g. status code, error messages. |
Response Meta
| Field Name | Data Type | Description |
|---|---|---|
status | Integer | Status code of the response (including, but not limited to HTTP Status codes) |
message | String | Error message (if any errors) for the request. |
success | Boolean | Whether 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 Code | status | message | Description |
|---|---|---|---|
| 200 | 200 | < Dynamic success message indicating order edited successfully > | Order Edited Successfully. |
| 500 | 500 | Oops! Internal server error in Clickpost | Any internal clickpost server error occurred. |
| 400 | 590 | Oops! Internal service error in Clickpost | Any internal clickpost service error occurred. |
| 400 | 400 | < Dynamic Error message explaining the error > | This error can occurred when request body is invalid or courier throws any error while editing order. |
| 400 | 616 | Multiple shipments found for reference_number; pass courier_partner and account_code to disambiguate | When 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 Code | status | message | Description |
|---|---|---|---|
| 400 | 200 | Box 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. |
| 400 | 200 | Either provide child AWB/box reference for ALL boxes or for NONE | 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. |
| 400 | 200 | Child AWB not found, use valid child AWB. | User passes a child AWB for some box and it is not present in our system. |
| 400 | 200 | Box 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 Code | status | message | Description |
|---|---|---|---|
| 400 | 400 | Dynamic Error message | Ex: 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 Name | Data Type | Field | Description | Max Length | Example |
|---|---|---|---|---|---|
username | String | Mandatory | Username | 100 | Provided by Clickpost team |
key | String | Mandatory | Unique license key | 100 | Provided by Clickpost team |
| awb_number | String | Mandatory | |||
| courier_partner | Number | Mandatory | |||
| account_code | String | Mandatory |
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
}
}Updated 13 days ago
