Download the PHP package nicxonsolutions/rajaongkir without Composer
On this page you can find all versions of the php package nicxonsolutions/rajaongkir. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nicxonsolutions/rajaongkir
More information about nicxonsolutions/rajaongkir
Files in nicxonsolutions/rajaongkir
Package rajaongkir
Short Description Laravel package for RajaOngkir/Komerce destination search and shipping cost calculation.
License GPL-2.0-or-later
Homepage https://github.com/robertnicjoo/rajaongkir
Informations about the package rajaongkir
RajaOngkir Komerce API for Laravel
Laravel package for the latest RajaOngkir Komerce API, including the current 2026 RajaOngkir API endpoints for destination lookup, shipping cost calculation, district-level shipping costs, and AWB tracking.
This package provides a Laravel-native API client, facade, optional API routes, courier metadata, and helpers for domestic and international shipping workflows.
Built and maintained by PT. Nicxon International Solutions.
Table of Contents
- Why This Package Exists
- Requirements
- Installation
- Configuration
- Basic Usage
- Search Destinations
- Calculate Shipping Costs
- Track Shipments
- Checkout Quote Helper
- Optional API Routes
- API Key Validation
- Error Handling
- Courier Metadata
- Production Notes
- License
- Support
Why This Package Exists
RajaOngkir is widely used in Indonesian ecommerce, but the Laravel ecosystem has lacked an up-to-date package for the current RajaOngkir Komerce API. RajaOngkir itself does not provide an official Laravel package, and many existing community packages target older API versions or outdated endpoint structures.
I at PT. Nicxon International Solutions created this package to fill that gap: a production-ready Laravel integration for the modern RajaOngkir Komerce API, with support for the latest destination hierarchy, domestic and international rates, district-level shipping cost calculation, and package tracking.
All rights reserved by PT. Nicxon International Solutions.
Requirements
- PHP
^8.2 - Laravel / Illuminate
6.xthrough13.x - RajaOngkir/Komerce API key
Installation
Install the package with Composer:
Publish the configuration file:
Add your RajaOngkir credentials and defaults to .env:
Clear cached config when deploying or changing environment values:
Configuration
The published config file is available at config/rajaongkir.php.
Important options:
Supported sort_shipping values:
nocostcost_descnamename_desc
Enabled couriers and services are configured in selected_couriers.
Basic Usage
Use the facade when calling methods statically:
Make sure you import Nicxonsolutions\Rajaongkir\Facades\Rajaongkir for static-style calls. If you import Nicxonsolutions\Rajaongkir\Rajaongkir, use dependency injection instead.
Or inject the service:
Search Destinations
Search-Based Lookup
Domestic destination search:
Example response item:
International destination search:
Province, City, District, and Sub-District Lookup
You can also use the structured Indonesian location hierarchy endpoints.
Get all provinces:
Get one province by province ID:
Get cities by province ID:
Get one city by province ID and city ID:
If you only have the city ID, you can search all provinces:
Get districts by city ID:
Get one district by city ID and district ID:
Get sub-districts by district ID:
Get one sub-district by district ID and sub-district ID:
The package normalizes each item with common keys:
Calculate Shipping Costs
Domestic rates:
International rates:
District-level domestic rates:
Example parsed rate:
The calculation methods return:
Track Shipments
Track a shipment by AWB number and courier:
Some couriers require the last 5 digits of the recipient phone number for validation, including JNE:
The API response contains shipment summary, details, delivery status, and manifest history when available:
Checkout Quote Helper
For application carts, you can use quote() and pass the cart weight plus destination data:
You may override default origin or request parameters:
Optional API Routes
Package routes are disabled by default. Enable them in .env:
Available routes:
Cost request body:
District domestic cost requests use the same body shape, but origin and destination should be district IDs.
Tracking request body:
last_phone_number is optional for the package request, but certain couriers may require it.
API Key Validation
You can perform a simple API key check:
This performs a small domestic destination search request.
Error Handling
The package throws Nicxonsolutions\Rajaongkir\Exceptions\RajaongkirException for missing configuration, invalid parameters, or API errors.
Courier Metadata
Courier and service metadata is stored in config/couriers.php. The package includes domestic and international services ported from the original WooCommerce plugin.
Get available couriers:
Use courier() when you want to fetch all couriers, one courier, or couriers matching a service code:
When the filter matches a courier code, response code, or courier label, one courier is returned. When the filter matches a service code or service label, matching couriers are returned with a matched_services key.
Production Notes
- Keep
RAJAONGKIR_API_KEYprivate and never expose it in frontend JavaScript. - Use your own controller endpoints for checkout flows when you need authentication, rate limiting, cart validation, or custom business rules.
- Cache destination search results if your checkout receives heavy traffic.
- Re-run
php artisan config:cacheduring deployment if your application uses cached config.
License
GPL-2.0-or-later.
Copyright (c) PT. Nicxon International Solutions. All rights reserved.
Support
All versions of rajaongkir with dependencies
illuminate/http Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/routing Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/session Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/view Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0