Download the PHP package mijora/itella-api without Composer

On this page you can find all versions of the php package mijora/itella-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package itella-api

Itella-API

Its a wrapper library for Pakettikauppa API library.

Installing Itella-API using composer

Using Itella-API library

Validations, checks, etc. throws ItellaException and calls to library classes should be wrapped in: blocks

Any function starting with add or set returns its class so functions can be chained.

Authentication


Uses supplied user and secret. It is called during Shipment creation.

Creating Sender


Party::ROLE_SENDER is used to identify sender.

Minimum required setup:

Creating Receiver


Party::ROLE_RECEIVER is used to identify sender.

Minimum required setup:

Disabling phone checking / fixing


By default Party class checks that supplied phone matches set country format (if country is Lithuania it exxpects to see Lithuanian phone number) and tries to fix phone number to conform to international standart if needed. In case where such check / fixing is not desired (phone number is of different country than the one set) it can be disabled using disablePhoneCheck function on Party class.

NOTE: Even if checking / fixing is disabled Party class will still check that supplied number is in international format.

Example:

Notice how country code is set as LT (Lithuania) while contact mobile number is Latvian.

Creating Order Items


Creating Additional Services


Shipment::PRODUCT_COURIER available additional services:

Shipment::PRODUCT_PICKUP available additional services:

Trying to set additional service that is not available for set product code will throw ItellaException.

Creating additional service that does not need extra information (eg. with Fragile):

Creating COD additional service:

Create Shipment


Available product codes:

Shipment can be either one, but never both. See Additional Services for what services is available to each product code.

Shipment product code should always be set first.

When registering GoodsItem its possible to register one at a time using $shipment->addGoodsItem(GoodsItem) or multiple passing them in array to $shipment->addGoodsItems(array(GoodsItem, GoodsItem))

When registering AdditionalService its possible to register one at a time using $shipment->addAdditionalService(AdditionalService) or multiple passing them in array to $shipment->addAdditionalServices(array(AdditionalService, AdditionalService))

Courier Shipment example (uses variables from above examples):

Pickup point Shipment example (uses variables from above examples):

Once all information is supplied - shipment can be registered. If registration is successfull, tracking number will be returned. In this example returned tracking number is displayed, normaly it would be saved to order for later use to request shipment label PDF.

If there is need to check request XML it can be done using asXML()

Printing Label


Available label sizes:

It is advised to always download label when it is needed. For that Shipment class is used. result will be base64 encoded pdf file. If multiple tracking numbers (in array) is passed pdf will contain all those labels. For getting and merging labels pdf from two different users please refer to get-merge-labels.php example

$shipment->downloadLabels($track, $size = null) secondary parameter $size is optional and will work once posti/itella enviroment has it implemented on pakettikauppa side.

Important: If tracking number is from different user it will be ignored.

Above example checks that response isnt empty (if tracking number is wrong it still returns empty response), saves to file and loads into browser.

Locations API


When using Pickup Point option it is important to have correct list of pickup points. Also when creating Shipment to send to pickup point it will require that pickup point ID.

Manifest generating


When generating manifest by default it uses english strings - it is possible to pass translation.

Manifest constructor accepts additional arguments

Requires array of arrays with this information:

for other options see example below:

Call Courier


To call courrier manifest must be generated (works well with base64 encoded pdf). CallCourier is using mail() php function. That means - even if mail reports success on sending email, it is not guaranteed to be sent.

Call Courier - in development


To call courrier manifest must be generated (works well with base64 encoded pdf). CallCourier is using mail() php function. That means - even if mail reports success on sending email, it is not guaranteed to be sent.


All versions of itella-api with dependencies

PHP Build Version
Package Version
Requires pakettikauppa/api-library Version ^2.0
setasign/fpdi Version ^2.3
tecnickcom/tcpdf Version ^6.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mijora/itella-api contains the following files

Loading the files please wait ....