EkspedisiKu

Referensi API

Semua endpoint memakai URL yang sama. Pilih kurir lewat field carrier (body atau query). Satu Bearer token untuk semua kurir yang didukung.

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

Contoh 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" }
    ]
  }
}