Skip to main content

Search Destination

This API allows users to search for destination addresses based on a keyword. It returns a list of addresses matching the provided keyword.

Overview

The Search Destination Endpoint is designed to provide a fast and accurate way to find locations within the shipping system. This endpoint supports searching for various administrative levels, including:

  • City
  • District
  • Sub-District
  • Postal Code

By integrating this endpoint, users can easily retrieve precise location details without manually mapping regional hierarchies. This ensures greater flexibility and accuracy in defining both origin and destination areas.

Key Features

✅ Comprehensive Location Search – Supports multi-level search from provinces to sub-districts.
✅ Optimized for Efficiency – Fast response times without additional processing on the user’s side.
✅ Seamless Logistics Integration – Ensures accurate regional mapping for shipping cost calculations.
✅ Error Minimization – Reduces inconsistencies caused by mismatched regional data structures.

How it Works

The Search Destination Endpoint streamlines the process of finding and selecting locations within a shipping workflow. Instead of requiring users to manually filter through Province → City → District → Sub-district, the system automates the search and presents relevant location options based on input criteria.

Automatic Location Hierarchy Processing

  • Users can input search queries using City, District, Sub-district, or Postal Code.
  • The system automatically maps and retrieves related location data without additional configuration.

Precise & Reliable Data Retrieval

  • The response includes region IDs corresponding to the searched origin or destination.
  • Users receive a structured JSON response containing multiple location options to select from.

Seamless Transaction to Cost Calculation

  • Once a user selects a location, the region ID can be used in the Calculate Endpoint for shipping cost estimation.
  • This workflow ensures smooth data transition from location selection to shipping fee calculation.

Request Body

curl --location 'https://api-sandbox.collaborator.komerce.id/tariff/api/v1/destination/search?keyword=%2F%2Finput-location%2F%2F' \
--header 'x-api-key: //inputapikey//'

Query Parameter

Headers

KeyTypeDescription
x-api-key*stringthis Value contain an secret APIKEY identic for Shipping API

Query Parameters

KeyTypeDescription
keyword*stringThis parameter can be used to search for districts/subdistricts/villages/postcodes.
danger

For each header and parameter that has a * sign, it is a parameter that must be Required when making a request, otherwise there will be a system error that will warn the user regarding the request made.

Response

Response Structure

KeyValue (Description)
meta.messageResponse for searching address
meta.codeAny response have different code
meta.statusBoolean status for checking address
data.idUnique data for location
data.labelFull information about location
data.subdistrict_nameInformation about searching Subdistrict
data.district_nameInformation about searching District
data.city_nameInformation about searching City
data.province_nameInformation about searching Province
data.zip_codeInformation about searching Postal Code

Success Respons for Creating an Order

{
"meta": {
"message": "Sucessfully Get Destination Data",
"code": 200,
"status": "success"
},
"data": [
{
"id": 99999,
"label": "SUBDISTRICT, DISTRICT, CITY, POSTALCODE",
"subdistrict_name": "SUBDISTRICT",
"district_name": "DISTRICT",
"city_name": "CITY",
"province_name": "PROVINCE",
"zip_code": "POSTALCODE"
}
]
}

Error Respons for Creating an Order

example.json
{
"meta": {
"message": "Sucessfully Get Destination Data",
"code": 200,
"status": "success"
},
"data": []
}
warning

Our system may give a response as above because the actual search was successful, but the data being searched was not found, so the response will still be successful but will not show the data.

Error Code

CodeStatusDescriptionHow to Fix
401UnauthorizedAPI key invalid or missing from parameterMake sure your API key is valid using your Account
422Unprocessable EntityKeywoard parameter is missingAdd an valid keywoard parameter in your requested query. Parameter Request can't be null or missing
500---

Tips to Avoid Errors

  1. Always include the Authorization header with a valid token.
  2. Do not leave the keyword parameter empty — it’s required.
  3. Use the correct endpoint and query structure.

If you’re building a client or integrating this API, make sure to validate inputs on the frontend before sending the request. Let me know if you want help writing that validation!