PHPackages                             voov/billingo-api-datamapper - 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. voov/billingo-api-datamapper

ActiveLibrary[API Development](/categories/api)

voov/billingo-api-datamapper
============================

Billingo API DataMapper

0.1(10y ago)012MITPHP

Since Feb 23Pushed 10y ago1 watchersCompare

[ Source](https://github.com/voov/Billingo-API-DataMapper)[ Packagist](https://packagist.org/packages/voov/billingo-api-datamapper)[ RSS](/packages/voov-billingo-api-datamapper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Billingo API Data Mapper
========================

[](#billingo-api-data-mapper)

***WARNING: The functions of this package are highly experimental, and not yet recommended for production use!***

This library provides CRUD access for Billingo API with data mapped models created for every API endpoint:

- Invoices (`Billingo\API\DataMapper\Models\Invoices`)
- Invoice blocks (`Billingo\API\DataMapper\Models\InvoiceBlocks`)
- Bank accounts (`Billingo\API\DataMapper\Models\BankAccounts`)
- Expenses (`Billingo\API\DataMapper\Models\Expenses`)
- Clients (`Billingo\API\DataMapper\Models\Clients`)
- Payment methods (`Billingo\API\DataMapper\Models\PaymentMethods`)
- Vat (`Billingo\API\DataMapper\Models\Vat`)

Factory
-------

[](#factory)

While you can use the included models without using the Billingo Factory it is not recommended.

```
use Billingo\API\Connector\HTTP\Request;
use Billingo\API\DataMapper\BillingoFactory;

$client = new Request([
    'public_key' => 'YOUR_PUBLIC_KEY',
    'private_key' => 'YOUR_PRIVATE_KEY',
]);
$factory = new BillingoFactory($client);
```

Usage
-----

[](#usage)

### Loading using the class constant

[](#loading-using-the-class-constant)

When using PHP 5.6+, you can use the `::class` constant when specifying the model to make

```
use Billingo\API\DataMapper\Models\Clients;
$clients = $factory->make(Clients::class)->loadAll();
```

### Loading using name

[](#loading-using-name)

Load class using the name of the class.

```
$vat = $factory->makeFromName('vat')->loadAll();
```

### Loading given ID

[](#loading-given-id)

Instead of loading every model using `loadAll` you can use the `load` function to load a single resource.

```
$client = $factory->make(Clients::class)->load('12344567');
```

### Creating a new resource

[](#creating-a-new-resource)

To create a new resource, you use the same factory method.

```
use Billingo\API\DataMapper\Models\Clients;
$client = $factory->make(Clients::class);

// you can either use magic variables
$client->name = 'Test Client Co.';

// or simple fill the whole model with an array
$client->fill([
  'name' => 'Test Client Co.'
  // ...
]);

$client->save();
```

### Update a resource

[](#update-a-resource)

You can easily update an already saved resource by first loading it then modifying the neccessary fields and calling the `save` method. The underlying library knows that it needs to update the resource instead of creating a new.

```
use Billingo\API\DataMapper\Models\Clients;
$client = $factory->make(Clients::class)->load('12344567');
$client->name = 'Test Client Updated Co.';
$client->save();
```

### Delete a resource

[](#delete-a-resource)

To delete a resource first simple load the resource and then call the `delete` function.

```
use Billingo\API\DataMapper\Models\Clients;
$client = $factory->make(Clients::class)->load('12344567')->delete();
```

Special invoice functions
-------------------------

[](#special-invoice-functions)

There are a couple of auxilary functions in the Invoice model that can make the usage even easier.

```
use Billingo\API\DataMapper\Models\Invoices;
$invoice = $factory->make(Invoices::class)->load('12344567');
$invoice->pay(3500, 1);
```

### Pay

[](#pay)

Set invoice paid, or partially paid

```
public function pay($amount, $paymentMethodId, $date=null)
```

### Cancel

[](#cancel)

Cancel the invoice. The function returns the new cancel invoice.

```
public function cancel()
```

### Send

[](#send)

Send the invoice to the client

```
public function send()
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

3727d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/44952ac11bee81804ffd10caecf0e48b8bdba1161efade40a781232b1641aa13?d=identicon)[danfekete](/maintainers/danfekete)

### Embed Badge

![Health badge](/badges/voov-billingo-api-datamapper/health.svg)

```
[![Health](https://phpackages.com/badges/voov-billingo-api-datamapper/health.svg)](https://phpackages.com/packages/voov-billingo-api-datamapper)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

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

A PHP wrapper for Twilio's API

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

GitHub API v3 client

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

PHP SDK for Facebook Business

90121.9M33](/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.1M452](/packages/google-gax)

PHPackages © 2026

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