Fetch Recommended Carriers: India [B2B]

Our recommendation API helps you decide amongst your available Carrier Partners, the best, most efficient, and dependable choice of delivery for any given package.

It makes these decisions based on historical data on shipping costs, RTO percentages, deliveries, delays, and other internal parameters in the user-specified location.

📘

This API contains the necessary modifications needed in the recommendation API to support B2B MPS usecases.

Overview

By entering the shipment details along with the drop and pickup Pincode, enterprises can determine the optimal carrier partner.

  1. Our recommendation API helps you decide amongst your available Carrier Partners, the best, most efficient and dependable choice of delivery for any given package.

  2. The enterprises can use the Recommendation API to trigger order creation/ order manifestation based on the API response

  3. Get the preference array of the carrier partner based on filters, Ordered List, Weightage feedback, and Load distribution. This can be configured in from the Clickpost Dashboard

  4. Help document to configure recommendation rules on Clickpost dashboard : https://clickpost.freshdesk.com/support/solutions/articles/43000764842


How to configure Recommendation Rules from Dashboard

Clickpost Dashboard > Home > Allocation > Allocation Rule

2866

Clickpost Dashboard > Home > Allocation > Allocation Rule

Usecase

This is a standard API which applies to B2B MPS (Multi-Piece Shipments) orders.

Geography

This is a standard API which supports all shipments created and transported within India.

❗️

NOTE

Serviceability supersedes Recommendation API. For example, if a particular Carrier Partner is not serviceable for a the Drop Pincode, then it will not feature in the preference array

Path

POST https://www.clickpost.in/api/v1/recommendation_api/?key=*****

Sample Payload


[
    {
        "reference_number": "12345",
        "pickup_location_code": "Bhiwandi-Wh01",
				"pickup_name": "Mr Ramesh",
        "drop_location_code": "Thane-Wh02",
        "pickup_city": "Bhiwandi",
				"is_restricted": "false",
        "drop_city": "Thane",
        "pickup_state": "Maharashtra",
        "drop_state": "Maharashtra",
        "pickup_address": "Plot No 17, XYZ Flyover, Bhiwandi",
        "drop_address": "Plot No 19, ABC Flyvoer, Thane",
        "zone": "WEST",
        "item_count": "100",
        "pickup_pincode": "110017",
        "drop_pincode": "110019",
        "invoice_value": 100,
        "weight": 100000,
        "delivery_type": "FORWARD",
        "order_type": "PREPAID",
        "boxes": [
            {
                "height": 50,
                "length": 40,
                "weight": 10000,
                "breadth": 30
            },
            {
                "height": 50,
                "length": 50,
                "weight": 10000,
                "breadth": 20
            }
        ],
        "additional": {
            "custom_fields": [
                {
                    "key": "destination_type",
                    "value": "DC"
                },
                {
                    "key": "source_location_code",
                    "value": "32140080"
                },
                {
                    "key": "destination_location_code",
                    "value": "R741"
                }
            ]
        }
    }
]

Request Payload

Field NameData TypeFieldDescriptionMax LengthExample
pickup_pincodestringMandatoryThe pickup pincode where the shipment needs to be picked up"110001"
drop_pincodestringMandatoryThe drop pincode where the shipment needs to be delivered"380001"
invoice_valuefloatMandatoryThe invoice value of the shipment in INR. This field becomes mandatory if enterprise wants to calculate PRICING If there are multiple invoices in the same shipment then please send the sum of invoice values of all invoices.200.75
weightfloatOptionalThe weight of the shipment in grams. This field becomes mandatory if enterprise wants to calculate shipping_charge2.75
delivery_typeenumMandatoryThe order type for which serviceability needs to be determined. Enter FORWARD if the shipments need to be delivered to the customer from the enterprise's warehouse. Enter RVP if the shipment needs to picked up from the customer’s location and delivered to the enterprise’s warehouseFORWARD
reference_numberstringMandatory

The reference number for the API request. It has to be unique for each API request.

NOTE: As a best practice, please ensure that the reference number for Recommendation and Order Creation is the same

"REF#123"
order_typeenumMandatoryThe order type for the particular shipment
  1. PREPAID
  2. COD
