PHPackages                             friendsofapi/billogram - 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. friendsofapi/billogram

ActiveLibrary[API Development](/categories/api)

friendsofapi/billogram
======================

Library for connecting to the Billogram v2 API

1.12.1(10y ago)217.4k↓33.3%3[1 issues](https://github.com/FriendsOfApi/billogram/issues)[1 PRs](https://github.com/FriendsOfApi/billogram/pulls)MITPHPPHP &gt;=5.3.0

Since Oct 31Pushed 6y ago3 watchersCompare

[ Source](https://github.com/FriendsOfApi/billogram)[ Packagist](https://packagist.org/packages/friendsofapi/billogram)[ Docs](https://billogram.com/api/documentation)[ RSS](/packages/friendsofapi-billogram/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (8)Used By (0)

Billogram v2 API Client
=======================

[](#billogram-v2-api-client)

[![Latest Version](https://camo.githubusercontent.com/20b89bbc99326b4ebdccf41b36407eeb8a9c4dc786834aecbcf2bd9b24e42ccc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f467269656e64734f664170692f62696c6c6f6772616d2e7376673f7374796c653d666c61742d737175617265)](https://github.com/FriendsOfApi/billogram/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/0bd0639ed22472a579c47c4003997b9d673dcd96a35b0baf1ea04db3e3ee2e05/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f467269656e64734f664170692f62696c6c6f6772616d2e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/FriendsOfApi/billogram)[![Code Coverage](https://camo.githubusercontent.com/926880375a35b198173e732c14da11e96d579c16f21468bb62775084c11b8a3f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f667269656e64736f666170692f62696c6c6f6772616d2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/friendsofapi/billogram)[![Quality Score](https://camo.githubusercontent.com/04270b2dc09f16b5cc22fe41dd9560c59f3b2b02351efb51e1b48a34fd2f1cf3/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f667269656e64736f666170692f62696c6c6f6772616d2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/friendsofapi/billogram)[![Total Downloads](https://camo.githubusercontent.com/6cb5dc4afd1a905ccf15fda420d635492acb080398e2dc8a6f9d4e3db4602574/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f667269656e64736f666170692f62696c6c6f6772616d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/friendsofapi/billogram)

This Billogram fork was created to because we wanted to have a modern API client that followed PHP standards. Attempts were made to improve the original library but they were quickly shutdown. This fork will live "forever".

Installation:
-------------

[](#installation)

```
composer require friendsofapi/billogram php-http/guzzle6-adapter php-http/message
```

Why `php-http/guzzle6-adapter php-http/message`? We are decoupled from any HTTP messaging client with help by [HTTPlug](http://httplug.io/). Read about clients in the [HTTPlug docs](http://docs.php-http.org/en/latest/httplug/users.html).

Usage
-----

[](#usage)

First you need to register an account. it's recommend that you sign up on Billogram sandbox environment [Sandbox Billogram](https://sandbox.billogram.com/register) or on [Billogram](https://billogram.com), then generate an API user.

##### Authentication:

[](#authentication)

After you have generated an API user you need to create a BillogramClient and pass your user and the password to the factory function.

```
$billogram = BillogramClient::create($username, $apikey);
```

##### Create a customer:

[](#create-a-customer)

```
use Billogram\Model\Customer\CustomerContact;
use Billogram\Model\Customer\CustomerBillingAddress;
use Billogram\Model\Customer\CustomerDeliveryAddress;
use Billogram\Model\Customer\Customer;

$contact = CustomerContact::createFromArray(['name' => 'ib92g', 'email' => 'ib922@gmail.com', 'phone' => '0712223344']);
$addressCustomer = CustomerBillingAddress::createFromArray(['careof' => 'ibrahim', 'use_careof_as_attention' => false, 'street_address' => 'Flygarvägen 189B', 'zipcode' => '175 69', 'city' => 'Järfälla', 'country' => 'SE']);
$addressDelivery = CustomerDeliveryAddress::createFromArray(['name' => 'ibrahim', 'street_address' => 'Flygarvägen 189B', 'careof' => 'ibrahim', 'zipcode' => '175 69', 'city' => 'Järfälla', 'country' => 'SE']);

$customer = new Customer();
$customer = $customer->withCustomerNo(1);
$customer = $customer->withName('Ibrahim AA');
$customer = $customer->withNotes('aa');
$customer = $customer->withOrgNo('556801-7155');
$customer = $customer->withVatNo('SE556677889901');
$customer = $customer->withContact($contact);
$customer = $customer->withAddress($addressCustomer);
$customer = $customer->withDeliveryAddress($addressDelivery);
$customer = $customer->withCompanyType('individual');

$customer = $billogram->customers()->create($customer->toArray());
```

##### Fetch a customer:

[](#fetch-a-customer)

```
$customer = $billogram->customers()->fetch($customerNo);
```

##### Create an item:

[](#create-an-item)

```
use Billogram\Model\Item\Bookkeeping;
use Billogram\Model\Item\Item;

$bookkeeping = Bookkeeping::createFromArray(['income_account' => '302', 'vat_account' => '303']);
$item = new Item();
$item = $item->withTitle('cc');
$item = $item->withDescription('cc');
$item = $item->withPrice(12);
$item = $item->withVat(12);
$item = $item->withUnit('hour');
$item = $item->withBookkeeping($bookkeeping);

$item = $billogram->items()->create($item->toArray());
```

##### Fetch items:

[](#fetch-items)

```
$items = $billogram->items()->search(['page' => 1]);
```

##### Delete an item:

[](#delete-an-item)

```
$billogram->items()->delete($itemNo);
```

##### Create an invoice:

[](#create-an-invoice)

We consider that you have created a customer and an item (See the docs above) and you will you them to create a new invoice:

```
use Billogram\Model\Invoice\Item;
use Billogram\Model\Invoice\Invoice;

// ...

$itemOfinvoice = new Item();
$itemOfinvoice = $itemOfinvoice->withItemNo($itemFetched->getItemNo());
$itemOfinvoice = $itemOfinvoice->withCount(2)
$itemOfinvoice = $itemOfinvoice->withDiscount(1)

$invoice = new Invoice();
$invoice = $invoice->withCustomer($customer);
$invoice = $invoice->withItems([$itemOfinvoice]);
$invoice = $invoice->withInvoiceDate('2013-11-14');

$invoice = $billogram->invoices()->create($invoice->toArray());
```

API documentation
-----------------

[](#api-documentation)

The [Billogram API documentation](https://billogram.com/api/documentation) is a good place to start if you want to learn more of the API.

Contribute
----------

[](#contribute)

Do you want to make a change? Pull requests are welcome.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity63

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

Recently: every ~321 days

Total

7

Last Release

3186d ago

Major Versions

1.12.1 → 2.0.0-alpha12017-08-27

PHP version history (2 changes)v1.0PHP &gt;=5.3.0

2.0.0-alpha1PHP ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/401ccc5eea13c60cf807ae982af00e368e2166e2f26d8eb541dcd881a57385bc?d=identicon)[Nyholm](/maintainers/Nyholm)

---

Top Contributors

[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (17 commits)")[![Ibrahimhizeoui](https://avatars.githubusercontent.com/u/23564278?v=4)](https://github.com/Ibrahimhizeoui "Ibrahimhizeoui (12 commits)")[![kalaspuff](https://avatars.githubusercontent.com/u/89139?v=4)](https://github.com/kalaspuff "kalaspuff (9 commits)")[![magnusnordlander](https://avatars.githubusercontent.com/u/165002?v=4)](https://github.com/magnusnordlander "magnusnordlander (4 commits)")[![peshi](https://avatars.githubusercontent.com/u/782150?v=4)](https://github.com/peshi "peshi (3 commits)")[![haxzorer](https://avatars.githubusercontent.com/u/11200663?v=4)](https://github.com/haxzorer "haxzorer (2 commits)")[![murtlest](https://avatars.githubusercontent.com/u/1088263?v=4)](https://github.com/murtlest "murtlest (1 commits)")[![jongotlin](https://avatars.githubusercontent.com/u/165154?v=4)](https://github.com/jongotlin "jongotlin (1 commits)")[![Railslide](https://avatars.githubusercontent.com/u/5789142?v=4)](https://github.com/Railslide "Railslide (1 commits)")

---

Tags

api

### Embed Badge

![Health badge](/badges/friendsofapi-billogram/health.svg)

```
[![Health](https://phpackages.com/badges/friendsofapi-billogram/health.svg)](https://phpackages.com/packages/friendsofapi-billogram)
```

###  Alternatives

[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)

PHPackages © 2026

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