PHPackages                             weisl/hellocash-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. weisl/hellocash-php-sdk

ActiveLibrary[API Development](/categories/api)

weisl/hellocash-php-sdk
=======================

SDK to simplify the developer experience when working with the Hellocash API.

1.0.2(3y ago)326MITPHPPHP &gt;=8.1

Since Oct 17Pushed 3y ago1 watchersCompare

[ Source](https://github.com/kilianweisl/hellocash-php-sdk)[ Packagist](https://packagist.org/packages/weisl/hellocash-php-sdk)[ RSS](/packages/weisl-hellocash-php-sdk/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Hellocash PHP SDK
=================

[](#hellocash-php-sdk)

This is an unofficial PHP SDK implementation for the [Hellocash API](https://hellocash.docs.apiary.io/#). It helps accessing the API in an object oriented way and uses [Saloon](https://github.com/Sammyjo20/Saloon) as a wrapper for the API.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1

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

[](#installation)

`composer require weisl/hellocash-php-sdk`

Usage
-----

[](#usage)

Start making requests by creating a `HellocashClient` object:

```
$client = new HellocashClient('email@example.com', 'secret-password');
$response = $client->invoices()->all();
```

Please have a look at `src/Interfaces/HellocashClientInterface` to see how the API resources are accessible. Each Resource has an own Interface, e.g. `src/Interfaces/Resources/InvoiceResourceInterface` with more detailed information about the methods and the response types.

### Error Handling

[](#error-handling)

Basically, the SDK differs between 2 errors:

- Wrong usage of the SDK
- Wrong usage of the API

You can see the difference in the examples below. Just note that e.g. if you pass a wrong type as parameter to the SDK, it will throw an Exception. More specifically, the SDK throws one exception named `SDKRequestFailedException`. If you can get through and make an actual request to the API, which fails because there is e.g. no invoice with the ID you passed, you will always get a response in the format of:

```
[
  'error' => 'Invoice with ID 123 not found'
]
```

### Example: Invoices

[](#example-invoices)

This example will guide you through the usage of the SDK.

#### all()

[](#all)

Every resource in the SDK provides an `all()` method, which does what you may expect: It gets *all* documents from the resource. This also handles pagination for you (so you don't need to handle the limit, offset, etc.).

```
$client->invoices()->all(); // gets all resources, no matter how many
```

This returns the documents directly as array, or an empty array, if there are no documents.

#### query()

[](#query)

Say you want to search for specific invoices. Some resources support parameters, e.g. `limit, offset, search, ...`. A full API request could look something like this: `https://api.hellocash.business/api/v1/invoices?limit=1000&offset=1&search=test&showDetails=true`. Since `all()` might take a long time to fetch and is also unusable in case there are many, many documents, you can take full advantage of all the query parameters with the `query()` method.

```
$client->invoices()->query([ // query all invoices with supported parameters
  'limit' => 50,
  'offset' => 2,
  ...
]);
```

This returns 1:1 the response from the API, so you can define the logic on your own. The SDK does some additional things for you: Validating the attributes you pass into the query function. If you pass a parameter, which is not supported by the API, the SDK will throw an `SDKRequestFailedException` with information what parameter is not valid. It also type-checks the value. When the API refers to the type *number*, it can either be an integer, a float or a double. The other types should be straight forward.

#### get()

[](#get)

Get one specific invoice with the `get(int $id)` method.

```
$client->invoices()->get($id); // get specific invoice by id
```

Since the API is not quite consistent with their error messages, the SDK does that for you. If no invoice is found with the ID you entered, the SDK provides a uniform error message, which looks like:

```
[
  'error' => 'Invoice with ID 123 not found',
]
```

#### cancel()

[](#cancel)

Cancel takes the ID of the invoice as parameter. You can also specify the cashier in the request body. In the SDK, you simply pass an array to the cancel method:

```
$client->invoices()->cancel($id, [
  'cancellation_cashier_id' => 123,
]);
```

Again, the SDK checks the parameters passed and handles type-checks for you. Interestingly, the API is not consistent with error messages (and also does not provide much information about the error). The SDK gives you the same format as with all errors:

```
[
  'error' => 'Cancellation of Invoice with 123 was not successful. API error message: An Error occurred',
]
```

#### create()

[](#create)

Creates an invoice.

```
$client->invoices()->create([
  'cashier_id' => 123,
  'items' => [
      [
        'item_name' => 'test',
      ],
  ],
]);
```

Again, the body will be validated and type-checked (first array hierarchy only).

#### pdf()

[](#pdf)

Get a pdf invoice.

```
$client->invoices()->pdf(123);
```

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

[](#contributing)

If you would like to improve something, or if there are any bugs, feel free to contact me via email or create an issue.

Testing
-------

[](#testing)

`vendor/bin/phpunit`

Documentation
-------------

[](#documentation)

See the [Hellocash API documentation](https://hellocash.docs.apiary.io/#) or the Interfaces inside the `src/Interfaces` directory of this package.

License
-------

[](#license)

This package is licensed under [MIT](https://en.wikipedia.org/wiki/MIT_License) License.

Please note that I am not affiliated with Hellocash in any kind. All copyrights to this name, brand, etc. belong to the respective owner(s) and not me.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~44 days

Total

3

Last Release

1266d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/87f6e5ec0462bf0f0653a7e36e3044fdfbddead8a7f89ce570e86850e7e04692?d=identicon)[kilianweisl](/maintainers/kilianweisl)

---

Top Contributors

[![kilianweisl](https://avatars.githubusercontent.com/u/33355205?v=4)](https://github.com/kilianweisl "kilianweisl (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/weisl-hellocash-php-sdk/health.svg)

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

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k54.9M11.6k](/packages/illuminate-database)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[illuminate/support

The Illuminate Support package.

630113.0M41.1k](/packages/illuminate-support)[illuminate/filesystem

The Illuminate Filesystem package.

16165.0M3.2k](/packages/illuminate-filesystem)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[illuminate/validation

The Illuminate Validation package.

18838.2M1.7k](/packages/illuminate-validation)

PHPackages © 2026

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