PHPackages                             opensoft/inkrouter-php-sdk - 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. opensoft/inkrouter-php-sdk

ActiveLibrary[API Development](/categories/api)

opensoft/inkrouter-php-sdk
==========================

Small sdk for connecting to OpenSoft Job Submission Interface

2.0.0(2y ago)218.8k11[3 PRs](https://github.com/opensoft/InkRouter-PHP-SDK/pulls)PHPPHP &gt;=7.2.0CI failing

Since Jun 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/opensoft/InkRouter-PHP-SDK)[ Packagist](https://packagist.org/packages/opensoft/inkrouter-php-sdk)[ RSS](/packages/opensoft-inkrouter-php-sdk/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (10)Dependencies (1)Versions (22)Used By (0)

Introduction
============

[](#introduction)

InkRouter's PHP SDK is the Job Submission interface to the InkRouter Printing Network. To send print orders directly from your website to InkRouter, you will use the InkRouter PHP SDK as documented here.

The InkRouter PHP SDK is a library for easy interaction with the InkRouter interface from PHP.

[![Build Status](https://camo.githubusercontent.com/f0d5fc532244aaf3c09518740a750d7551d493fedc98aa693ab134ff268ef2da/68747470733a2f2f7472617669732d63692e6f72672f6f70656e736f66742f496e6b526f757465722d5048502d53444b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/opensoft/InkRouter-PHP-SDK)

Requirements
============

[](#requirements)

This SDK requires:

- PHP 5.0.x and up
- libxml PHP extension

Installation
============

[](#installation)

With Composer:

```
$ composer require opensoft/inkrouter-php-sdk

```

Without Composer:

- Download a zip [file](https://github.com/opensoft/InkRouter-PHP-SDK/zipball/1.0)
- Unpack downloaded zip in any directory in your project (for example /path/to/your/project/libs/InkRouter)
- InkRouter PHP SDK can use any PSR0 compatible autoloader, or you can use the one included in `tests/bootstrap.php`with a simple `require_once` statement

InkRouter Workflow
==================

[](#inkrouter-workflow)

InkRouter interface workflow consists of 6 actions:

- Get InkRouter client instance
- Create and fill InkRouter\_Models\_OrderInfo instance
- Create order to InkRouter
- Update order (optional)
- Place on hold order (optional)
- Remove hold order (optional)
- Cancel order (optional)
- Receive order updates from InkRouter

Get InkRouter client instance
-----------------------------

[](#get-inkrouter-client-instance)

Prior to performing any operations, perform get instance of InkRouter client, example:

```
$InkRouterClient = new InkRouter_Client_Client($wsdl, $printCustomerId, $secretKey);

```

Where:

- `$wsdl` is url of InkRouter service
- `$printCustomerId` is your unique identificator from InkRouter
- `$secretKey` is your secret key

Create InkRouter\_Models\_OrderInfo instance (with example data)
----------------------------------------------------------------

[](#create-inkrouter_models_orderinfo-instance-with-example-data)

```
$contact = new InkRouter_Models_Contact();
$contact->setName('contact_name')
    ->setPhone('contact_phone')
    ->setEmail('contact_email');

$headerInfo = new InkRouter_Models_HeaderInfo();
$headerInfo->setFromDomain('yoursite.com')
    ->setFromIdentity('your_identity');

$shipType = new InkRouter_Models_ShipType();
$shipType->setMethod('UPS')
    ->setServiceLevel('GROUND');

$shipAddress = new InkRouter_Models_ShipAddress();
$shipAddress->setAttention('Attention')
    ->setStreetAddress('742 Evergreen Terrace')
    ->setCity('Springfield')
    ->setState('CA')
    ->setZip('1234567')
    ->setCountry('USA');

$requester = new InkRouter_Models_Requester();
$requester->setName('Any Prints')
    ->setContract('STANDARD')
    ->setPayTerm('FREE');

$poInfo = new InkRouter_Models_PoInfo();
$poInfo->setAgentId('agentId')
    ->setCurrency('US');

$printAsset = new InkRouter_Models_PrintAsset();
$printAsset->setPositionX(4.98)
    ->setPositionY(3.1)
    ->setRotation(-90)
    ->setType('BARCODE')
    ->setHeight(0.543)
    ->setWidth(2.12);

$side = new InkRouter_Models_Side();
$side->setPageNumber(10)
    ->setFileUrl('http://server/img.jpg')
    ->setFileHash('0a0825909aa15a98b00574661f23aee7')
    ->setCoating('NONE')
    ->setOrientation('Landscape')
    ->addPrintAsset($printAsset);

$attributes = new InkRouter_Models_Attributes_ScalarBooleanAttribute();
    $attributes->setType('LABELING');
    $attributes->setValue(true);

$orderItem = new InkRouter_Models_OrderItem();
$orderItem->setPrintGroupId('pg4f7969f8a4811')
    ->setProductType('business cards')
    ->setPaperType('14PT')
    ->setQuantity(500)
    ->setRegionSize('US')
    ->setCost(20.3)
    ->addAttributes($attributes)
    ->addSide($side);

$order = new InkRouter_Models_Order();
$order->setPrintCustomerInvoice(123456789)
    ->setTsCreated(date(DATE_ATOM, strtotime('now')))
    ->setPriority(0)
    ->setShippingFee(10)
    ->setProductDiscounts(0)
    ->setShippingDiscounts(0)
    ->setVendorId('vendor_id')
    ->setContact($contact)
    ->setShipType($shipType)
    ->setRequester($requester)
    ->setShipAddress($shipAddress)
    ->addOrderItem($orderItem);

$orderInfo = new InkRouter_Models_OrderInfo();
$orderInfo->setHeaderInfo($headerInfo)
    ->setPrintCustomerId('ID')
    ->setPoInfo($poInfo)
    ->setOrder($order);

```

Create order to InkRouter
-------------------------

[](#create-order-to-inkrouter)

After creating the instance of InkRouter Models\_OrderInfo Create Order to InkRouter as below:

```
try {
    $orderId = $InkRouterClient->createOrder($timestamp, $orderInfo);
} catch (InkRouter_Exceptions_Exception $e) {
    echo 'Create operation failed';
}

```

Where:

- `$timestamp` is unix timestamp (result of mktime() function), if your last operation was unsuccessful, you can resend it with same timestamp
- `$orderInfo` is an instance of InkRouter\_Models\_OrderInfo (see example)
- `$orderId` is an order identification, received from InkRouter

Update order
------------

[](#update-order)

You should first create instance of InkRouter Models OrderInfo and call update method:

```
try {
    $InkRouterClient->updateOrder($orderId, $timestamp, $orderInfo);
} catch (InkRouter_Exceptions_Exception $e) {
    echo 'Update operation failed';
}

```

Where:

- `$orderId` is identifier of order for update

Place on hold order
-------------------

[](#place-on-hold-order)

For place on hold order with id `$orderId` you should do:

```
try {
    $InkRouterClient->placeOnHold($orderId, $timestamp);
} catch (InkRouter_Exceptions_Exception $e) {
    echo 'Place on hold operation failed';
}

```

Remove hold order
-----------------

[](#remove-hold-order)

For remove order from hold with id `$orderId` you should do:

```
try {
    $InkRouterClient->removeHold($orderId, $timestamp);
} catch (InkRouter_Exceptions_Exception $e) {
    echo 'Remove hold operation failed';
}

```

Cancel order
------------

[](#cancel-order)

For cancel order with id `$orderId` you should do:

```
try {
    $InkRouterClient->cancelOrder($orderId, $timestamp);
} catch (InkRouter_Exceptions_Exception $e) {
    echo 'Cancel operation failed';
}

```

Receive order updates from InkRouter
------------------------------------

[](#receive-order-updates-from-inkrouter)

For successful receiving update messages from InkRouter, you should make any controller, which can receive post requests, add url of this controller in your account through InkRouter-dashboard. Then you can use InkRouter\_Response\_Response class for parsing xml string from post content:

```
$updates = InkRouter_Response_Response::fromPack($xml)->getUpdates();

```

where `$updates` is array of InkRouter\_Response\_Update objects and you can use it as you want.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~167 days

Recently: every ~326 days

Total

21

Last Release

996d ago

Major Versions

1.8.0 → 2.0.02023-08-24

PHP version history (2 changes)1.0.0PHP &gt;=5.0.0

2.0.0PHP &gt;=7.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/a39488bf3a486007486e38ab85aef162e86b29be6bc48ed69d68e5186b9a7fad?d=identicon)[richardfullmer](/maintainers/richardfullmer)

---

Top Contributors

[![richardfullmer](https://avatars.githubusercontent.com/u/384602?v=4)](https://github.com/richardfullmer "richardfullmer (23 commits)")[![scottdriscoll](https://avatars.githubusercontent.com/u/1554882?v=4)](https://github.com/scottdriscoll "scottdriscoll (7 commits)")[![rbunce](https://avatars.githubusercontent.com/u/1913028?v=4)](https://github.com/rbunce "rbunce (5 commits)")[![maria-p](https://avatars.githubusercontent.com/u/726469?v=4)](https://github.com/maria-p "maria-p (4 commits)")[![bstrx](https://avatars.githubusercontent.com/u/1029105?v=4)](https://github.com/bstrx "bstrx (3 commits)")[![fightmaster](https://avatars.githubusercontent.com/u/648770?v=4)](https://github.com/fightmaster "fightmaster (2 commits)")[![zsapozhnikov](https://avatars.githubusercontent.com/u/1200491?v=4)](https://github.com/zsapozhnikov "zsapozhnikov (1 commits)")[![true2trance](https://avatars.githubusercontent.com/u/739151?v=4)](https://github.com/true2trance "true2trance (1 commits)")[![alessio-pani](https://avatars.githubusercontent.com/u/5681332?v=4)](https://github.com/alessio-pani "alessio-pani (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/opensoft-inkrouter-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/opensoft-inkrouter-php-sdk/health.svg)](https://phpackages.com/packages/opensoft-inkrouter-php-sdk)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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