perigiweb / biteship
Biteship PHP Client
1.0.3
2023-11-05 10:36 UTC
Requires
- php: ^8.0
- ext-curl: *
- ext-json: *
Requires (Dev)
- phpunit/phpunit: ^10.4 || ^9.6
README
This library is unofficial PHP client for accessing Biteship API
composer require perigiweb/biteship
How To Use
use Perigi\Biteship\Client; $biteshipApiKey = ''; $client = new Client($biteshipApiKey);
Supported Method
Get Available Couriers
$availableCouriers = $client->getCouriers();
Search Area
// single search https://biteship.com/id/docs/api/maps/retrieve_area_single $areas = $client->searchArea($districtName); // double search https://biteship.com/id/docs/api/maps/retrieve_area_double $areas = $client->searchArea($districtName, 'double'); // areaId from double search result $areas = $client->searchAreaById($areaId);
Get Shipping Rates
$origin = 'IDN...'; // area_id $destination = 'IDN....'; // area_id $couriers = 'jne,jnt,sicepat,anteraja'; $items = [$item]; // origin and destination can be an array of postal code $origin = [ 'origin_postal_code' => 11122 ]; $destination = [ 'destination_postal_code' => 53461 ]; // or combination of latitude and longitude $origin = [ 'origin_latitude' => 5.8474647464, 'origin_longitude' => 7.57575757 ]; $destination = [ 'destination_latitude' => 3.8474647464, 'destination_longitude' => 5.57575757 ]; $rates = $client->getRates($origin, $destination, $couriers, $items);
Tracking
// tracking by order id $tracking = $client->tracking($biteshipOrderId); // or tracking by waybill and courier code $tracking = $client->publicTracking($waybillId, $courierCode);
Order
Create, retrive, update and delete order not supported yet
More info on Biteship API Docs