Skip to main content

Search International Destination

Overview​

The Search International Destination endpoint is used to retrieve destination data for international shipments via the RajaOngkir integration. This feature enables merchants and systems to dynamically search and select destination countries outside of Indonesia, which is a key requirement for international shipping calculations and logistics workflows.

This endpoint is highly useful for e-commerce checkout systems, B2B platforms, or any application that needs to calculate or prepare international deliveries.

Key Feature​

  • 🌍 Supports Global Shipping
    Search for international destinations in various countries worldwide.

  • 🚚 Seamless Integration with Cost Calculation
    Returned destination_code can be used directly with cost calculation endpoints.

  • πŸ“¦ Ready for International Logistics
    Helps users accurately fill shipping forms for overseas deliveries.

How it Works​

  1. Make a POST request to the endpoint with a value:

    • Value can include country names (e.g., "japan").
  2. The API returns a list of matched locations, including:

    • Country name, and a unique Country id for each.
  3. Use the conutry_id in subsequent calls to the calculate/international-cost endpoint or when creating international shipment requests.

Request Body​

curl --location --globoff 'https://rajaongkir.komerce.id/api/v1/destination/international-destination?search={{%20search_region%20}}&limit=99&offset=99' \
--header 'key: inputapikey'

Query Parameter​

Headers​

KeyTypeDescription
key*stringthis Value contain an secret APIKEY identic for Shipping Cost API

Query Params​

KeyTypeDescription
search*stringThis parameter is used to search for the intended area, only can search the nation name.
limitintThe maximum number of rows (or records) to be returned by the query.
offsetintThis is often used with LIMIT to limit query results in "pages" or "sections".
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[].country_idA uniqe id that is used as a parameter in the shipping cost.
data[].country_nameName of the search nation

Success Respons for Search Internation Destination​

{
"meta": {
"message": "Success Get International Destination",
"code": 200,
"status": "success"
},
"data": [
{
"country_id": "{{ country_id }}",
"country_name": "{{ country_name }}"
}
]
}

Error Respons for Search International Destination​

{
"meta": {
"message": "International Destinations Data not found",
"code": 404,
"status": "error"
},
"data": null
}

Error Code​

CodeStatusDescriptionHow to Fix
200Success
404ErrorInternational Destinations Data not foundMake sure the nation name you are looking for is correct.
422ErrorParameter MissingMake sure the required parameters are given when requesting data.
500ErrorServer Error

Tips to Avoid Error​

  • βœ… Provide a meaningful search
    Avoid empty strings or irrelevant characters; use proper nation names.
  • πŸ” Include valid authorization
    Always add your key in the header.
  • ⌨️ Implement frontend input validation
    For best results, guide users to enter country names.
  • ⚠️ Use debounce for live search
    Prevent too many API calls by throttling or debouncing input.
  • πŸ›  Gracefully handle β€œno results”
    Show friendly messages if the API returns an empty list due to unrecognized keywords.