District Calculate Cost
https://rajaongkir.komerce.id/api/v1/calculate/district/domestic-cost
The Calculate Domestic Cost by District Endpoint is the final and most critical step in the hierarchical location selection process of the RajaOngkir API. This endpoint calculates the shipping cost between two districts within Indonesia based on selected courier services, package weight, and other parameters.
By leveraging the origin and destination district IDs obtained from previous steps, this endpoint returns real-time shipping rates from multiple couriers. It enables users to compare prices, estimate delivery fees, and make informed choices during checkout or logistics planning.
This endpoint is essential for e-commerce platforms, marketplace systems, delivery apps, and logistics tools that require automated, up-to-date cost calculations tailored to user-selected locations and shipping preferences.
Endpoint Details
-
Method:
POST -
Base URL:
https://rajaongkir.komerce.id/api/v1/calculate/district/domestic-cost -
Content-Type:
application/x-www-form-urlencoded -
Description:
Calculates domestic shipping costs between two Indonesian districts using the selected couriers and package weight. The result includes shipping options, estimated delivery times, and total fees from multiple courier services.
This endpoint is the final step in the Step-by-Step Method integration flow, utilizing all previously gathered location data to provide accurate, courier-specific shipping cost estimations.
Request Body
curl --location 'https://rajaongkir.komerce.id/api/v1/calculate/district/domestic-cost' \
--header 'key: YOUR_API_KEY' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'origin=1391' \
--data-urlencode 'destination=1376' \
--data-urlencode 'weight=1000' \
--data-urlencode 'courier=jne:sicepat:ide:sap:jnt:ninja:tiki:lion:anteraja:pos:ncs:rex:rpx:sentral:star:wahana:dse' \
--data-urlencode 'price=lowest'