PHP code example of tsukasa / fan-courier-api-client
1. Go to this page and download the library: Download tsukasa/fan-courier-api-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tsukasa / fan-courier-api-client example snippets
// 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
// 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();
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();
use Infifni\FanCourierApiClient\Client;
use Infifni\FanCourierApiClient\Request\TrackAwb;
(new Client('7032158', 'clienttest', 'testing'))
->trackAwb([
'AWB' => '2337600120003', //
use Infifni\FanCourierApiClient\Client;
(new Client('7032158', 'clienttest', 'testing'))
->exportAwbErrors();
use Infifni\FanCourierApiClient\Client;
(new Client('7032158', 'clienttest', 'testing'))
->deleteAwb([
'AWB' => '2337600120003'
]);
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
]);
use Infifni\FanCourierApiClient\Client;
use Infifni\FanCourierApiClient\Request\DownloadAwb;
(new Client('7032158', 'clienttest', 'testing'))
->downloadAwb([
'AWB'=>'2337600120003',
'language' => DownloadAwb::LANGUAGE_RO_ALLOWED_VALUE
]);
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
]);
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
]);
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
]);
use Infifni\FanCourierApiClient\Client;
(new Client('7032158', 'clienttest', 'testing'))
->exportObservations();
use Infifni\FanCourierApiClient\Client;
(new Client('7032158', 'clienttest', 'testing'))
->endBordereau();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.