w3designweb/laravel-qapla

Package to integrate Qapla API functionalities in your Laravel web application.

v1.0 2018-04-23 13:44 UTC

This package is not auto-updated.

Last update: 2024-04-17 21:25:38 UTC


README

Latest Version on Packagist Software License Scrutinizer Code Quality Quality Score Total Downloads

An easy Qapla API integration for your Laravel 5 web application.

LaravelQapla

Install

You can install the package via Composer:

$ composer require w3designweb/laravel-qapla

In Laravel 5.5 and up, the package will automatically register the service provider and facade.
In Laravel 5.4 or below start by registering the package's the service provider and facade:

// config/app.php

'providers' => [
    ...
    W3design\Qapla\QaplaServiceProvider::class,
],

'aliases' => [
    ...
    'Qapla' => W3design\Qapla\QaplaFacade::class,
],

The facade is optional, but the rest of this guide assumes you're using the facade.

Next, publish the config files:

php artisan vendor:publish --provider="W3design\Qapla\QaplaServiceProvider" --tag="config"

Usage

The connection to the channel

use W3design\Qapla\Qapla;
...
$channel = new Qapla($privateApiKey, $publicApiKey);

After that you can use all this functions:

  • getTrack(): Return the status of a shipment using the tracking number.
  • pushTrack(): Allows one or more shipments to be loaded via a POST request in JSON format.
  • deleteTrack(): Allows you to delete a shipment.
  • getTracks(): Return the list of shipments imported from Qapla, with a maximum limit of 100 shipments per call.
  • pushOrder(): Allows you to load one or more orders via a POST request in JSON format.
  • getOrders(): Return the list of orders imported from Qapla, with a maximum limit of 100 orders per call.
  • getCredits(): Return the amount of the remaining credits on your premium account
  • getCouriers(): Return the list of couriers either total, or for single country/region.

getTrack()

Return the status of a shipment using the tracking number.
You can retrive a track by "trackingNumber" or "reference".

$track = $channel->getTrack('trackingNumber', '2878202252347', 'ita');	// by "trackingNumber"
$track = $channel->getTrack('reference', '300008236', 'ita');		// by "reference"

pushTrack()

Allows one or more shipments to be loaded via a POST request in JSON format.
The $data array PHP must follows the guidelines described here: https://api.qapla.it/#pushTrack

$data = array(...);
$channel->pushTrack($data);

deleteTrack()

Allows you to delete a shipment by "trackingNumber".

$channel->deleteTrack('2878202252347');

getTracks()

Return the list of shipments imported from Qapla, with a maximum limit of 100 shipments per call.
You must indicate a "startDate", and you can use a date in format "Y-m-d H:i:s" or an integer number like "36" to mean "36 days before today".

$tracks = $channel->getTracks('2015-05-21 00:00:00');	// With "Y-m-d H:i:s" format
$tracks = $channel->getTracks('36');			// With "days" format

getOrders()

Return the list of orders imported from Qapla, with a maximum limit of 100 orders per call.
You must indicate a "startDate", and you can use a date in format "Y-m-d H:i:s" or an integer number like "36" to mean "36 days before today".

$orders = $channel->getOrders('2015-05-21 00:00:00');	// With "Y-m-d H:i:s" format
$orders = $channel->getOrders('36');			// With "days" format

pushOrder()

Allows you to load one or more orders via a POST request in JSON format.
The $data array PHP must follows the guidelines described here: https://api.qapla.it/#pushOrder

$data = array(...);
$channel->pushOrder($data);

getCredits()

Return the amount of the remaining credits on your premium account.

$credits = $channel->getCredits();

getCouriers()

Return the list of couriers either total, or for single country/region.

$couriers = $channel->getCouriers();

Qapla

Your shipments' best friend.

  • Complete control on problematic shipments
  • 59 couriers supported in only one dashboard
  • Status auto-update and custom tracking page
  • Transactional email and support ticket
  • Multi-store and multi-platform integration

Documentation

Website: https://www.qapla.it
API: https://api.qapla.it
Webhook: https://webhook.qapla.it

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email :author_email instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.