Skip to main content

Create Account

Description

An account is combination of a scheme and a company ID and it is unique for every seller against a scheme they choose. When a seller installs an extension and subscribes to it, then the combination becomes an account. An account serves as a placeholder for the company ID, and all data related to serviceability, such as TAT, rate card, and capabilities are stored against the scheme. For a given account, DP needs to take input of the account credentials from the seller through the UI of the extension they build to verify and keep track of the contracts, charges and usage of the services by a seller.

The createCourierPartnerAccount FDK method is creates a unique account for a seller against a specific scheme when the seller enables and configures an extension. This account will be used to track contracts, service usage, and charges.

Request

In the below given example request, an account is created for a seller (identified by companyId: 8948) linked to the specified scheme (scheme_id: Scheme_id_126). The account_id, a combination of the scheme and company ID, ensures the uniqueness of this seller-scheme pairing.

basicRouter.post('/create_seller_account', async function view(req, res, next) {
console.log("---------------------------------------------")
console.log("basicRouterr.post.create_seller_account")
try {
const partnerClient = await fdkExtension.getPartnerClient('66a0f176a257365a44f33d4c');
const response = await partnerClient.logistics.createCourierPartnerAccount({
"organizationId": organizationId,
"companyId": 8948,
"body": {
"extension_id": process.env.EXTENSION_API_KEY,
"account_id": "Scheme_id_126_company_id_8948",
"scheme_id": "Scheme_id_126",
"is_self_ship": false,
"stage": "enabled",
"is_own_account": true
}
});
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 account creation by returning key details such as the account_id, scheme_id, and associated metadata like creation and modification timestamps. It also includes information about the developer who created and modified the account.

{
"company_id": 8948,
"modified_by": {
"first_name": "Logistics_DX104",
"account_type": "system",
"phone_numbers": [],
"updated_at": "2025-01-03T12:17:37.147Z",
"username": "6777d5612f3ce766efa51482",
"firstName": "Logistics_DX104",
"__v": 0,
"debug": {
"platform": "000000000000000000000001",
"source": "grimlock"
},
"active": true,
"emails": [],
"created_at": "2025-01-03T12:17:37.147Z",
"accountType": "system",
"updatedAt": "2025-01-03T12:17:37.147Z",
"status": "active",
"last_name": "Extension Client",
"uid": "23559843",
"password_last_modified": "2025-01-03T12:17:37.147Z",
"password_history": [],
"meta": {
"client_id": "6777d5612f3ce766efa51482",
"client_type": "extension"
},
"lastName": "Extension Client",
"gender": null,
"_id": "72ddedd773a2a3002223bf03",
"phoneNumbers": [],
"createdAt": "2025-01-03T12:17:37.147Z"
},
"scheme_id": "Scheme_id_126",
"account_id": "Scheme_id_126_company_id_8948",
"stage": "enabled",
"is_own_account": true,
"created_by": {
"first_name": "Logistics_DX104",
"account_type": "system",
"phone_numbers": [],
"updated_at": "2025-01-03T12:17:37.147Z",
"username": "6777d5612f3ce766efa51482",
"firstName": "Logistics_DX104",
"__v": 0,
"debug": {
"platform": "000000000000000000000001",
"source": "grimlock"
},
"active": true,
"emails": [],
"created_at": "2025-01-03T12:17:37.147Z",
"accountType": "system",
"updatedAt": "2025-01-03T12:17:37.147Z",
"status": "active",
"last_name": "Extension Client",
"uid": "23559843",
"password_last_modified": "2025-01-03T12:17:37.147Z",
"password_history": [],
"meta": {
"client_id": "6777d5612f3ce766efa51482",
"client_type": "extension"
},
"lastName": "Extension Client",
"gender": null,
"_id": "72ddedd773a2a3002223bf03",
"phoneNumbers": [],
"createdAt": "2025-01-03T12:17:37.147Z"
},
"created_on": "2025-01-09T05:58:18.765183",
"modified_on": "2025-01-09T05:58:18.765226",
"is_self_ship": false,
"extension_id": "6777d5612f3ce766efa51482"
}

Other useful APIs

Update Account

It is used to update account data. Refer to Update Account for more details.

Getting Account List of a Company

This API is used to get accounts of a company. Refer to Update DP Account for more details.

Status of a Company

This API is used to get account of a company from database. Refer to Update DP Account in Database for more details.


Was this section helpful?