EkspedisiKu

API reference

All endpoints use the same URLs. Choose the logistics provider with the carrier field (body or query). One Bearer token works for every supported carrier.

Quick Check (Ongkir)

A simple GET-based endpoint to check shipping rates using administrative IDs.

GET /api/ongkir

This endpoint maps internal district IDs to upstream carrier locations automatically. It is ideal for quick integrations or simple calculators.

Query Parameters

Parameter Required Description
courier Yes Carrier ID (e.g., lion_parcel)
weight No Package weight in kg (Default: 1)
origin Yes District ID of sender
destination Yes District ID of recipient

Example request

URL

GET http://localhost/api/ongkir?courier=lion_parcel&weight=1&origin=350917&destination=321706

Example response

application/json

{
  "success": true,
  "data": {
    "courier": "lion_parcel",
    "weight": "1",
    "origin": { "id": "350917", "name": "AJUNG, JEMBER" },
    "destination": { "id": "321706", "name": "NGAMPRAH, BANDUNG BARAT" }
  },
  "rates": {
    "id": "lion_parcel",
    "label": "Lion Parcel",
    "available": true,
    "status": 200,
    "message": "OK",
    "services": [
      { "code": "REGPACK", "name": "REGPACK", "price": 18000, "currency": "IDR", "etd": "1 - 1 Hari" }
    ]
  }
}