RajaOngkir EndPoint
Overview
Komerce integrates with the RajaOngkir API to support domestic and international shipping functionalities. Through this integration, developers can access a comprehensive set of logistics features, including destination search, shipping cost calculations, and airwaybill tracking, both for local and cross-border deliveries.
This API is especially useful for businesses that want to:
- Automatically retrieve supported shipping destinations across Indonesia and globally.
- Calculate accurate shipping fees based on package weight, dimensions, and courier selection.
- Track packages in real-time using airwaybill numbers.
- Integrate shipping cost estimation into their checkout or logistics operations workflow.
By centralizing these logistics operations through the RajaOngkir integration, developers can simplify shipping logic while delivering more transparency and better service to end customers.
Base URL
This is the Live Environment where real shipping rate calculations Indonesia or International and also checking history AWB.
https://rajaongkir.komerce.id/api/v1/
⚠️ Make sure to use the correct Base URL for environment. RajaOngkir API Service's won't work if you use wrong URL.
EndPoint
We provide information for each path of the Endpoint that can be used in the RajaOngkir API service as follows, please note that errors in the use of EndPoint paths can have an impact on errors in requests made by users:
Name | Path | Method | Description |
---|---|---|---|
Search Domestic Destination | destination/domestic-destination | GET | for Search origin or destination id in Indonesia Region |
Search International Destination | destination/international-destination | GET | for Search destination id in World Wide |
Calculate Domestic | calculate/domestic-cost | POST | for Search estimated shipping cost by origin and destination in Indonesia |
Calculate International | calculate/international-cost | POST | for Search estimated shipping cost by origin and destination World Wide |
Tracking AWB | track/waybill | POST | for Checking History AWB |
Best Practices
To ensure a smooth and effective integration with the RajaOngkir API, we recommend the following best practices:
🔐 Always Authenticate Your Requests : Ensure your APIKEY is included in every request header. Unauthorized requests will be rejected.
📦 Validate Inputs Before Request : Double-check that required fields (like origin, destination, courier, weight) are correctly filled before calling the cost or tracking endpoints. Invalid inputs may cause errors or inaccurate results.
🧠 Cache Static Data : Static data such as province lists or courier names rarely changes. Cache them locally to avoid unnecessary API calls and improve performance.
⏱ Use Debouncing for Destination Search : When implementing live search for destinations, debounce user input to limit request frequency. This prevents flooding the API and improves user experience.
🔁 Handle API Errors Gracefully : Check for HTTP status codes and use fallback messages to guide users when something goes wrong.