Get all DP Accounts of a Company
This API retrieves a list of courier partner accounts (DP accounts) for a company. You can filter the results based on various criteria such as account stage, payment mode, transport type, self-ship status, and more.
The getCourierPartnerAccounts method allows you to fetch all delivery partner accounts associated with a company. Each account represents a configured courier partner setup that includes scheme details, shipping capabilities, and operational parameters.
Request
partnerRouter.get('/test_partner_route', async function view(req, res, next) {
try {
const platformClient = await fdkExtension.getPlatformClient(1);
const response = await platformClient.serviceability.getCourierPartnerAccounts({
"companyId": 123,
});
console.log(JSON.stringify(response))
res.json({ success: true });
} catch (err) {
console.error(err);
res.status(404).json({ success: false });
}
});
Response
The response to the API call is a JSON object containing an array of delivery partner (DP) accounts associated with the specified company. Each item in the "items" array represents a single account and includes extensive details such as the account_id, company_id, associated scheme_id, and various account metadata (e.g., stage, self-ship status, etc.).
This endpoint enables platform developers to fetch and review all courier accounts that have been set up for a given company, including comprehensive configuration and feature information for each scheme/account pairing.
{
"items": [
{
"account_id": "23",
"company_id": 123,
"scheme_id": "651ffcb8400bbc458aa4ac7d",
"extension_id": "651ffabb556007fa462c9c06",
"is_self_ship": true,
"stage": "enabled",
"is_own_account": true,
"scheme_rules": {
"scheme_id": "651ffcb8400bbc458aa4ac7d",
"extension_id": "651ffabb556007fa462c9c06",
"name": "Scheme 2",
"weight": {
"gte": 1,
"lte": 5
},
"transport_type": "surface",
"region": "intra-city",
"delivery_type": "hyperlocal",
"payment_mode": [
"COD",
"PREPAID"
],
"stage": "enabled",
"feature": {
"doorstep_qc": true,
"cold_storage_goods": true,
"dangerous_goods": true,
"restricted_goods": true,
"single_pick_multi_drop": true,
"fragile_goods": true,
"doorstep_return": true,
"ndr": true,
"mps": true,
"qr": true,
"openbox_delivery": true,
"multi_pick_single_drop": true,
"doorstep_exchange": true,
"multi_pick_multi_drop": true,
"ndr_attempts": 2,
"product_installation": true,
"status_updates": "real-time"
},
},
}
],
"page": {
"type": "number",
"size": 1,
"current": 1,
"has_next": false,
"has_previous": false,
"item_total": 1
}
}