Pincode Serviciability Flow:
Final Columns will be in existing table: courier_partners
cp_id | courier_name | courier_account | minWeight | maxWeight | minLength | maxLength | minHeight | Maxheight | minWidth | maxWidth | express | heavy | standard | hyperlocal |
New Table : account_courier_mapping
id | account_id | courier_partner_id | status |
API First: accessToken to be passed in headers
POST API : /api/check/serviceability
POST API : raymond.myeshopbox.com/api/pincodeserviceability
{{workspaceSlug}}.myeshopbox.com/api/pincodeserviceability
do not ask access token, use account slug
{
"dropPincode": "121001",
"pickupPincode" : "121001",
"deadWeight" : 1.2,
"length" :120,
"height" :3,
"width" :12,
"isCod" :"1"
}
get account_id from accountSLug passed in API (proxyHost ). caching will be used to store account details againts account slug : cachekey : account_details_{accountSlug} : {account obj}
2. we will get list of couriers from courier_partners based on the min or max dimensions falling.
3. now fetch active courier partners from account_courier_mapping , account id will get get from account slug and courier_partner_id will get from the step 2.
4. call clickpost pincode serviciability API : https://clickpost.github.io/slate/#serviceability-v2-api
now check if couriers from step 3 exist in step 4 API response then return the matching courier with name as : eshopbox standard , eshopbox express etc.
API 2:
POST API : /api/check/product/serviceability
{
"dropPincode": "121001",
"productId" : "9898786876866"
}
STEP 1: get the nearest active location with inventory avail for the given product and prepare PickupPincode
and get dimensions of product by product API
STEP 2 : rest flow will be same AS First API.
Sample Response will be :
{
"result": [
{
"account_code": "Xpressbees Surface",
"courierName" : "Eshopbox standard",
"comitted_sla": null,
"serviceable": {
"EXCHANGE": false,
"PICKUP": true,
"COD": true,
"PREPAID": true
},
"zone" : "local"
},
{
"courierName" : "Eshopbox Express",
"account_code": "Delhivery Express",
"comitted_sla": null,
"serviceable": {
"EXCHANGE": false,
"PICKUP": true,
"COD": true,
"PREPAID": true
},
"zone" : "local"
}
]
}
MOM Points:
do not use account courier mapping. Show response direct from clickpost.
project: project used for Inventory allocation