API Documentation for RajaOngkir Pro Account
This documentation explains how to access RajaOngkir’s API services for Pro accounts. Pro accounts are premium RajaOngkir accounts with the most complete features, including checking shipping costs up to the sub-district level.
Province
Summary
The “province” method is used to retrieve a list of provinces in Indonesia.
Request
URL:
GET https://pro.rajaongkir.com/api/province
Response
Successful Response
{
"rajaongkir": {
"query": {
"id": "12"
},
"status": {
"code": 200,
"description": "OK"
},
"results": {
"province_id": "12",
"province": "Kalimantan Barat"
}
}
}
City
Summary
The “city” method is used to retrieve a list of cities/districts in Indonesia.
Request
URL:
GET https://pro.rajaongkir.com/api/city
Response
Successful Response
{
"rajaongkir": {
"query": {
"province": "5",
"id": "39"
},
"status": {
"code": 200,
"description": "OK"
},
"results": {
"city_id": "39",
"province_id": "5",
"province": "DI Yogyakarta",
"type": "Kabupaten",
"city_name": "Bantul",
"postal_code": "55700"
}
}
}
Subdistrict
Summary
The “subdistrict” method is used to retrieve a list of sub-districts in Indonesia.
Request
URL:
GET https://pro.rajaongkir.com/api/subdistrict
Response
Successful Response
{
"rajaongkir":{
"query":{
"city":"39"
},
"status":{
"code":200,
"description":"OK"
},
"results":[
{
"subdistrict_id":"537",
"province_id":"5",
"province":"DI Yogyakarta",
"city_id":"39",
"city":"Bantul",
"type":"Kabupaten",
"subdistrict_name":"Bambang Lipuro"
},
{
"subdistrict_id":"538",
"province_id":"5",
"province":"DI Yogyakarta",
"city_id":"39",
"city":"Bantul",
"type":"Kabupaten",
"subdistrict_name":"Banguntapan"
},
...
]
}
}
Cost
Summary
The “cost” method is used to determine the shipping costs from and to specific sub-districts with certain weights.
Request
URL:
POST https://pro.rajaongkir.com/api/cost
Response
Successful Response
{
"rajaongkir":{
"query":{
"origin":"501",
"originType":"city",
"destination":"574",
"destinationType":"subdistrict",
"weight":1700,
"courier":"jne"
},
"status":{
"code":200,
"description":"OK"
},
"origin_details":{
"city_id":"501",
"province_id":"5",
"province":"DI Yogyakarta",
"type":"Kota",
"city_name":"Yogyakarta",
"postal_code":"55000"
},
"destination_details":{
"subdistrict_id":"574",
"province_id":"10",
"province":"Jawa Tengah",
"city_id":"41",
"city":"Banyumas",
"type":"Kabupaten",
"subdistrict_name":"Banyumas"
},
"results":[
{
"code":"jne",
"name":"Jalur Nugraha Ekakurir (JNE)",
"costs":[
{
"service":"OKE",
"description":"Ongkos Kirim Ekonomis",
"cost":[
{
"value":26000,
"etd":"6-7",
"note":""
}
]
},
{
"service":"REG",
"description":"Layanan Reguler",
"cost":[
{
"value":30000,
"etd":"4-5",
"note":""
}
]
}
]
}
]
}
}
RajaOngkir’s Pro Account API documentation provides comprehensive information on accessing various services such as retrieving province, city, and sub-district data, determining shipping costs, and tracking shipments. By utilizing these APIs, developers can integrate powerful shipping-related functionalities into their applications, enhancing the overall user experience.