PHPackages                             terminal42/swissbilling-api - 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. terminal42/swissbilling-api

ActiveLibrary[API Development](/categories/api)

terminal42/swissbilling-api
===========================

Client for the SwissBilling API

1.1.0(2y ago)010331MITPHPPHP ^8.1

Since Mar 20Pushed 2y ago2 watchersCompare

[ Source](https://github.com/terminal42/swissbilling-api)[ Packagist](https://packagist.org/packages/terminal42/swissbilling-api)[ Docs](https://github.com/terminal42/swissbilling-api)[ GitHub Sponsors](https://github.com/terminal42)[ Fund](https://ko-fi.com/terminal42)[ RSS](/packages/terminal42-swissbilling-api/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (3)Used By (1)

SwissBilling API Client
=======================

[](#swissbilling-api-client)

An API client for [SwissBilling](https://www.swissbilling.ch) written in PHP.

**ATTENTION:** This repo is still in early development and subject to changes!

Installing
----------

[](#installing)

```
composer require terminal42/swissbilling-api

```

Usage
-----

[](#usage)

### Basics

[](#basics)

Use the `Client` object to interact with the API. All API types have DocBlock properties, so a smart IDE (like PhpStorm) will give you autocomplete support on the properties.

```
use Terminal42\SwissbillingApi\Client;
use Terminal42\SwissbillingApi\Api\ApiFactory;
use Terminal42\SwissbillingApi\Type\Debtor;
use Terminal42\SwissbillingApi\Type\Merchant;
use Terminal42\SwissbillingApi\Type\InvoiceItem;
use Terminal42\SwissbillingApi\Type\Transaction;
use Terminal42\SwissbillingApi\Type\TransactionStatus;

$client = new Client(new ApiFactory());

$merchant = new Merchant('user', 'password', 'success_url', 'cancel_url', 'error_url');

$transaction = new Transaction();
// fill in the required transaction properties
// $transaction->amount = 100;

$debtor = new Debtor();
// fill in the required debtor properties
// $transaction->firstname = 'John';
// $transaction->lastname = 'Doe';

$items = [
    new InvoiceItem(),
];

/** @var TransactionStatus $status */
$status = $client->request($transaction, $debtor, $items, $merchant);

var_dump($status->hasError());
```

### Multiple calls / Dependency Injection

[](#multiple-calls--dependency-injection)

You can pass the merchant information to the Client instead of passing it on every method call, e.g. if using this in a Symfony bundle with dependency injection.

```
$merchant = new Merchant('user', 'password', 'success_url', 'cancel_url', 'error_url');
$client = new Client(new ApiFactory(), $merchant);

// No need to pass the merchant anymore
$status = $client->request($transaction, $debtor, $items);
```

Software Best Practice
----------------------

[](#software-best-practice)

This repository is following [SemVer](https://semver.org). If you rely on a stable API, make sure to install a version tag.

License
-------

[](#license)

Licensed under the [MIT license](https://github.com/terminal42/swissbilling-api/blob/master/LICENSE).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% 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 ~1416 days

Total

2

Last Release

824d ago

PHP version history (2 changes)1.0.0PHP ^7.1

1.1.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1073273?v=4)[Andreas Schempp](/maintainers/aschempp)[@aschempp](https://github.com/aschempp)

![](https://avatars.githubusercontent.com/u/481937?v=4)[Yanick Witschi](/maintainers/Toflar)[@Toflar](https://github.com/Toflar)

---

Top Contributors

[![aschempp](https://avatars.githubusercontent.com/u/1073273?v=4)](https://github.com/aschempp "aschempp (13 commits)")[![f-schnabel](https://avatars.githubusercontent.com/u/29004905?v=4)](https://github.com/f-schnabel "f-schnabel (1 commits)")

---

Tags

apipaymentswissbilling

### Embed Badge

![Health badge](/badges/terminal42-swissbilling-api/health.svg)

```
[![Health](https://phpackages.com/badges/terminal42-swissbilling-api/health.svg)](https://phpackages.com/packages/terminal42-swissbilling-api)
```

###  Alternatives

[everypay/everypay-php

1742.0k](/packages/everypay-everypay-php)

PHPackages © 2026

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