PHPackages                             infifni/fan-courier-api-client - 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. infifni/fan-courier-api-client

ActiveLibrary[API Development](/categories/api)

infifni/fan-courier-api-client
==============================

Fan Courier API Client

v1.0.5(5y ago)1332.6k↓32.3%7[2 issues](https://github.com/infifni/fan-courier-api-client/issues)MITPHPPHP &gt;=7.0

Since May 27Pushed 3y ago1 watchersCompare

[ Source](https://github.com/infifni/fan-courier-api-client)[ Packagist](https://packagist.org/packages/infifni/fan-courier-api-client)[ RSS](/packages/infifni-fan-courier-api-client/feed)WikiDiscussions master Synced 1mo ago

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

[ ![infifni logo](https://camo.githubusercontent.com/dd67a7cd54fa0db4c60692480f5071d7ddbec6fdee85dab0955769d121788fdd/68747470733a2f2f696e6669666e69736f6674776172652e726f2f7468656d65732f637573746f6d2f696e6669666e692f6c6f676f2e737667)](https://infifnisoftware.ro) Fan Courier API Client Library
 License MIT
==============================================

[](#----fan-courier-api-client-library--------license-mit)

FanCourier API Client
---------------------

[](#fancourier-api-client)

A client developed as a library, easy to integrate in other projects.

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

[](#installation)

Install the package through [Composer](http://getcomposer.org/).

Run the Composer require command from the Terminal:

```
composer require infifni/fan-courier-api-client

```

Now you're ready to start using the FanCourier API Client in your application.

Overview
--------

[](#overview)

Look at one of the following topics to learn more about FanCourier API Client.

- [Usage](#usage)
- [Exceptions](#exceptions)

Usage
-----

[](#usage)

Explanations

```
// default values for testing purposes
$clientId = '7032158';
$username = 'clienttest';
$password = 'testing';

// for all the methods available you can see the request params
// in the associated class
// e.g.
use Infifni\FanCourierApiClient\Client;
(new Client($clientId, $username, $password))->city();
// now check \Infifni\FanCourierApiClient\Request\City::getFieldRules
// to understand what params are required and which are optional
```

See the phpunit tests for more in depth understanding of how the library works. The FanCourier API Client library gives you the following methods to use:

### city method

[](#city-method)

Retrieves cities based on county and language.

**The `city()` method will return an array of objects with: judet, localitate, agentie, km, cod\_rutare, id\_localitate\_fan. These keys will be translated if english language is being specified.**

```
// examples
use Infifni\FanCourierApiClient\Client;
use Infifni\FanCourierApiClient\Request\City;

// to fetch specific county
(new Client('7032158', 'clienttest', 'testing'))
    ->city([
        'judet' => 'Constanta', // optional
        'language' => City::LANGUAGE_RO_ALLOWED_VALUE // optional
    ]);

// or to fetch all cities
(new Client('7032158', 'clienttest', 'testing'))
    ->city();
```

### streets method

[](#streets-method)

Retrieves streets based on county, city and language.

**The `streets()` method will return an array of objects with the following keys: judet, localitate, strada, de\_la, pana\_la, paritate, cod\_postal, tip, cod\_cartare, numar\_depozite. These keys will be translated if english language is being specified.**

```
use Infifni\FanCourierApiClient\Client;
use Infifni\FanCourierApiClient\Request\Streets;

// To fetch specific county
(new Client('7032158', 'clienttest', 'testing'))
    ->streets([
        'judet' => 'Bucuresti', // optional
        'localitate' => 'Bucuresti', // optional
        'language' => Streets::LANGUAGE_RO_ALLOWED_VALUE // optional
    ]);
// or to fetch all streets from Romania
(new Client('7032158', 'clienttest', 'testing'))
    ->streets();
```

### price method

[](#price-method)

Retrieves price based on service, package, distance and other params.

**The `price()` method will return a double (standard service) or a json string (export service).**

```
use Infifni\FanCourierApiClient\Client;
use Infifni\FanCourierApiClient\Request\Price;

// standard service
(new Client('7032158', 'clienttest', 'testing'))
    ->price([
        'serviciu' => Price::SERVICE_ALLOWED_VALUES['standard'],
        'localitate_dest' => 'Targu Mures',
        'judet_dest' => 'Mures',
        'plicuri' => 1,
        'colete' => 2,
        'greutate' => 5,
        'lungime' => 10,
        'latime' => 10,
        'inaltime' => 10,
        'val_decl' => 600,
        'plata_ramburs' => Price::SENDER_ALLOWED_VALUE,
        'plata_la' => Price::RECIPIENT_ALLOWED_VALUE
    ]);

// export service
(new Client('7032158', 'clienttest', 'testing'))
    ->price([
        'serviciu' => Price::SERVICE_ALLOWED_VALUES['export'],
        'modtrim' => Price::SEND_MODE_BY_AIR_ALLOWED_VALUE,
        'greutate' => 10.22,
        'pliccolet' => 3,
        's_inaltime' => 50,
        's_latime' => 67,
        's_lungime' => 48,
        'volum' => 400,
        'dest_tara' => 'Bulgaria',
        'tipcontinut' => 1,
        'km_ext' => 400,
        'plata_la' => Price::RECIPIENT_ALLOWED_VALUE
    ]);
```

### trackAwbMethod

[](#trackawbmethod)

Track expedition using AWB code.

**The `trackAwb()` method will return a plain text.**

```
use Infifni\FanCourierApiClient\Client;
use Infifni\FanCourierApiClient\Request\TrackAwb;

(new Client('7032158', 'clienttest', 'testing'))
    ->trackAwb([
        'AWB' => '2337600120003', // required
        'display_mode' => TrackAwb::DISPLAY_MODE_ALL_ALLOWED_VALUE, // required
        'language' => TrackAwb::LANGUAGE_RO_ALLOWED_VALUE // optional
    ]);
```

### generateAwb method

[](#generateawb-method)

Send orders to generate AWB

**The `generateAwb()` method will return an array of objects with: line, awb, send\_params, error\_message.**

```
use Infifni\FanCourierApiClient\Client;
use Infifni\FanCourierApiClient\Request\GenerateAwb;

(new Client('7032158', 'clienttest', 'testing'))
    ->generateAwb([
        'fisier' => [
            [
                'tip_serviciu' => GenerateAwb::SERVICE_ALLOWED_VALUES['standard'],
                'banca' => '',
                'iban' =>  '',
                'nr_plicuri' => 1,
                'nr_colete' => 0,
                'greutate' => 1,
                'plata_expeditie' => 'ramburs',
                'ramburs_bani' => 100,
                'plata_ramburs_la' => GenerateAwb::RECIPIENT_ALLOWED_VALUE,
                'valoare_declarata' => 400,
                'persoana_contact_expeditor' => 'Test User',
                'observatii' => 'Lorem ipsum',
                'continut' => '',
                'nume_destinar' => 'Test',
                'persoana_contact' => 'Test',
                'telefon' => '123456789',
                'fax' => '123456789',
                'email' => 'example@example.com',
                'judet' => 'Galati',
                'localitate' => 'Tecuci',
                'strada' => 'Lorem',
                'nr' => '2',
                'cod_postal' => '123456',
                'bl' => '',
                'scara' => '',
                'etaj'  => '',
                'apartament' => '',
                'inaltime_pachet' => '',
                'lungime_pachet' => '',
                'restituire' => '',
                'centru_cost' => '',
                'optiuni' => '',
                'packing' => '',
                'date_personale' => ''
            ],
            [
                'tip_serviciu' => GenerateAwb::SERVICE_ALLOWED_VALUES['collector_account'],
                'banca' => 'Test',
                'iban' =>  'XXXXXX',
                'nr_plicuri' => 0,
                'nr_colete' => 1,
                'greutate' => 1,
                'plata_expeditie' => 'ramburs',
                'ramburs_bani' => 400,
                'plata_ramburs_la' => GenerateAwb::RECIPIENT_ALLOWED_VALUE,
                'valoare_declarata' => 400,
                'persoana_contact_expeditor' => 'Test User',
                'observatii' => 'Lorem ipsum',
                'continut' => 'Fragil',
                'nume_destinar' => 'Test',
                'persoana_contact' => 'Test',
                'telefon' => '123456789',
                'fax' => '123456789',
                'email' => 'example@example.com',
                'judet' => 'Galati',
                'localitate' => 'Tecuci',
                'strada' => 'Lorem',
                'nr' => '2',
                'cod_postal' => '123456',
                'bl' => '',
                'scara' => '',
                'etaj'  => '',
                'apartament' => '',
                'inaltime_pachet' => '',
                'lungime_pachet' => '',
                'restituire' => '',
                'centru_cost' => '',
                'optiuni' => '',
                'packing' => '',
                'date_personale' => ''
            ]
        ]]);
```

### order method

[](#order-method)

Place a order to a FanCourier Agent. The agent will come a pick-up the package at the requested hour, same day.

**The `order()` method will return a plain message if the request is being done successfully**

```
use Infifni\FanCourierApiClient\Client;

(new Client('7032158', 'clienttest', 'testing'))
    ->order([
        'nr_colete' => 1,
        'pers_contact' => 'Test',
        'tel' => 123456789,
        'email' => 'example@example.com',
        'greutate' => 1,
        'inaltime' => 10,
        'lungime' => 10,
        'latime' => 10,
        'ora_ridicare' => '18:00',
        'observatii' => '',
        'client_exp' => 'Test',
        'strada' => 'Test',
        'nr' => 1,
        'bloc' => 2,
        'scara' => 3,
        'etaj' => 7,
        'ap' => 78,
        'localitate' => 'Constanta',
        'judet' => 'Constanta',
    ]);
```

### exportAwbErrors method

[](#exportawberrors-method)

All FanCourier AWB with errors.

**The `exportAwbErrors()` method will return an empty array or with objects containing: nume, judet, localitate, telefon, plicuri, colete, greutate, descriere.**

```
use Infifni\FanCourierApiClient\Client;

(new Client('7032158', 'clienttest', 'testing'))
    ->exportAwbErrors();
```

### deleteAwb method

[](#deleteawb-method)

Deletes AWB only if the shipping process has not finished.

**The `deleteAwb()` method will return an int (the deleted AWB number) if the request was successful or the error message.**

```
use Infifni\FanCourierApiClient\Client;

(new Client('7032158', 'clienttest', 'testing'))
    ->deleteAwb([
        'AWB' => '2337600120003'
    ]);
```

### getAwb method

[](#getawb-method)

Return documents containing shipping details.

**The `getAwb()` method will return a html page containing documents that can be printed if the request was successful or the error message.**

```
use Infifni\FanCourierApiClient\Client;
use Infifni\FanCourierApiClient\Request\GetAwb;

(new Client('7032158', 'clienttest', 'testing'))
    ->getAwb([
        'nr' => '2337600120003',
        'page' => GetAwb::PAGE_A4_ALLOWED_VALUE,
        'ln' => GetAwb::LANGUAGE_RO_ALLOWED_VALUE
    ]);
```

### downloadAwb method

[](#downloadawb-method)

Returns AWB document in jpg format.

**The `downloadAwb()` method will return a jpg if the request is made successfully or the error message.**

```
use Infifni\FanCourierApiClient\Client;
use Infifni\FanCourierApiClient\Request\DownloadAwb;

(new Client('7032158', 'clienttest', 'testing'))
    ->downloadAwb([
        'AWB'=>'2337600120003',
        'language' => DownloadAwb::LANGUAGE_RO_ALLOWED_VALUE
    ]);
```

### exportOrders method

[](#exportorders-method)

All orders made within selected date through order method.

**The `exportOrders()` method will return an empty array or with objects containing: nr.\_crt., data\_ridicare\_comanda, ora\_de\_la, ora\_pana\_la, persoana\_contact, telefon, email, colete, numar\_comanda, status.**

```
use Infifni\FanCourierApiClient\Client;
use Infifni\FanCourierApiClient\Request\ExportOrders;

(new Client('7032158', 'clienttest', 'testing'))
    ->exportOrders([
        'data' => '22.05.2020',
        'language' => ExportOrders::LANGUAGE_RO_ALLOWED_VALUE
    ]);
```

### exportBordereau method

[](#exportbordereau-method)

All orders made within selected date through generateAwb method.

**The `exportBordereau()` method will return an empty array or with objects containing: nr.\_crt., awb, ridicat, status, data\_confirmarii, restituire, tip\_serviciu, continut...**

```
use Infifni\FanCourierApiClient\Client;
use Infifni\FanCourierApiClient\Request\ExportBordereau;

(new Client('7032158', 'clienttest', 'testing'))
    ->exportBordereau([
        'data' => '22.05.2020',
        'language' => ExportBordereau::LANGUAGE_RO_ALLOWED_VALUE,
        'mode' => ExportBordereau::MODE_ALL_ALLOWED_VALUE
    ]);
```

### exportReports method

[](#exportreports-method)

Returns all expeditions that have placed the total amount in the deposit account within selected date for the bank transfer.

**The `exportReports()` method will return an empty array or with objects containing: oras\_destinatar, dat\_awb, suma\_incasata, numar\_awb, numar\_awb, expeditor, destinatar, continut, persoanaD, data\_virament, persoanaE, ramburs\_la\_awb, awb\_retur**

```
use Infifni\FanCourierApiClient\Client;
use Infifni\FanCourierApiClient\Request\ExportReports;

(new Client('7032158', 'clienttest', 'testing'))
    ->exportReports([
        'data' => '22.05.2020',
        'language' => ExportReports::LANGUAGE_RO_ALLOWED_VALUE
    ]);
```

### exportObservations method

[](#exportobservations-method)

Returns all observations that can be set when an expedition is being requested.

**The `exportObservations()` method will return an empty array or with objects containing: observatii\_fan\_courier**

```
use Infifni\FanCourierApiClient\Client;

(new Client('7032158', 'clienttest', 'testing'))
    ->exportObservations();
```

### endBordereau method

[](#endbordereau-method)

Will close all orders made for the current date.

**The `endBordereau()` method will return a html.**

```
use Infifni\FanCourierApiClient\Client;

(new Client('7032158', 'clienttest', 'testing'))
    ->endBordereau();
```

Exceptions
----------

[](#exceptions)

The FanCourier package will throw exceptions if something goes wrong. This way it's easier to debug your code using the FanCourier package or to handle the error based on the type of exceptions. The FanCourier packages can throw the following exceptions:

Exception*FanCourierInstanceException**FanCourierInvalidParamException**FanCourierUnknownRequestException**CsvWrongReadException*

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~1 days

Total

6

Last Release

2173d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/412a751b21ba6f05c0ef08f1358926dba25e1d2c0606aa4c521f50798d23cd97?d=identicon)[lco91](/maintainers/lco91)

---

Top Contributors

[![laurentiu-cocos](https://avatars.githubusercontent.com/u/60970753?v=4)](https://github.com/laurentiu-cocos "laurentiu-cocos (2 commits)")[![pintilei](https://avatars.githubusercontent.com/u/11697496?v=4)](https://github.com/pintilei "pintilei (1 commits)")[![tsukasa-mixer](https://avatars.githubusercontent.com/u/1190435?v=4)](https://github.com/tsukasa-mixer "tsukasa-mixer (1 commits)")

---

Tags

Fan Courier API ClientFan CarrierFan CourierFan API Client

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/infifni-fan-courier-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/infifni-fan-courier-api-client/health.svg)](https://phpackages.com/packages/infifni-fan-courier-api-client)
```

###  Alternatives

[allyans3/steam-market-api-v2

Steam Market API v2

1937.3k](/packages/allyans3-steam-market-api-v2)[chapter-three/apple-news-api

Push content to Apple News.

38307.5k3](/packages/chapter-three-apple-news-api)[saleh7/proxmox-ve_php_api

ProxmoxVE PHP API

11718.7k](/packages/saleh7-proxmox-ve-php-api)[yunchuang/appstore-connect-api

sdk for appstore connect api

3865.3k](/packages/yunchuang-appstore-connect-api)

PHPackages © 2026

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