Dokumentasi Shipping API
Dokumentasi endpoint origin, hierarki destination, dan cek ongkir untuk integrasi eksternal.
Base URL
https://core.keepbelanja.com
Pilih docs
Autentikasi
Header `Key`
Semua endpoint di halaman ini wajib memakai header `Key`, body `application/x-www-form-urlencoded`, dan koneksi HTTPS.
| Header | Key: your_api_key_here |
| Body | application/x-www-form-urlencoded |
| Koneksi | HTTPS wajib. |
| Key tidak ada | `401 Key header is required.` |
| Tipe body salah | `415 Use application/x-www-form-urlencoded for API request body.` |
| Key tidak valid | `403 Invalid API key.` |
| Batas kuota | `429 Monthly quota exceeded.` |
Format response
Meta + Data
{
"meta": {
"message": "Success Get Province",
"code": 200,
"status": "success"
},
"data": [
{ "id": 1, "name": "DKI JAKARTA" }
]
}
Shipping API
Endpoint dengan API key
6 endpoints
GET
/api/destination/provinces
Ambil semua province.
POST
/api/destination/cities
Body: province_id
POST
/api/destination/districts
Body: city_id
POST
/api/destination/subdistricts
Body: district_id
GET
/api/origin
Query opsional: keyword
POST
/api/tariff
Body: courier, origin, destination, weight
Contoh
Contoh request dan response
Get provinces
Ambil semua province.
curl --location 'https://core.keepbelanja.com/api/destination/provinces' \
--header 'Key: YOUR_API_KEY'{
"meta": { "message": "Success Get Province", "code": 200, "status": "success" },
"data": [
{ "id": 1, "name": "DKI JAKARTA" },
{ "id": 2, "name": "JAWA BARAT" }
]
}{
"meta": { "message": "Invalid API key.", "code": 403, "status": "error" },
"data": []
}Get cities by province ID
Ambil city dari satu province.
curl --location 'https://core.keepbelanja.com/api/destination/cities' \
--header 'Key: YOUR_API_KEY' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'province_id=1'{
"meta": { "message": "Success Get City By Province ID", "code": 200, "status": "success" },
"data": [
{ "id": 149, "name": "CILACAP" },
{ "id": 383, "name": "MAGELANG" }
]
}{
"meta": { "message": "province_id is required in request body.", "code": 400, "status": "error" },
"data": []
}Get districts by city ID
Ambil district dari satu city.
curl --location 'https://core.keepbelanja.com/api/destination/districts' \
--header 'Key: YOUR_API_KEY' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'city_id=149'{
"meta": { "message": "Success Get District By City ID", "code": 200, "status": "success" },
"data": [
{ "id": 1544, "name": "PATIMUAN" },
{ "id": 1545, "name": "SIDAREJA" }
]
}{
"meta": { "message": "Invalid city_id.", "code": 400, "status": "error" },
"data": []
}Get subdistricts by district ID
Ambil subdistrict beserta zip code.
curl --location 'https://core.keepbelanja.com/api/destination/subdistricts' \
--header 'Key: YOUR_API_KEY' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'district_id=1544'{
"meta": { "message": "Success Get Subdistrict By District ID", "code": 200, "status": "success" },
"data": [
{ "id": 15148, "name": "PATIMUAN", "zip_code": "53264" }
]
}{
"meta": { "message": "district_id must be a positive integer.", "code": 400, "status": "error" },
"data": []
}Get origin list
Ambil daftar origin.
curl --location 'https://core.keepbelanja.com/api/origin?keyword=jakarta' \
--header 'Key: YOUR_API_KEY'{
"meta": { "message": "Success Get Origin", "code": 200, "status": "success" },
"data": [
{ "id": 1, "name": "JAKARTA" }
]
}{
"meta": { "message": "Key header is required.", "code": 401, "status": "error" },
"data": []
}Check tariff
Hitung ongkir menggunakan origin, destination, dan weight gram.
curl --location 'https://core.keepbelanja.com/api/tariff' \
--header 'Key: YOUR_API_KEY' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'courier=JNE' \
--data-urlencode 'origin=1' \
--data-urlencode 'destination=15148' \
--data-urlencode 'weight=1000'{
"meta": { "message": "Success Calculate Domestic Shipping cost", "code": 200, "status": "success" },
"data": [
{
"name": "Jalur Nugraha Ekakurir (JNE)",
"code": "jne",
"service": "REG23",
"description": "REG",
"cost": 25000,
"etd": "3-6 day"
}
]
}{
"meta": { "message": "weight must be a positive number in gram.", "code": 400, "status": "error" },
"data": []
}Referensi
Referensi request body
| Endpoint | Method | Body / Query | Catatan |
|---|---|---|---|
| https://core.keepbelanja.com/api/origin | GET | keyword query optional | Ambil daftar origin. |
| https://core.keepbelanja.com/api/destination/districts | POST | city_id | Ambil district dari satu city. |
| https://core.keepbelanja.com/api/destination/subdistricts | POST | district_id | Ambil subdistrict beserta zip code. |
| https://core.keepbelanja.com/api/tariff | POST | courier, origin, destination, weight | Hitung ongkir menggunakan origin, destination, dan weight gram. |