1. Go to this page and download the library: Download hitoz/rajaongkir library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hitoz / rajaongkir example snippets
use hok00age\RajaOngkir;
$client = new RajaOngkir("API_KEY_ANDA");
//Mendapatkan semua propinsi
$provinces = $client->getProvince();
//Mendapatkan semua kota
$cities = $client->getCity();
//Mendapatkan data ongkos kirim
$cost = $client->getCost(501, 114, 1000, "jne");
//Kode status HTTP, bertipe integer (200 jika sukses)
$http_status_code = $cost->code;
//Response headers, bertipe string
$response_headers = $cost->headers;
//Response body yang sudah diubah menjadi object
$body = $cost->body;
//Response body yang belum dimodifikasi, bertipe data string (JSON)
$json_body = $cost->raw_body;
bash
php composer.phar
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.