PHPackages                             simplesquid/vend-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. simplesquid/vend-sdk

ActiveLibrary[API Development](/categories/api)

simplesquid/vend-sdk
====================

An unoffical PHP SDK for Vend POS

v0.5.21(2y ago)31.6k4[5 issues](https://github.com/simplesquid/vend-sdk/issues)1MITPHPPHP ^7.3

Since Aug 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/simplesquid/vend-sdk)[ Packagist](https://packagist.org/packages/simplesquid/vend-sdk)[ Docs](https://github.com/simplesquid/vend-sdk)[ RSS](/packages/simplesquid-vend-sdk/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (7)Versions (52)Used By (1)

Vend SDK (a PHP client)
=======================

[](#vend-sdk-a-php-client)

[![Latest Version on Packagist](https://camo.githubusercontent.com/dd627997a9b45f156b0170d37d95e7b37f0bb6fe7f337fd774e62dbd5d266fbd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696d706c6573717569642f76656e642d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/simplesquid/vend-sdk)[![Build Status](https://camo.githubusercontent.com/d6057e22c0f2e3f5763882f4d88cb364d4298905e8f21bb78857d4d2c380bb48/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f73696d706c6573717569642f76656e642d73646b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/simplesquid/vend-sdk)[![MIT License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/b6fc02af44476464c8c822c76ca2d63f1228ad830a0d58254ff720ddd0f1ecb8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73696d706c6573717569642f76656e642d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/simplesquid/vend-sdk)

An unofficial PHP SDK for the [Vend POS API](https://docs.vendhq.com/).

Installation
------------

[](#installation)

You can install this package via composer:

```
composer require simplesquid/vend-sdk
```

Setup
-----

[](#setup)

To setup, get the instance of the SDK and set the desired user agent and settings:

```
$vend = Vend::getInstance();

/* Optional configuration. */
$vend->userAgent('Vend SDK')
     ->requestTimeout(2)
     ->confirmationTimeout(30);
```

It is advisable that you use the client object as a singleton, however, there is no explicit restriction for this.

Usage
-----

[](#usage)

This outlines a typical sequence of instructions, but is not a complete list of all the functionality of the SDK. Please review the code for more advanced usages. It is also suggested you read the [Vend API documentation](https://docs.vendhq.com/).

Alternatively, you can see a working authorisation implementation in our [Laravel Vend SDK package](https://github.com/simplesquid/laravel-vend-sdk).

### Authorisation

[](#authorisation)

You have two options for authorisation with the Vend API, a Personal Access Token or OAuth 2.0.

#### Personal Access Token

[](#personal-access-token)

When using the Personal Access Token, simply setup the Vend client like so:

```
$vend->domainPrefix($domain_prefix)
     ->personalAccessToken($access_token);
```

#### OAuth 2.0

[](#oauth-20)

Setup the Vend client with the OAuth identifiers:

```
$vend->clientId($client_id)
     ->clientSecret($client_secret)
     ->redirectUri($redirect);
```

##### Initial authorisation procedure

[](#initial-authorisation-procedure)

Send the user to the OAuth URL generated by:

```
$vend->getAuthorisationUrl($previous_url);
```

Use the domain prefix and authorisation code returned from the OAuth process:

```
/** @var \SimpleSquid\Vend\Resources\OneDotZero\Token */
$token = $vend->domainPrefix($domain_prefix)
              ->oAuthAuthorisationCode($code);
```

Make sure you store the returned Token object and the domain prefix.

##### Subsequent setup procedure

[](#subsequent-setup-procedure)

Once you have received the initial authorisation, you may setup the Vend client using the Token object received during the authorisation process:

```
$vend->authorisationToken($token);
```

If a request throws a `\SimpleSquid\Vend\Exceptions\TokenExpiredException`, you can refresh the token like so:

```
/** @var \SimpleSquid\Vend\Resources\OneDotZero\Token */
$token = $vend->refreshOAuthAuthorisationToken();
```

Again, make sure you store the returned Token object.

### Requests

[](#requests)

To see all the available requests, take a look at traits located in the `Actions` folder. As an example, Products can be managed using the following requests:

```
/**
 * List products.
 * Returns a paginated list of products.
 *
 * @param  int|null   $page_size  The maximum number of items to be returned in the response.
 * @param  int|null   $after      The lower limit for the version numbers to be included in the response.
 * @param  int|null   $before     The upper limit for the version numbers to be included in the response.
 * @param  bool|null  $deleted    Indicates whether deleted items should be included in the response.
 *
 * @return \SimpleSquid\Vend\Resources\TwoDotZero\ProductCollection
 */
$products = $vend->product->get($page_size, $after, $before, $deleted);
```

```
/**
 * Get a single product.
 * Returns a single product object with a given ID.
 *
 * @param  string  $id  Valid product ID.
 *
 * @return \SimpleSquid\Vend\Resources\TwoDotZero\Product
 */
$product = $vend->product->find($id);
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

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

Credits
-------

[](#credits)

- [Matthew Poulter](https://github.com/mdpoulter)
- [Chun-Sheng, Li](https://github.com/peter279k)
- [All Contributors](../../contributors)

Package skeleton based on [spatie/skeleton-php](https://github.com/spatie/skeleton-php).

About us
--------

[](#about-us)

SimpleSquid is a small web development and design company based in Cape Town, South Africa.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance9

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.8% of commits — single point of failure

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

Recently: every ~183 days

Total

49

Last Release

574d ago

Major Versions

v0.5.21 → 1.x-dev2024-10-13

PHP version history (3 changes)v0.1.0PHP ^7.2

v0.4.0PHP ^7.3

1.x-devPHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![mdpoulter](https://avatars.githubusercontent.com/u/1091085?v=4)](https://github.com/mdpoulter "mdpoulter (88 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (2 commits)")

---

Tags

phppoint-of-salesdksdkpoint-of-salesimplesquidvendvend-sdk

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/simplesquid-vend-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/simplesquid-vend-sdk/health.svg)](https://phpackages.com/packages/simplesquid-vend-sdk)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M467](/packages/saloonphp-saloon)[temporal/sdk

Temporal SDK

4002.2M18](/packages/temporal-sdk)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[crowdin/crowdin-api-client

PHP client library for Crowdin API v2

611.5M5](/packages/crowdin-crowdin-api-client)[yoti/yoti-php-sdk

Yoti SDK for quickly integrating your PHP backend with Yoti

27539.9k1](/packages/yoti-yoti-php-sdk)

PHPackages © 2026

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