Delivery Modes

This API returns eligible delivery modes (Hyperlocal, SDD, NDD, Standard) for given pickup and drop locations based on the system setup/configuration.

Prerequisites

  • The enterprise must be subscribed to the service.
  • The following configuration must be present in the ClickPost system:
    • Store Master Configuration
    • Store ↔ Courier Mapping
    • Serviceable boundaries defined at store-courier account level
    • To get the delivery ETA for the serviceable pickup store(s), ETA configuration for store-courier boundaries must be present
    • For the standard serviceability to be calculated - following configuration must be present:
      • Pincode level serviceability to be configured for the carrier.
      • Pincode level SLA to be uploaded for the carrier.
    • For more details regarding EDD configurations, please refer to the EDD Configuration section in the Quickcommerce Unified Serviceability API prerequisites: View EDD Configuration Prerequisites.

Note: Contact the ClickPost team for assistance with setup.

Note

  • Stores that are not operational (i.e., outside their configured operating hours) will be excluded from the API response.
  • By default, the Delivery Modes API uses SLA as its default data source. If SLA data is unavailable, the configured fallback mechanism checks for EDD data and uses it when available, and vice versa. Moreover, If you wish to change the primary data source from SLA to EDD, please contact the ClickPost team for assistance with the configuration.
  • For more details regarding Standard Delivery EDD responses, please refer to the Unified Serviceability Notes.

Allowed HTTP Methods

  • POST

URL

<baseURL>/api/v1/delivery_modes

baseURL - https://hld.clickpost.in

Headers

{
	"Content-Type": "application/json"
}

URL Query Parameters

ParameterTypeRequiredDescription
keystringYesClickPost API key used for authentication.

Sample API cURL

curl -X POST "<baseURL>/api/v1/delivery_modes?key=<API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "drop_pincode": "110094",
    "drop_latitude": 12.123421,
    "drop_longitude": 13.3223223,
    "pickup_pincodes": [
        "560055",
        "302017",
        "400070",
        "560048",
        "110078"
    ],
    "pickup_store_ids": [
        "store_1",
        "store_2",
        "store_3"
    ]
}'

Request Payload

Field NameData TypeFieldDescription
drop_latitudedoubleConditional MandatoryThe latitude of the drop location
drop_longitudedoubleConditional MandatoryThe longitude of the drop location
drop_pincodeStringConditional MandatoryThe pincode of the drop location
pickup_pincodesString[]Conditional MandatoryList of pincodes of the pickup location; Required when drop pincode is provided.
pickup_store_idsString[]Conditional MandatoryList of pickup store ids; Required when drop latitude and longitude are provided.
reference_numberStringOptionalAn optional unique identifier provided by the caller/source for a request. It can be used to trace and correlate the request across logs and systems.

For Pickup Location: Either drop_latitude and drop_longitude, or drop_pincode must be provided. Both options may also be supplied together.

For Drop Location: Either pickup_pincodes or pickup_store_ids must be provided. Both options may also be supplied together.

Sample Request Payload

{
    "reference_number":"sample_reference_1",
    "drop_pincode": "110094",
    "pickup_pincodes": [
        "560055",
        "302017",
        "400070",
        "560048",
        "110078"
    ],
    "drop_latitude": 12.123421,
    "drop_longitude": 13.3223223,
    "pickup_store_ids": [
        "store_1",
        "store_2",
        "store_3"
    ]
}

Response JSON Format

Field NameData TypeDescriptionValue Constraints
metaJSON ObjectMetadata about the request, such as status codes and messages describing success or errors. Refer Possible Meta Statuses section below.cannot be null
resultJSON ArrayThe list of serviceable_store objects. Empty if no serviceable stores found.can be null or string if meta.success is false

meta object fields

Field NameData TypeDescriptionValue Constraints
messageStringHuman-readable message indicating success or describing the error.can be null or empty
statusintegerStatus code representing the result of the request (may include standard HTTP status codes).cannot be null
successbooleanIndicates whether the request was processed successfully (true) or not (false).cannot be null

result object fields

Field NameData TypeDescriptionValue Constraints
hyperlocalJSON ObjectContains key-value pairs mapping each store_id to its corresponding delivery ETA (in minutes). If there are multiple carriers per store, it will return the maximum ETA amongst all the carriers for the given store.can be empty
sddString[]Identifies the pickup pincodes from which Same Day Delivery is available.
Logic: SLA or EDD whichever configured at a carrier <>account level for a given pickup and drop pincode combination is equal to 0.
can be empty
nddString[]Identifies the pickup pincodes from which Next Day Delivery is available.
Logic: SLA or EDD whichever configured at a carrier <>account level for a given pickup and drop pincode combination is equal to 1.
can be empty
standardString[]Identifies the pickup pincodes from which Standard Delivery is available.
Logic: SLA or EDD whichever configured at a carrier <>account level for a given pickup and drop pincode combination is more than 1.
can be empty
request_idStringThe unique request identifier generated by ClickPost for each API request, used for tracing and debugging logs.cannot be null
sourceStringIdentifies the data source used for calculation. Possible values are :
  • SLA
  • EDD.
cannot be null

Possible Meta Statuses

HTTP Status Codemeta.statusmeta.message
200200Request is executed successfully
4004001Invalid request json
4004002Request for invalid entity
4004003Invalid or missing query parameter
4004005User is not subscribed to the service
4014013Invalid API key
403403Access is not allowed
4044007API Not Found
500500Something went wrong in Clickpost server

Example Responses

Sample Success Response

{
    "result": {
        "hyperlocal": {
            "store_1": 75,
            "store_3": 40
        },
        "sdd": [
            "302017",
            "560048"
        ],
        "ndd": [],
        "standard": [
            "560055",
            "110078"
        ],
        "source": "SLA",
        "request_id": "8668f578-35bd-4a54-8bb2-329e4376e9a5"
    },
    "meta": {
        "status": 200,
        "success": true,
        "message": "Request is executed successfully"
    }
}

Sample Error Response

{
  "result": "Both drop_latitude and drop_longitude must be provided together",
  "meta": {
    "status": 4001,
    "success": false,
    "message": "Invalid request json"
  }
}

Did this page help you?