"PREPAID"
item_countintegerOptionalThe sum of the number of items inside a box across all boxes of the shipment2
pickup_cityStringOptionalCity of the pickup location
drop_cityStringOptionalCity of the drop location
pickup_addressStringOptionalPickup address of the pickup location
drop_addressStringOptionalDrop address of the pickup location
zoneStringOptionalZone as per the pickup and drop pincode
pickup_location_codeStringOptionalLocation code of the pickup location as per the location master
drop_location_codeStringOptionalLocation code of the drop location as per the location master
pickup_stateStringOptionalState of the pickup location
drop_stateStringOptionalState of the drop location
boxesArrayOptionalAn array of box objects containing height, length, breadth (in cms) and weight (in grams) of each box
This data becomes mandatory to calculate shipping charge.
is_restrictedStringOptionalWhether the Shipment contains any restricted items or not. Possible values- TRUE or FALSE

additional [additional parameters] [optional]

Field NameData TypeFieldDescriptionMax LengthExample
additionalJSON OBJECTOptionalThe JSON Object of the additional parameter{
"custom_fields": [{
"key": "ptl_or_ftl",
"value": "PTL"
}, {
"key": "truck_size",
"value": "14 feet"
}
keystringOptionalThe enterprise defined field's key. Enterprise can define keys on the dashboard so that the system tunes the recommendations according to the value provided (see value below). This will come into picture if enterprise wants to set Enterprise defined allocation rules."Customer_Type"
valuestringOptionalThe enterprise defined field's value. This field encapsulates the value of the key defined on the dashboard (see key above). This will come into picture, if enterprise want to set Enterprise defined allocation rules"Prime Customer"

Response

meta [meta parameters]

Field NameData TypeDescriptionExample
successBooleanIndicates the success of the API requesttrue
messageStringThe message from clickpost. In case of success it will be "SUCCESS". In case that there are no carrier partners that are servicing the pincodes it will be”Pin code not serviceable""SUCCESS"
statusHTTP CodeThe HTTP response status code of the API request200

result [result parameters]

Field NameData TypeDescriptionExample
preference_arrayarrayThe preference list of eligible carrier partners[
{
"cp_name": "Delhivery",
"cp_id": 4,
"account_code": "Delhivery_Surface_B2C",
"async": false,
"account_id": 186908,
"priority": 1,
"scores_computation": {
"scoring_params": {
"PRICING": 57.11,
"zone": "METRO"
},
"total_score": 57.11
},
"shipping_charge": 57.11
},
{
"cp_name": "XpressBees",
"cp_id": 6,
"account_code": "Xpressbees_Surface",
"async": false,
"account_id": 187017,
"priority": 2,
"scores_computation": {
"scoring_params": {
"PRICING": 59.97,
"zone": "ROI"
},
"total_score": 59.97
},
"shipping_charge": 59.97
}
cp_nameStringThe name of the carrier partnerDelhivery
cp_idnumCarrier Partner ID. This can be found on the dashboard or you can refer it to here4
account_codestringCourier partner account name configured on the Clickpost dashboard"Delhivery_Surface_B2C"
asyncBooleanWhether the carrier partner supports asynchronous order creation or notfalse
account_idnumThe identifier for the particular account configured under the carrier partner186908
prioritynumThe priority of the carrier partner, this will be according to the Allocation rule set up by the enterprise on the Clickpost dashboard1
scores_computationJSON ObjectThe scoring of the carrier partner{
"scoring_params": {
"PRICING": 57.11,
"zone": "METRO"
},
"total_score": 57.11
}
scoring_paramsJSON ObjectThe scoring parameters on which carrier partners are to be ranked{
"PRICING": 57.11,
"zone": "METRO"
}
PRICINGnumThe pricing of the carrier partner57.11
zoneStringThe zone which has been mapped with pincodes on the clickpost dashboard under the courier integration section.This can be configured in the Pricing section in courier partner account configuration section. (Settings>Courier>Integrations>Accounts> Configuration > Pricing)"METRO"
total_scorenumThe total score for the particular carrier partner57.11
shipping_chargenumThe total shipping charge that the carrier partner will charge for the particular shipment57.11
filters_ranJSON ObjectThe JSON object of all the filters that have applied"filters_ran": {
"1_active_accounts_filter": [],
"2_serviceable_accounts_filter":[],
"2_1_serviceable_oda_accounts_filter": [],
3_clickpost_define_and_custom_filters_accounts: [], 4_ordered_list_account_names_filters_applied: false, ordered_list_filter_accounts: [] }
1_active_accounts_filterarrayThe list of active carriers that are there on Clickpost account[
"Delhivery_Surface_Heavy(Delhivery(186909))",
"Delhivery_Surface_B2C(Delhivery(186908))",
"Delhivery_Express_B2C(Delhivery(186907))",
"Delhivery_Surface_Bulk(Delhivery(186915))",
"Porter_criticallog(CriticalLog(187713))",
"Xpressbees_Surface(XpressBees(187017))",
"Xpressbees_Express(XpressBees(187306))", "EcomExpress_Surface(EcomExpress(187019))",
"Ekart_Surface(Ekart Logistics(187018))"
]
2_serviceable_accounts_filterarrayThe list of serviceable carrier partners for the particular pickup and drop pincode[
"Delhivery_Surface_Bulk(Delhivery(186915))",
"Xpressbees_Surface(XpressBees(187017))",
"Delhivery_Express_B2C(Delhivery(186907))",
"Delhivery_Surface_B2C(Delhivery(186908))",
"Delhivery_Surface_Heavy(Delhivery(186909))"
]
2_1_serviceable_oda_accounts_filterarray

Sample Response

"meta": {
"success": true,
"message": "SUCCESS",
"status": 200
},
"result": [
{
"preference_array": [
{
"cp_name": "Bluedart B2B",
"cp_id": 496,
"courier_name": "Bluedart",
"account_code": "Test_BD",
"async": false,
"account_id": 1012057,
"priority": 1,
"scores_computation": {},
"shipping_charge": null,
"delivery_type": "FORWARD",
"awb_number": "6666777191",
"preassigned_awb_flow": "MASTER_AND_CHILD_DERIVED",
"mode_of_shipment": "SURFACE"
}
],
"filters_ran": {
"1_active_accounts_filter": [
"marks_bluedart(Bluedart B2B MPS(1009477))",
"marks_vxpress(Vxpress B2B(1007653))",
"marks_Ekart_surface(Ekart B2B Apptmyz(1012074))",
"Lg_logistics(Self FTL(1007830))",
"marks_xb(XpressBees Cargo MPS [B2B](1010092))",
"marks_bluedart_Air(Bluedart B2B MPS(1011326))",
"marks_vxpress_air(Vxpress B2B(1011327))",
"marks_xb_air(XpressBees Cargo MPS [B2B](1011328))",
"marks_mudita(Mudita B2B(1012057))",
"marks_mudita_air(Mudita B2B(1012066))"
],
"1_accounts_out_of_threshold": [],
"1_blacklisted_accounts": [],
"2_serviceable_accounts_filter": [
"marks_mudita(Mudita B2B(1012057))"
],
"2_1_serviceable_oda_accounts_filter": [
"marks_mudita(Mudita B2B(1012057))"
],
"3_clickpost_filters_rules_list": [],
"3_clickpost_define_and_custom_filters_accounts_applied": false,
"3_clickpost_define_and_custom_filters_accounts": [],
"accounts_after_load_distribution_filter": [],
"priority_list_account_names": [
"marks_mudita(Mudita B2B(1012057))"
],
"order_list_matched_rule": "Test_preassign",
"4_ordered_list_rules_list": [
{
"sequence": 1,
"rule_name": "Test_preassign",
"rule_priority": 2,
"has_serviceable_accounts": true
}
],
"4_ordered_list_account_names_filters_applied": true,
"ordered_list_filter_accounts": [
"marks_mudita(Mudita B2B(1012057))"
]
},
"pincode_serviceable": true,
"return_serviceable_accounts": true,
"username": "test-b2b",
"reference_number": "Test_preassign"
}
]
}

Did this page help you?