Calculate International Cost

Overview

The Calculate International Cost endpoint allows users to get shipping rates for international deliveries by specifying Indonesian origin, destination country, weight, courier, and price. This is useful for merchants or platforms that ship products overseas and need to provide accurate shipping costs to end customers before checkout.

This endpoint helps users compare multiple courier options based on price and estimated delivery time for international shipments.

Key Feature

  • 🌍 Supports International Shipping Calculation
  • 📦 Based on Weight, Origin City, and Destination Country
  • 🚚 Courier Selection Flexibility
  • 💰 Returns Pricing and Estimated Delivery Time

How it Works

  1. The client sends a POST request with required information
  2. RajaOngkir API processes the request using international rate database.
  3. A list of shipping options is returned.

Request Body

curl --location 'https://rajaongkir.komerce.id/api/v1/calculate/international-cost' \ --header 'key: inputapikey' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'courier={{ courier }}' \ --data-urlencode 'origin={{ origin_id }}' \ --data-urlencode 'destination={{ destination_id }}' \ --data-urlencode 'weight={{ weight }}' \ --data-urlencode 'price={{ sort_price }}'

Query Parameter

Headers

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

Body x-www-form-urlencode

KeyTypeDescription
origin
*
int
this Value containt an
id
during Search International Destinations
destination
*
int
this Value containt an
id
during Search International Destinations
weight
*
int
this Value containt an a package weight with grams estimated
courier
*
string
this Value contain an Courier Name
price
boolean
this Value Contain an boolean value, lowest or highest shipping cost
 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.message
Response for searching address.
meta.code
Any response have different code.
meta.status
Boolean status for checking address.
data[].name
Information about availability Courier Name
data[].code
Information about availability Code of Courier
data[].service
Information about availability Service of Courier
data[].description
Description about Courier
data[].currency
Information about availability Currency of Courier
data[].cost
Information about Courier Service Cost
data[].etd
Information about estimated time of courier delivery
data[].currency_updated_at
Information about Updated time for Currency Value
data[].currency_value
Information about Currency Kurs Updated

Success Respons for Searching International Cost

{ "meta": { "message": "Success Calculate International Shipping Cost", "code": 200, "status": "success" }, "data": [ { "name": "{{ courier.name }}", "code": "{{ courier.code }}", "service": "{{ courier.service }}", "description": "{{ courier.desc }}", "currency": "{{ availability.currency }}", "cost": {{ shipping_cost }}, "etd": "{{ estimated_time_delivery }}", "currency_updated_at": "{{ information_updated_currency }}", "currency_value": {{ currency_kurs }} } ] }

Error Respons for Searching International Cost

{ "meta": { "message": "{{ message }}", "code": {{ code }}, "status": "{{ status }}" }, "data": null }

Status Code

CodeStatusDescriptionHow to Fix
200
Success
400
Error
Calculate International Shipping Cost not found
This error is unavoidable because the courier may not be able to provide the desired data.
400
Error
Missing Params
Make sure the request parameters that are sent match the required parameters.
422
Error
Invalid Courier
Make sure the courier code entered is correct according to the courier code guide available for checking.

Tips to Avoid Error

  • ✅ Ensure the
    origin
    id
    is correct — use the RajaOngkir Search Destination endpoint to get a valid
    id
    .
  • 🌐 Use a valid country code for the
    destination
    .
  • ⚖️ Weight is mandatory and should be greater than zero (in grams).
  • 🚫 Courier must support international shipments — not all couriers are available.
  • 🛡️ Authenticate with the correct API Key or the request will be rejected.