Skip to main content

Update Status and Info

Update Shipment Status

The DP extension needs to provide shipment tracking updates in real time.

  • If DP is unable to provide shipment tracking updates in real time, then they need to convey the updates in the interval time of status updates. The DP need to update the updated shipment status in the conveyed interval time to Fynd.

DP can send extra information in meta fields under entities and products. If the information is related to the shipment, send information under shipment meta. If it is related to items/products of shipment, send it under the products meta. The updateShipmentStatus is used to update a shipment and its status. It can also be used to update bags present in that shipment.

Refer to OMS states for the complete list of OMS states.

basicRouter.post('/update_shipment_status', async function view(req, res, next) {
console.log("---------------------------------------------")
console.log("basicRouterr.post.update_shipment_status")
try {
const platformClient = await fdkExtension.getPlatformClient(9294);
const response = await platformClient.order.updateShipmentStatus({
"body": {
"task": false,
"force_transition": false,
"lock_after_transition": false,
"unlock_before_transition": false,
"resume_tasks_after_unlock": false,
"statuses": [
{
"shipments": [
{
"identifier": "17334083479041568015",
"products": [],
"data_updates": {
"entities": [
{
"filters": [],
"data": {
"meta": {
"courier_partner_extension_id": process.env.EXTENSION_API_KEY,
"courier_partner_scheme_id": "Scheme_id_3",
"sort_code": "1129",
"ewaybill_info": {
"success": true
},
"waybill": [
"6806010004126"
],
"tracking_url": "https://www.test.com/track/package/6806010004126",
"courier_partner_shipper_name": "Test",
"logistics_meta": {
"remark": "NAN"
},
"is_own_account": true,
"shipping_label_provided": false,
"estimated_delivery_date": null,
"promised_delivery_date": null,
"rider_details": {
"name": "xyz",
"phone": "+1234567890"
},
"label": "https://cdn.fynd.com/v2/falling-surf-7c8bb8/fyprod/wrkr/documents/label/PDFs/17291005908611498449.pdf",
"courier_partner_name": "Test Partner Name"
},
"delivery_awb_number": "6806010004126",
"pdf_links": {
"label": "https://cdn.fynd.com/v2/falling-surf-7c8bb8/fyprod/wrkr/documents/label/PDFs/17291005908611498449.pdf"
}
}
}
],
"products": [
{
"filters": [],
"data": {
"meta": {
"courier_partner_extension_id": process.env.EXTENSION_API_KEY,
"courier_partner_scheme_id": "Scheme_id_3",
"sort_code": "1129",
"ewaybill_info": {
"success": true
},
"waybill": [
"6806010004126"
],
"tracking_url": "https://www.test.com/track/package/6806010004126",
"courier_partner_shipper_name": "Test",
"is_own_account": true,
"estimated_delivery_date": null,
"promised_delivery_date": null,
"rider_details": {
"name": "xyz",
"phone": "+1234567890"
},
"label": "https://cdn.fynd.com/v2/falling-surf-7c8bb8/fyprod/wrkr/documents/label/PDFs/17291005908611498449.pdf",
"courier_partner_name": "Test Partner Name"
},
"delivery_awb_number": "6806010004126"
}
}
],
"order_item_status": [
{
"filters": [],
"data": {
"meta": {
"courier_partner_details": {
"courier_partner_extension_id": process.env.EXTENSION_API_KEY,
"courier_partner_scheme_id": "Scheme_id_3",
"courier_partner_name": "Test Partner Name",
"is_own_account": true,
"courier_partner_shipper_name": "Test"
}
}
}
}
]
}
}
],
"status": "dp_assigned",
"exclude_bags_next_state": "",
"split_shipment": false
}
]
}
});
console.log(JSON.stringify(response))
res.json(response);
} catch (err) {
console.error(err);
console.log(JSON.stringify(err))
res.status(404).json({ success: false });
}
});

Update Shipment Tracking Info

The updateShipmentTracking is used for updating the tracking information to show the latest shipment status, location, and delivery timelines. It ensures that both the seller and the customer have accurate and up-to-date logistics information.

Request

In the below given example request, the code demonstrates modifying a DP’s tracking details for a shipment identified by its shipment ID or AWB number. The tracking details for a shipment (shipment_id: 17334083479041568015) are updated. Key fields such as the AWB number, current DP location, status (dp_status: out_for_delivery), and status update timestamp are provided. Additional information includes the DP’s name, the shipment’s journey stage, and estimated and promised date delivery dates.

basicRouter.post('/update_shipment_tracking', async function view(req, res, next) {
console.log("---------------------------------------------")
console.log("basicRouterr.post.update_shipment_tracking")
try {
const platformClient = await fdkExtension.getPlatformClient(8948);
const response = await platformClient.order.updateShipmentTracking({
"body": {
"awb": "6806010004126",
"dp_location": "Mumbai",
"dp_name": "Test bluedart",
"dp_status": "out_for_delivery",
"dp_status_updated_at": "2024-12-06T10:15:30Z",
"estimated_delivery_date": "2024-12-10T10:15:30Z",
"journey": "forward",
"meta": {},
"operational_status": "great",
"promised_delivery_date": "2024-12-10T10:15:30Z",
"remark": "Not Applicable",
"shipment_id": "17334083479041568015"
}
});
console.log(JSON.stringify(response))
res.json(response);
} catch (err) {
console.error(err);
console.log(JSON.stringify(err))
res.status(404).json({ success: false });
}
});

Response

The response confirms the successful update of the tracking details. It echoes back the updated fields, such as the DP status, location, estimated and promised delivery dates, and other metadata. This ensures that all stakeholders, including sellers, buyers, and the logistics team, are aligned with the current status of the shipment. Such updates enhance transparency and improve the overall delivery experience by keeping the tracking information accurate and accessible.

{
"remark": "Not Applicable",
"operational_status": "great",
"journey": "forward",
"dp_location": "Mumbai",
"meta": {},
"promised_delivery_date": "2024-12-10T10:15:30+00:00",
"dp_name": "Test bluedart",
"estimated_delivery_date": "2024-12-10T10:15:30+00:00",
"shipment_id": "17334083479041568015",
"dp_status_updated_at": "2024-12-06T10:15:30+00:00",
"dp_status": "out_for_delivery",
"awb": "6806010004126"
}

Was this section helpful?