PHPackages                             cloudenum/laravel-biteship - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. cloudenum/laravel-biteship

ActiveLibrary[API Development](/categories/api)

cloudenum/laravel-biteship
==========================

Unofficial Laravel package for Biteship API.

v0.2.0(8mo ago)4261[2 PRs](https://github.com/cloudenum/laravel-biteship/pulls)MITPHPPHP ^8.1CI passing

Since Nov 26Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/cloudenum/laravel-biteship)[ Packagist](https://packagist.org/packages/cloudenum/laravel-biteship)[ Docs](https://github.com/cloudenum/laravel-biteship)[ Fund](https://www.buymeacoffee.com/cloudenum)[ GitHub Sponsors](https://github.com/cloudenum)[ RSS](/packages/cloudenum-laravel-biteship/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (13)Versions (5)Used By (0)

Unofficial Laravel package for Biteship API
===========================================

[](#unofficial-laravel-package-for-biteship-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fb6f513279188bec93c753384ea8eed29b11249e4c65d48741a475f42104ac02/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c6f7564656e756d2f6c61726176656c2d62697465736869702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cloudenum/laravel-biteship)[![GitHub Tests Action Status](https://camo.githubusercontent.com/26f063174658d6c413eb7af3c7a7c00d7ddcd93f8dc23f9819b11be0df212ec0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636c6f7564656e756d2f6c61726176656c2d62697465736869702f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/cloudenum/laravel-biteship/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/15e2dc4da8081066434f20d88290f4956fa4ab992ebec7ac08ce17ed044af05e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636c6f7564656e756d2f6c61726176656c2d62697465736869702f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/cloudenum/laravel-biteship/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/ab4eb98d446c3e0f2f22ac5748db775c45d7323d4a7763acf39807b9cf77f583/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c6f7564656e756d2f6c61726176656c2d62697465736869702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cloudenum/laravel-biteship)

With this package you can easily interact with [Biteship API](https://biteship.com/en/docs/intro)

Here is a simple example to retrieve shipping costs

```
// First you must define the items to ship
$items = [
    [
        'name' => 'Black L',
        'description' => 'White Shirt',
        'category' => 'fashion',
        'value' => 165000,
        'quantity' => 1,
        'height' => 10,
        'length' => 10,
        'weight' => 200,
        'width' => 10,
    ]
];

// Then specify the destination and the origin
// You could use Postal Code but Biteship recommends you to use
// their's Area ID, because it is more accurate.
$destination = 12950;
$origin = 12440;
$availableCouriers = \Cloudenum\Biteship\Courier::all();

$rates = \Cloudenum\Biteship\CourierPricing::Rates([
    'origin_postal_code' => $origin,
    'destination_postal_code' => $destination,
    'couriers' => implode(',', $availableCouriers->pluck('courier_code')->unique()->toArray()),
    'items' => $items,
]);
```

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require cloudenum/laravel-biteship
```

You can publish the config file with:

```
php artisan vendor:publish --tag="biteship-config"
```

This is the contents of the published config file:

```
return [
    'base_url' => env('BITESHIP_BASE_URL', 'https://api.biteship.com'),
    'api_key' => env('BITESHIP_API_KEY'),
];
```

Usage
-----

[](#usage)

The usage of this package will largely follows [Biteship API Usage Flow](https://biteship.com/id/docs/api/usage_flow).

### Authentication

[](#authentication)

You must obtain an API key to use this package. Biteship has documentation on how you could [get an API key](https://biteship.com/id/docs/api/authentication#generate-new-api-key).

After you get your API key add below environments to your `.env` file

```
BITESHIP_API_KEY=
```

### Area

[](#area)

#### Retrieve Area With Single Search

[](#retrieve-area-with-single-search)

[API Doc](https://biteship.com/id/docs/api/maps/retrieve_area_single)

Example:

```
\Cloudenum\Biteship\Area::search("Lebak Bulus");
```

#### Retrieve Area With Double Search

[](#retrieve-area-with-double-search)

[API Doc](https://biteship.com/id/docs/api/maps/retrieve_area_double)

For the first request you could use the `Area::search()` method and set the `double` paramater to `true`.
Then for the second request you could use `Area::doubleSearchSecondRequest()` method.

Example:

```
$area = \Cloudenum\Biteship\Area::search("Lebak Bulus")->first();

\Cloudenum\Biteship\Area::doubleSearchSecondRequest($area->id);
```

> ***Tip***:
> You could get Area by their's ID with `Area::doubleSearchSecondRequest()` method.

### Rates

[](#rates)

#### Retrieve Courier Rates

[](#retrieve-courier-rates)

[API Doc](https://biteship.com/id/docs/api/rates/retrieve)

Example:

```
$items = [
    [
        'name' => 'Black L',
        'description' => 'White Shirt',
        'category' => 'fashion',
        'value' => 165000,
        'quantity' => 1,
        'height' => 10,
        'length' => 10,
        'weight' => 200,
        'width' => 10,
    ]
];

$destination = 55510;
$origin = 12440;
$availableCouriers = \Cloudenum\Biteship\Courier::all();

$rates = \Cloudenum\Biteship\CourierPricing::Rates([
    'origin_postal_code' => $origin,
    'destination_postal_code' => $destination,
    'couriers' => implode(',', $availableCouriers->pluck('courier_code')->unique()->toArray()),
    'items' => $items,
]);
```

### Shipping Order

[](#shipping-order)

#### Create a Shipping Order

[](#create-a-shipping-order)

[API Doc](https://biteship.com/id/docs/api/orders/create)

Example:

```
$data = [
    'shipper_contact_name' => 'Amir',
    'shipper_contact_phone' => '088888888888',
    'shipper_contact_email' => 'biteship@test.com',
    'shipper_organization' => 'Biteship Org Test',
    'origin_contact_name' => 'Amir',
    'origin_contact_phone' => '088888888888',
    'origin_address' => 'Plaza Senayan, Jalan Asia Afrika',
    'origin_note' => 'Deket pintu masuk STC',
    'origin_postal_code' => 12440,
    'destination_contact_name' => 'John Doe',
    'destination_contact_phone' => '088888888888',
    'destination_address' => 'Lebak Bulus MRT',
    'destination_postal_code' => 12950,
    'destination_note' => 'Near the gas station',
    'courier_company' => 'jne',
    'courier_type' => 'reg',
    'courier_insurance' => 500000,
    'delivery_type' => 'now',
    'order_note' => 'Please be careful',
    'metadata' => [],
    'items' => [
        [
            'name' => 'Black L',
            'description' => 'White Shirt',
            'category' => 'fashion',
            'value' => 165000,
            'quantity' => 1,
            'height' => 10,
            'length' => 10,
            'weight' => 200,
            'width' => 10,
        ]
    ]
];

$biteshipOrder = \Cloudenum\Biteship\Order::create($data);
```

#### Get Shipping Order By ID

[](#get-shipping-order-by-id)

API Doc

Example:

```
$biteshipOrder = \Cloudenum\Biteship\Order::find("ID");
```

#### Cancel a Shipping Order

[](#cancel-a-shipping-order)

[API Doc](https://biteship.com/id/docs/api/orders/delete)

Example:

```
// The reason could be a message why it is cancelled.
$biteshipOrder->cancel($reason);
```

### Shipment Tracking

[](#shipment-tracking)

#### Get Shipment Tracking By ID

[](#get-shipment-tracking-by-id)

[API Doc](https://biteship.com/id/docs/api/trackings/retrieve)

> ***Note***
> Tracking ID is **not** Waybill ID issued by couriers

Example:

```
$tracking = \Cloudenum\Biteship\Tracking::find("TrackingId");
```

#### Get Shipment Tracking By Waybill ID

[](#get-shipment-tracking-by-waybill-id)

[API Doc](https://biteship.com/id/docs/api/trackings/retrieve_public)

Example:

```
$tracking = \Cloudenum\Biteship\Tracking::findPublicTracking("WaybillId", "jne");
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Hammam Afiq Murtadho](https://github.com/cloudenum)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance77

Regular maintenance activity

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~282 days

Total

2

Last Release

255d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a8f798c951ca30ca812d5afc32dfda55b800b8690f19bd8cee74fcf003deab09?d=identicon)[cloudenum](/maintainers/cloudenum)

---

Top Contributors

[![cloudenum](https://avatars.githubusercontent.com/u/23111954?v=4)](https://github.com/cloudenum "cloudenum (26 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

laravellaravel-biteship

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/cloudenum-laravel-biteship/health.svg)

```
[![Health](https://phpackages.com/badges/cloudenum-laravel-biteship/health.svg)](https://phpackages.com/packages/cloudenum-laravel-biteship)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k7.8M57](/packages/dedoc-scramble)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
