PHPackages                             bosta/bosta-sdk - 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. bosta/bosta-sdk

ActiveLibrary[API Development](/categories/api)

bosta/bosta-sdk
===============

A PHP client SDK for Bosta APIs integration.

1.0.0(5y ago)3655MITPHPPHP ~7.2

Since Oct 7Pushed 5y agoCompare

[ Source](https://github.com/bostaapp/bosta-php)[ Packagist](https://packagist.org/packages/bosta/bosta-sdk)[ Docs](https://github.com/bostaapp/bosta-php)[ RSS](/packages/bosta-bosta-sdk/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Bosta PHP SDK
=============

[](#bosta-php-sdk)

This repository contains the open source PHP SDK for integrating Bosta's APIs into your PHP application.

Table of Contents
-----------------

[](#table-of-contents)

- [APIs Documentation](#apis-documentation)
- [Installation](#installation)
- [Usages](#usages)
- [Contribution](#contribution)
- [License](#license)

APIs Documentation
------------------

[](#apis-documentation)

- [Staging](https://stg-app.bosta.co/docs) APIs swagger documentation.
- [Production](https://app.bosta.co/docs) APIs swagger documentation.

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

[](#installation)

You can install the package via [Composer](https://getcomposer.org/). Run the following command:

```
$ composer require bosta/bosta-sdk
```

Usages
------

[](#usages)

- Environment Variable Config

    ```
    $stgBaseUrl = 'https://stg-app.bosta.co';
    $prodBaseUrl = 'https://app.bosta.co';

    putenv("API_KEY=$your api key");
    putenv("BASE_URL=$your base url");
    ```
- Bosta Client

    ```
    require __DIR__ . '/vendor/autoload.php';
    use Bosta\Bosta;
    $bosta = new Bosta(getenv("API_KEY"), getenv("BASE_URL"));
    ```
- Pickup Client

    ```
    use Bosta\Utils\ContactPerson;

    /**
    * List Pickup Request
    *
    * @param int $pageNumber = 0
    * @return \stdClass
    */
    try {
        $list = $bosta->pickup->list(0);
        echo "list: \n";
        var_dump($list);
        echo "------------------------------------------ \n";
    } catch (Exception $e) {
        echo 'Caught exception: ',  $e->getMessage(), "\n";
    }

    /**
    * Get Pickup Request
    *
    * @param string $pickupRequestId = 070000000386
    * @return \stdClass
    */
    try {
        $get = $bosta->pickup->get('070000000386');
        echo "get: \n";
        var_dump($get);
        echo "------------------------------------------ \n";
    } catch (Exception $e) {
        echo 'Caught exception: ',  $e->getMessage(), "\n";
    }

    /**
    * Delete Pickup Request
    *
    * @param string $pickupRequestId = 070000000386
    * @return string
    */
    try {
        $delete = $bosta->pickup->delete('070000000386');
        echo "delete: \n";
        var_dump($delete);
        echo "------------------------------------------ \n";
    } catch (Exception $e) {
        echo 'Caught exception: ',  $e->getMessage(), "\n";
    }

    /**
    * Create ContactPerson Instance
    *
    * @param string $name = aliaa123
    * @param string $phone = 01209847552
    * @param string $email = test@test.com
    */
    $contactPerson = new ContactPerson("aliaa123", "01209847552", 'test@test.com');

    /**
    * Get Pickup Locations to use its id in create pickup Request
    */
    try {
        $listPickupLocations = $bosta->pickupLocation->list();
        echo "listPickupLocations: \n";
        var_dump($listPickupLocations);
        echo "------------------------------------------ \n";
    } catch (Exception $e) {
        echo 'Caught exception: ',  $e->getMessage(), "\n";
    }

    /**
    * Create Pickup Request
    *
    * @param string $scheduledDate = 2020-09-30 (YYYY-MM-DD)
    * @param string $scheduledTimeSlot = 10:00 to 13:00 || 13:00 to 16:00
    * @param \Bosta\Utils\ContactPerson $contactPerson
    * @param string $businessLocationId = SkIvXQn_a
    * @param string $notes = ''
    * @param int $noOfPackages = 0
    * @return \stdClass
    */
    try {
        $create = $bosta->pickup->create('2020-09-30', '10:00 to 13:00', $contactPerson, 'SkIvXQn_a', '', 0);
        echo "create: \n";
        var_dump($create);
        echo "------------------------------------------ \n";
    } catch (Exception $e) {
        echo 'Caught exception: ',  $e->getMessage(), "\n";
    }

    /**
    * Update Pickup Request
    *
    * @param string $pickupRequestId = 070000000386
    * @param string $scheduledDate = 2020-09-29 (YYYY-MM-DD)
    * @param string $scheduledTimeSlot = 10:00 to 13:00 || 13:00 to 16:00
    * @param \Bosta\Utils\ContactPerson $contactPerson
    * @param string $businessLocationId = SkIvXQn_a
    * @param string $notes = ''
    * @param int $noOfPackages = 0
    * @return string
    */
    try {
        $update = $bosta->pickup->update('070000000386', '2020-09-29', '10:00 to 13:00', $contactPerson, 'SkIvXQn_a', '', 0);
        echo "update: \n";
        var_dump($update);
        echo "------------------------------------------ \n";
    } catch (Exception $e) {
        echo 'Caught exception: ',  $e->getMessage(), "\n";
    }
    ```
- Delivery Client

    ```
    use Bosta\Utils\Receiver;
    use Bosta\Utils\DropOffAddress;

    /**
    * List Deliveries
    *
    * @param int $pageNumber = 0
    * @param int $pageLimit = 50
    * @return \stdClass
    */
    try {
        $list = $bosta->delivery->list(0, 50);
        echo "list: \n";
        var_dump($list);
        echo "------------------------------------------ \n";
    } catch (Exception $e) {
        echo 'Caught exception: ',  $e->getMessage(), "\n";
    }

    /**
    * get Delivery
    *
    * @param string $trackingNumber = 3082253
    * @return \stdClass
    */
    try {
        $get = $bosta->delivery->get('3082253');
        echo "get: \n";
        var_dump($get);
        echo "------------------------------------------ \n";
    } catch (Exception $e) {
        echo 'Caught exception: ',  $e->getMessage(), "\n";
    }

    /**
    * Delete Delivery
    *
    * @param string $deliveryId = cZTghcUW6E
    * @return void
    */
    try {
        $delete = $bosta->delivery->delete('cZTghcUW6E');
        echo "delete: \n";
        var_dump($delete);
        echo "------------------------------------------ \n";
    } catch (Exception $e) {
        echo 'Caught exception: ',  $e->getMessage(), "\n";
    }

    /**
    * Create Receiver Instance
    *
    * @param string $firstName = BostaDevTeam
    * @param string $lastName = lastname
    * @param string $phone = 01025810012
    */
    $receiver = new Receiver("BostaDevTeam", "lastname", '01025810012');

    /**
    * Create DropOffAddress Instance
    *
    * @param int $buildingNumber = 1
    * @param string $firstLine = firstLine
    * @param string $city = EG-05
    * @param string $zone = Dakahlia
    */
    $dropOffAddress = new DropOffAddress(1, "firstLine", "EG-05", 'Dakahlia');

    /**
    * Create Delivery
    *
    * @param int $type = 10
    * @param \Bosta\Utils\DropOffAddress $dropOffAddress
    * @param \Bosta\Utils\Receiver $receiver
    * @param string $notes = ''
    * @param int $cod = 0
    * @return \stdClass
    */
    try {
        $create = $bosta->delivery->create(10, $dropOffAddress, $receiver, '', 0);
        echo "create: \n";
        var_dump($create);
        echo "------------------------------------------ \n";
    } catch (Exception $e) {
        echo 'Caught exception: ',  $e->getMessage(), "\n";
    }

    /**
    * Create Receiver Instance
    *
    * @param string $firstName = BostaDevTeam
    * @param string $lastName = lastname
    * @param string $phone = 01025810012
    */
    $receiver = new Receiver("BostaDevTeam", "lastname", '01025810012');

    /**
    * Create DropOffAddress Instance
    *
    * @param int $buildingNumber = 1
    * @param string $firstLine = firstLine
    * @param string $city = EG-05
    * @param string $zone = Dakahlia
    */
    $dropOffAddress = new DropOffAddress(1, "firstLine", "EG-05", 'Dakahlia');

    /**
    * Update Delivery
    *
    * @param string $deliveryId = Dsu5bShCHK
    * @param \Bosta\Utils\DropOffAddress $dropOffAddress
    * @param \Bosta\Utils\Receiver $receiver
    * @param string $notes = ''
    * @param int $cod = 10
    * @return string
    */
    try {
        $update = $bosta->delivery->update('Dsu5bShCHK', $dropOffAddress, $receiver, '', 10);
        echo "update: \n";
        var_dump($update);
        echo "------------------------------------------ \n";
    } catch (Exception $e) {
        echo 'Caught exception: ',  $e->getMessage(), "\n";
    }
    ```

Contribution
------------

[](#contribution)

We are open to, and grateful for, any contributions made by the community. By contributing to Bosta, you agree to abide by the code of conduct.

- [Contributing Guide](CONTRIBUTING.md)
- [Code of Conduct](CODE_OF_CONDUCT.md)

License
-------

[](#license)

The MIT License (MIT) [License](LICENSE).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.2% 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

Unknown

Total

1

Last Release

2040d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2554500?v=4)[bosta](/maintainers/bosta)[@bosta](https://github.com/bosta)

---

Top Contributors

[![aliaasayed](https://avatars.githubusercontent.com/u/34912864?v=4)](https://github.com/aliaasayed "aliaasayed (40 commits)")[![mohllal](https://avatars.githubusercontent.com/u/13141989?v=4)](https://github.com/mohllal "mohllal (2 commits)")

---

Tags

api-integrationbostaclient-sdkcomposercourierphpbostabosta-sdk

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/bosta-bosta-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/bosta-bosta-sdk/health.svg)](https://phpackages.com/packages/bosta-bosta-sdk)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M186](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M452](/packages/google-gax)

PHPackages © 2026

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