Giter Site home page Giter Site logo

rajaongkir's Introduction

Rajaongkir

Advanced Rajaongkir API with Guzzle. Support for all types of accounts. PRO, BASIC and STARTER TESTED

Penggunaan

// types: pro|basic|starter
$rajaOngkir = new RajaOngkir('pro'); // set rajaongkir api_key in rajaongkit.php
// All provinces
$provinces = $rajaOngkir->getProvinces(); // OK
// province by province ID
$province = $rajaOngkir->getProvince(1); // OK

// All cities
$cities = $rajaOngkir->getCities(); // OK
// Citites by province ID
$cities = $rajaOngkir->getCities(21); // OK
// City by city ID
$city = $rajaOngkir->getCity(1); // OK

// Subdistricts (kecamatan) by city ID
$getSubdistricts = $rajaOngkir->getSubdistricts(1); // OK
// Subdistricts by subdistrict ID
$getSubdistrict = $rajaOngkir->getSubdistrict(1); // OK

// required for PRO ['origin', 'originType', 'destination', 'destinationType', 'weight', 'courier']
// optional for PRO ['length', 'width', 'height', 'diameter'] in cm
// required for BASIC/STARTER ['origin', 'destination', 'weight', 'courier']
// ex: city to subdistrict (kota ke kecamatan), subdistrict to subdistrict (kecamatan ke kecamatan), 
// atau city to city (kota ke kota).
$getCost = $rajaOngkir->getCost([
    'origin' => 501,
    'originType' => 'city',
    'destination' => 114,
    'destinationType' => 'city',
    'weight' => 400,
    'courier' => 'jne', // for multiple ex: 'jne:tiki:pos'
]); // OK

// param 1 = city ID | param 2: province ID. not required
$getInternationalOrigins = $rajaOngkir->getInternationalOrigins(152, 6); // OK

// param: country ID. not required
$getInternationalDestinations = $rajaOngkir->getInternationalDestinations(1); // OK

// not supported for STARTER. required params ['origin', 'destination', 'weight', 'courier']
// optional params ['length', 'width', 'height]
$getInternationalCost = $rajaOngkir->getInternationalCost([
    'origin' => 152,
    'destination' => 108,
    'weight' => 1400,
    'courier' => 'pos',
]); // OK

// all currency
$getCurrency = $rajaOngkir->getCurrency(); // OK

// param 1: no resi, param 2: courier
$getWaybill = $rajaOngkir->getWaybill('SOCAG00183235715', 'jne'); // OK

// || HELPER ||
// get all courier list
$courier = $rajaOngkir->getCouriersList(); // OK
// get supported courier for STARTER|PRO|BASIC
$getSupportedCouriers = $rajaOngkir->getSupportedCouriers(); // OK
// get supported waybill courier for STARTER|PRO|BASIC
$getSupportedWayBills = $rajaOngkir->getSupportedWayBills(); // OK

STARTER

  • Province
  • City
  • Cost

BASIC

  • Province
  • City
  • Cost
  • International Origin
  • International Destination
  • International Cost
  • Currency
  • Waybill

PRO

  • Province
  • City
  • Subdistricts
  • Cost
  • International Origin
  • International Destination
  • International Cost
  • Currency
  • Waybill

rajaongkir's People

Contributors

aslam97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.