Overview

Using the Predict API

2min
api endpoint the primary function of the predict endpoint is to generate an rto risk score based on order details refer to the table below for the list of parameters parameter data type description example cl string the registered client name with delhivery abc surface order id string unique identifier of the order being placed or already placed abc 126 fba order date string date of when the order was already placed or is being placed 12 05 2023 order value number($float) total value if the order in rs including discount 1024 total discount number($float) discount given on the purchase 200 total line item quantity number($float) quantity of all line items in the order 2 line items list all line items in an list line items item id string the id of the item ajio smh smj line items product description string the product description of the line item green tshirt line items item colour string the colour of the item green line items item quantity integer quantity of a particular line item in the order 1 line items item discount number($float) discount of the item 0 line items item price number($float) price of the item 524 seller origin city string pickup city of the order bhiwandi seller origin pincode string pickup pincode of the seller 410889 seller pickup location string the pickup location of the order promised delivery date string promised delivery date by logistics partner 22 08 2023 shipping address dictionary the dictionary of details for the shipping address first name string first name of the consignee first name last name string last name of the consignee last name address1 string address line 1 of the consignee plt4 sec44 address2 string address line 2 of the consignee city string city of the consignee ggn state string state of the consignee haryana pincode string pincode of the consignee 122003 billing address dictionary the dictionary of details for the billing address first name string first name of the consignee first name last name string last name of the consignee last name address1 string address line 1 of the consignee plt4 sec44 address2 string address line 2 of the consignee city string city of the consignee ggn state string state of the consignee haryana pincode string pincode of the consignee 122003 ph no string phone number of the consignee 9999999999 customer dictionary the dictionary of details for the customer customer ip string ip of the customer 192 168 0 1 customer browser string browser used by the customer chrome new customer string whether the order is from a new customer or an existing customer 1 device type string whether the order has been placed via a mobile, tab or laptop laptop gender string gender of the customer f please refer to the table below while inferring the api response field type description status code number status code of the request request id string the unique id for the request message string information about the processed request data object the object that contains the predict api results data rto score float risk score which indicates the likelihood of rto data additional info dict additional info which will help in contextualizing the rto score this would include relative rto risk, probable reason for rto this will be populated in later versions of the api error object will include the error details in case of unsuccessful response error type string type of error encountered error message string message detailing the error the following example request returns an rto score of 0 43 { "order" { "cl" "abc surface", "order id" "abc 126 fba", "order date" "10 09 2023", "order value" 1, "total discount" 1, "total line item quantity" 2 }, "line items" \[ { "item id" "12", "product description" "green tshirt", "item colour" "green", "item quantity" 1, "item discount" 0, "item price" 524 }, { "item id" "", "product description" "jeans", "item colour" "blue", "item quantity" 1, "item discount" 100, "item price" 800 } ], "seller origin city" "1234", "seller origin pincode" "410889", "seller pickup location" "", "promised delivery date" "23 10 2023", "shipping address" { "first name" "first name", "last name" "last name", "address1" "plt 4 sec44", "address2" "", "city" "ggn", "state" "haryana", "pincode" "122017" }, "billing address" { "first name" "first name", "last name" "last name", "address1" "sd", "address2" "", "city" "ggn", "state" "haryana", "pincode" "122000" }, "customer" { "customer ip" "", "customer browser" "", "new customer" "1", "device type" "laptop", "ph no" "9999999999", "gender" "f" } }{ "status code" 200, "request id" "rto pred|a45cce4f 6baa 476c 9975 46748cec3f21", "message" "success", "data" { "rto score" 0 43, "additional info" {} }, "error" null }