PHPackages                             crakter/bringapi - 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. crakter/bringapi

ActiveLibrary

crakter/bringapi
================

BringApi is a fully functional library to help contact Bring API

3.0.3(1y ago)56.0k↓100%4[3 PRs](https://github.com/crakter/bringapi/pulls)MITPHPPHP &gt;=8.2.0

Since Jun 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/crakter/bringapi)[ Packagist](https://packagist.org/packages/crakter/bringapi)[ RSS](/packages/crakter-bringapi/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (12)Used By (0)

Bring API PHP
=============

[](#bring-api-php)

[![Build Status](https://camo.githubusercontent.com/c6dd633c9cb4f651ec3e95beb17c87a34a68d45e1e3247a8bbe5987a02b7886b/68747470733a2f2f7472617669732d63692e6f72672f6372616b7465722f6272696e676170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/crakter/bringapi)

Bring API PHP is a library to contact Bring API for prices, booking, reports and so on. I did not find anything that i could use for my project with PHP and Bring API. So i needed a good library that was reusable. This is used in production of a large Norwegian wholesaler.

Install
-------

[](#install)

### Composer (recommended)

[](#composer-recommended)

Can be installed directly with [Composer](https://getcomposer.org/).

Run the following command in correct directory.

```
$ composer require crakter/bringapi

```

Requirements
------------

[](#requirements)

- PHP version 7.2.0 or higher
- PHP extension `php_simplexml` enabled (enabled by default in 5.1.2 and above)

Supported Apis
--------------

[](#supported-apis)

- Shipping Guide API
    - Get estimated prices
    - Get Estimated delivery time
    - Get Estimated shipment prices, delivery time and more
- Booking API
    - List customer names
    - Book Shipments
    - Order pickups
- Tracking API
    - Track shipments (also logged in)
    - Download Signature
- Reports API
    - List available customers
    - List available reports for a customer
    - Generate a report
    - Check the status of a report
    - List invoice numbers
- Postal Code API
    - Lookup postal code

Basic usage
-----------

[](#basic-usage)

### Tracking as logged in

[](#tracking-as-logged-in)

If you remove the authorizationModule you can track like normal user.

```
use Crakter\BringApi\Entity\TrackingEntity;
use Crakter\BringApi\Clients\Authorization;
use Crakter\BringApi\Clients\Tracking\TrackingEndpoint;

$trackingEntity = (new TrackingEntity)->set(['q' => 'TESTPACKAGE-AT-PICKUPPOINT']); // Can be used like this
//$trackingEntity = (new TrackingEntity)->setQ('TESTPACKAGE-AT-PICKUPPOINT'); // Can also be used like this
/* And like this
$trackingEntity = (new TrackingEntity);
$trackingEntity->q = 'TESTPACKAGE-AT-PICKUPPOINT';
*/
$authorizationModule = (new Authorization)
    ->setApiKey('1234abc-abcd-1234-5678-abcd1234abcd')
    ->setClientId('example@example.no')
    ->setClientUrl('http://example.com');

$tracking = (new TrackingEndpoint)
    ->setAuthorizationModule($authorizationModule)
    ->setApiEntity($trackingEntity)
    ->send();
print_r($tracking->toArray());
```

Advanced Usage
--------------

[](#advanced-usage)

Look in the examples folder or you can generate the documents using Sami (composer dev-dependency).

For people running Linux

```
vendor/bin/sami.php -n render SamiConfig.php

```

For people running Windows

```
"vendor/bin/sami.php.bat" -n render SamiConfig.php

```

You will now find the documents in the docs/build folder.

### Running examples

[](#running-examples)

For the tests to be able to run the Bring UID, Bring API Key and Customer number has to be set in the environment

For people running Linux

```
export BRING_UID="john.doe@example.com" && export BRING_API_KEY="1234abc-abcd-1234-5678-abcd1234abcd" && export BRING_CUSTOMER_NUMBER="	PARCELS_NORWAY-10001123123"

```

For people running Windows

```
setx BRING_UID john.doe@example.com
setx BRING_API_KEY 1234abc-abcd-1234-5678-abcd1234abcd
setx BRING_CUSTOMER_NUMBER PARCELS_NORWAY-10001123123

```

Go into a new command prompt and run the examples. Some examples can be passed with arguments like postalcodes.

```
cd examples/
php BookAndPickupShipment.php
php PostalCode.php
php ShippingGuideAll.php
php Tracking.php
php Reports.php

```

Contribute
----------

[](#contribute)

Contributions are very welcomed.

Please follow PSR-2 coding standard. You can run php-cs-fixer to fix the problems in the code.

License
-------

[](#license)

MIT

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance41

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 86.3% 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 ~373 days

Recently: every ~432 days

Total

8

Last Release

632d ago

Major Versions

1.0.2 → 2.0.02019-11-22

2.0.0 → 3.0.02024-07-29

PHP version history (2 changes)1.0.0PHP &gt;=7.0.0

3.0.0PHP &gt;=8.2.0

### Community

Maintainers

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

---

Top Contributors

[![crakter](https://avatars.githubusercontent.com/u/24833502?v=4)](https://github.com/crakter "crakter (44 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (7 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisRector

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/crakter-bringapi/health.svg)

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k20](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)

PHPackages © 2026

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