Update Delivery Partner Scheme
Update Courier Partner Scheme
The updateCourierPartnerScheme
DK method is used to modify an existing DP's scheme.
FDK Method: updateCourierPartnerScheme
Request
In the below given example, updates a scheme (schemeId: Scheme_id_126) for a DP to enable doorstep quality checks (QC), enhancing service capabilities. By enabling doorstep QC (doorstep_qc: true
), the DP ensures that shipments are inspected for quality upon delivery, which is particularly useful for high-value or sensitive items.
basicRouter.put('/updateScheme', async function view(req, res, next) {
console.log("---------------------------------------------")
console.log("basicRouterr.post.scheme")
try {
const partnerClient = await fdkExtension.getPartnerClient('66a0f176a257365a44f33d4c');
const response = await partnerClient.logistics.updateCourierPartnerScheme({
"schemeId": "Scheme_id_126",
"organizationId": organizationId,
"body": {
"extension_id": process.env.EXTENSION_API_KEY,
"scheme_id": "Scheme_id_126",
"name": "Scheme_name_126",
"weight": {
"lt": 10,
"gt": 1
},
"transport_type": "surface",
"region": "intra-city",
"delivery_type": "one-day",
"payment_mode": [
"COD",
"PREPAID"
],
"stage": "enabled",
"qc_shipment_item_quantity": 1,
"non_qc_shipment_item_quantity": 1,
"feature": {
"restricted_goods": false,
"doorstep_return": false,
"cold_storage_goods": false,
"fragile_goods": false,
"ewaybill": false,
"doorstep_qc": true,
"qr": false,
"multi_pick_single_drop": false,
"dangerous_goods": false,
"doorstep_exchange": false,
"single_pick_multi_drop": false,
"mps": false,
"multi_pick_multi_drop": false,
"product_installation": false,
"ndr": false,
"openbox_delivery": 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 });
}
});
Response
The response confirms that the DPs scheme (Scheme_name_126
) has been successfully updated to include the newly enabled doorstep QC feature, while retaining the existing parameters. The response also shows the ID from which the update was made and timestamp when the changes were implemented.
{
"modified_by": {
"id": "72ddedd773a2a3002223bf03"
},
"name": "Scheme_name_126",
"weight": {
"gt": 1,
"lt": 10
},
"delivery_type": "one-day",
"region": "intra-city",
"created_by": {},
"created_on": "",
"stage": "enabled",
"transport_type": "surface",
"feature": {
"doorstep_exchange": false,
"qr": false,
"ewaybill": false,
"openbox_delivery": false,
"multi_pick_multi_drop": false,
"multi_pick_single_drop": false,
"product_installation": false,
"fragile_goods": false,
"restricted_goods": false,
"cold_storage_goods": false,
"ndr": false,
"doorstep_return": false,
"dangerous_goods": false,
"doorstep_qc": true,
"single_pick_multi_drop": false,
"mps": false
},
"modified_on": "2025-01-06T11:36:54.307573",
"payment_mode": [
"COD",
"PREPAID"
],
"company_id": "_all_"
}