Download the PHP package trunkrs/sdk without Composer

On this page you can find all versions of the php package trunkrs/sdk. 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 sdk

Trunkrs SDK for PHP

CI Coverage Status Latest Stable Version License

The Trunkrs software development kit for the public client SDK. With this PHP SDK you can manage your shipments, shipment states and webhooks within our system.

Migrate from version 1

Check out our migration guide if you wish to migrate your v1 implementation of the Trunkrs SDK.

Requirements

PHP 7.0 and later.

Installation

You can install the SDK via Composer. Run the following command:

To use the bindings, use Composer's autoload:

Dependencies

The SDK requires the following extensions in order to work properly:

If you use Composer, these dependencies should be handled automatically.

Getting started

Setup the SDK settings before usage by supplying your merchant credentials. If you don't have any credentials yet, please contact Trunkrs for more information.

Using staging

To make use of the Trunkrs staging environment, which has been supplied to test your implementation with our system. The SDK can be switched easily.

Both API endpoints and the tracking URL's will point to the staging environment.

Shipments

Create a shipment

A shipment can be created through the Shipment class. It exposes a static method Shipment::create(...).

International shipping

When shipping internationally we require you to define the contents of a parcel as well as the volume and weight of the parcel.

Retrieve shipment details

Details for a single shipment can be retrieved through its identifier by calling the Shipment::find($trunkrsNr) method.

Retrieve shipment history

Your shipment history can be listed in a paginated manner by using the Shipment::retrieve($page) method. Every returned page contains a maximum of 50 shipments.

Cancel a shipment

Shipments can be canceled by their identifier or simply through the cancel() method on an instance of a Shipment.

The Shipment class exposes the cancelByTrunkrsNr($trunkrsNr) static method:

An instance of the Shipment class also exposes a convenience method cancel():

Shipment State

To retrieve details about the shipment's current state and the current owner of the shipment. The ShipmentState class can be used which exposes the static forShipment($shipmentId) method.

Web hooks

To be notified about shipment state changes, Trunkrs has created a webhook notification service. The SDK allows the registration of a callback URL for notifications through this service.

Register subscription

The Webhook class exposes a static method called register($webhook) which allows the registration of new web hooks:

Retrieve active subscriptions

Your active webhook subscriptions can be listed using Webhook::retrieve().

Cancel subscription

Canceling a web hook subscription can be done using Webhook::removeById($webhookId) or the instance method on an instance of webhook.


All versions of sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
guzzlehttp/guzzle Version ^6|^7
ext-json Version *
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 trunkrs/sdk contains the following files

Loading the files please wait ....