Create Scheme
Description
The createCourierPartnerScheme
FDK method creates a Scheme by sending a request with detailed parameters to Fynd Commerce. When executed, this request creates a new scheme with the specified parameters. This method allows DPs to define schemes tailored to specific delivery requirements such as weight, region, transport type, and payment modes.
createCourierPartnerScheme
Rules for Keys: gt
, lt
, gte
, and lte
When configuring the createCourierPartnerScheme
FDK method, there are specific rules for keys: gt
, lt
, gte
, and lte
(under weight
and volumetric_weight
). These keys define the range of weight or volumetric weight limits.
Weight: Also known as dead weight. It refers specifically to the actual weight of shipments. If blank, it will be considered a NO Limit, and the delivery partner will be assigned based on volumetric weight.
Volumetric Weight: It enables you to specify limits based on the volume of the packages. This weight is calculated from the package's length, width, and height. If blank, it will be considered a **NO LIMIT, and **the delivery partner will be assigned based on dead weight.
Fields | Type | Mandatory | Description |
---|---|---|---|
gt | Number | No | stands for grater than. For example, gt = 5 means greater than 5. |
gte | Number | No | stands for greater than or equal to. For example, gte = 5 means greater than or equal to 5 . |
lt | Number | No | stands for less than. For example, lt = 5 means less than 5 . |
lte | Number | No | stands for less than or equal to. For example, lte = 5 , means less than or equal to 5. |
The keys gt
(greater than) and gte
(greater than or equal to), should not be used together to create a scheme. Use either gt
or gte
based on your requirements.
Similarly, the keys lt
(less than) and lte
(less than or equal to), should not be used together to create a scheme. Use either lt
or lte
based on your requirements.
Example
"weight": {
"gte": 3,
"lte": 10,
}
"weight": {
"gt": 25,
"lt": 60,
}
Add Features to Scheme
The feature
object contains a list of features, such as doorstep_qc
and dangerous_goods
. You can set these features to true
/false
depending on what features DP provides. If DP supports any specific feature, the respective key must be set to true
. Refer to List of Features for more details.
In the below given example request, the doorstep QC and dangerous goods are set to true
because the DP supports only these features, while all other features are set to false
. If the DP supports any specific feature, the corresponding key must be set to true
.
basicRouter.post('/scheme', async function view(req, res, next) {
console.log("---------------------------------------------")
console.log("basicRouterr.post.scheme")
try {
const partnerClient = await fdkExtension.getPartnerClient('6720b51d25f94c22e87376a5');
const response = await partnerClient.logistics.createCourierPartnerScheme({
"organizationId": organizationId,
...
"feature": {
"doorstep_qc": true,
"qr": false,
"mps": false,
"ndr": false,
"dangerous_goods": true,
"fragile_goods": false,
"restricted_goods": false,
"cold_storage_goods": false,
"doorstep_exchange": false,
"doorstep_return": false,
"product_installation": false,
"openbox_delivery": false,
"multi_pick_single_drop": false,
"single_pick_multi_drop": false,
"multi_pick_multi_drop": false,
"ewaybill": false
}
}
)}
}
});
List of Features
The complete list of features are mentioned below:
Fields | Type | Required | Description |
---|---|---|---|
cold_storage_goods | Boolean | No | Goods that need to be kept at low temperatures to stay fresh or safe. For example, perishable food items, pharmaceuticals, and certain chemicals |
dangerous_goods | Boolean | No | Items that pose risks to health, safety, property, or the environment. For example, flammable liquids, explosives, and toxic substances. |
doorstep_exchange | Boolean | No | A service where items are exchanged at the customer's doorstep. For example, a customer might exchange a faulty product for a new one without leaving home. |
doorstep_qc | Boolean | No | Doorstep QC is a service where the quality of to-be-picked items is verified at the customer's doorstep before accepting the return. This ensures that the products meet the expected standards and allows immediate returns or exchanges if any issues are detected. |
doorstep_return | Boolean | No | Doorstep return refers to the process where, upon delivering a shipment, the customer rejects it on the spot, and the DP immediately accepts the return. This service streamlines the return process by handling it directly during the delivery attempt. |
ewaybill | Boolean | No | An e-way bill is required to transport goods valued above ₹ 50,000 in India, interstate or intrastate. |
fragile_goods | Boolean | No | Items that can easily break or get damaged, such as glassware, electronics, and ceramics. |
mps | Boolean | No | A Multi-Piece Shipment (MPS) involves multiple packages being shipped together under a single tracking number to process and deliver all the packages together. This method is often used for large orders split into several parcels but is meant to be delivered to the same destination at the same time under the same shipment ID or parent AWB. |
multi_pick_multi_drop | Boolean | No | A logistics process where goods are picked up from multiple locations and delivered to multiple destinations. |
multi_pick_single_drop | Boolean | No | A process where goods are picked up from multiple locations and delivered to a single destination. |
ndr_attempts | Number | No | The DP provides/supports a number of re-attempts once the delivery attempt to the customer has failed the first time. |
openbox_delivery | Boolean | No | A delivery method where the package is opened in front of the customer to check for damage or verify contents before completing the delivery. |
product_installation | Boolean | No | The service of setting up and installing a product at the customer's location after delivery |
qr | Boolean | No | The DP shares the QR code to accept payment from the customer at the delivery point. |
restricted_goods | Boolean | No | Items that have limitations or are regulated for shipping due to safety, legal, or other concerns. For examples, firearms, certain chemicals, and live animals |
single_pick_multi_drop | Boolean | No | A process where goods are picked up from a single location and delivered to multiple destinations. |
status_updates | Boolean | No | The DP shares status updates of the manifested shipment in real time via push notifications or a pull method through the polling track API. |
Request
In the below given example request, a scheme is created for organization 66a0f176a257365a44f33d4c, intra-city deliveries using surface transport, applicable to shipments weighing between 1 kg and 10 kg. The scheme supports both COD and prepaid payment modes, with a delivery commitment of one day. Additional parameters, such as transport type, service region, and payment modes, are defined to ensure the scheme aligns with the business’s logistics requirements.
basicRouter.post('/scheme', async function view(req, res, next) {
try {
const partnerClient = await fdkExtension.getPartnerClient('66a0f176a257365a44f33d4c');
const response = await partnerClient.logistics.createCourierPartnerScheme({
"organizationId": organizationId,
"body": {
"extension_id": process.env.EXTENSION_API_KEY,
"scheme_id": "Scheme_id_126",
"name": "Scheme_name_126",
"weight": {
"lt": 10,
"gt": 1
},
"volumetric_weight": {
"lt": 10,
"gt": 1
},
"transport_type": "surface",
"region": "intra-city",
"delivery_type": "one-day",
"payment_mode": [
"COD",
"PREPAID"
],
"stage": "enabled",
"status_updates": "real-time",
"ndr_attempts": 1,
"qc_shipment_item_quantity": 1,
"non_qc_shipment_item_quantity": 1,
"feature": {
"doorstep_qc": true,
"qr": false,
"mps": false,
"ndr": false,
"dangerous_goods": true,
"fragile_goods": false,
"restricted_goods": false,
"cold_storage_goods": false,
"doorstep_exchange": false,
"doorstep_return": false,
"product_installation": false,
"openbox_delivery": false,
"multi_pick_single_drop": false,
"single_pick_multi_drop": false,
"multi_pick_multi_drop": false,
"ewaybill": 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 the successful creation of the scheme, providing details like the scheme name (Scheme_name_126
), its unique identifier (scheme_id: Scheme_id_126
), and timestamps for creation and modification. The response also highlights the scheme’s features, such as support for doorstep quality checks, and restrictions on fragile or cold storage goods, all of which are disabled in this case.
{
"volumetric_weight": {
"gt": 1,
"lt": 10
},
"modified_by": {
"id": "72ddedd773a2a3002223bf03"
},
"name": "Scheme_name_126",
"weight": {
"gt": 1,
"lt": 10
},
"delivery_type": "one-day",
"region": "intra-city",
"created_by": {
"id": "72ddedd773a2a3002223bf03"
},
"extension_id": "6777d5612f3ce766efa51482",
"created_on": "2025-01-06T12:01:01.052196",
"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": false,
"single_pick_multi_drop": false,
"mps": false
},
"modified_on": "2025-01-06T12:01:01.052196",
"payment_mode": [
"COD",
"PREPAID"
],
"company_id": "_all_",
"scheme_id": "Scheme_id_126"
}
Other Useful FDK Methods
When creating or managing schemes, you may find the following FDK methods helpful:
Get List of Created Schemes
This FDK methods allows you to retrieve a list of all schemes that have been created. It is useful for checking existing schemes. Refer to Get List of Created Schemes for the detailed instructions.
getCourierPartnerSchemes
Update Schemes
This FDK methods is used when you need to update any details of your existing schemes. Refer to Update Delivery Partner Scheme for the detailed instructions.
updateCourierPartnerScheme