Shipping API Documentation
Documentation for origin, destination hierarchy, and shipping cost endpoints for external integration.
Base URL
https://core.keepbelanja.com
Choose docs
Authentication
Header `Key`
All endpoints on this page require the `Key` header, an `application/x-www-form-urlencoded` body, and HTTPS.
| Header | Key: your_api_key_here |
| Body | application/x-www-form-urlencoded |
| Connection | HTTPS required. |
| Missing key | `401 Key header is required.` |
| Wrong body type | `415 Use application/x-www-form-urlencoded for API request body.` |
| Invalid key | `403 Invalid API key.` |
| Quota limit | `429 Monthly quota exceeded.` |
Response format
Meta + Data
{
"meta": {
"message": "Success Get Province",
"code": 200,
"status": "success"
},
"data": [
{ "id": 1, "name": "DKI JAKARTA" }
]
}
Shipping API
Endpoints with API key
6 endpoints
GET
/api/destination/provinces
Get all provinces.
POST
/api/destination/cities
Body: province_id
POST
/api/destination/districts
Body: city_id
POST
/api/destination/subdistricts
Body: district_id
GET
/api/origin
Optional query: keyword
POST
/api/tariff
Body: courier, origin, destination, weight
Examples
Request and response examples
Get provinces
Get all provinces.
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
Get cities from one 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
Get districts from one 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
Get subdistricts with 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
Get origin list.
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
Calculate shipping cost using origin, destination, and weight in grams.
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": []
}Reference
Request body reference
| Endpoint | Method | Body / Query | Notes |
|---|---|---|---|
| https://core.keepbelanja.com/api/origin | GET | keyword query optional | Get origin list. |
| https://core.keepbelanja.com/api/destination/districts | POST | city_id | Get districts from one city. |
| https://core.keepbelanja.com/api/destination/subdistricts | POST | district_id | Get subdistricts with ZIP code. |
| https://core.keepbelanja.com/api/tariff | POST | courier, origin, destination, weight | Calculate shipping cost using origin, destination, and weight in grams. |