PHPackages                             konekt/factureaza-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. [Payment Processing](/categories/payments)
4. /
5. konekt/factureaza-sdk

ActiveLibrary[Payment Processing](/categories/payments)

konekt/factureaza-sdk
=====================

SDK for factureaza.ro API

1.6.0(1y ago)13.1k3MITPHPPHP ^8.1

Since Oct 10Pushed 1y ago2 watchersCompare

[ Source](https://github.com/artkonekt/factureaza-sdk)[ Packagist](https://packagist.org/packages/konekt/factureaza-sdk)[ GitHub Sponsors](https://github.com/fulopattila122)[ RSS](/packages/konekt-factureaza-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (10)Used By (0)

PHP 8.1 SDK for factureaza.ro API
=================================

[](#php-81-sdk-for-factureazaro-api)

[![Tests](https://camo.githubusercontent.com/617bca22f582903878d4b80cfd5e36beac2f372262919d1425034697da33159a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6172746b6f6e656b742f66616374757265617a612d73646b2f74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/artkonekt/factureaza-sdk/actions?query=workflow%3Atests)[![Packagist version](https://camo.githubusercontent.com/e6e1641d6f4650f55ed2d4a22c13d64cf1d371669f082cb3c19fba023f01b128/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6f6e656b742f66616374757265617a612d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/konekt/factureaza-sdk)[![Packagist downloads](https://camo.githubusercontent.com/4c961d359120d7835bd8c2800e8ddda4c9ad6d85f356240553a1c4000a9011cd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6f6e656b742f66616374757265617a612d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/konekt/factureaza-sdk)[![StyleCI](https://camo.githubusercontent.com/da207d951a375faa4fec83f9c47c380f4088fcef1c82d2fb679d32b9ba557648/68747470733a2f2f7374796c6563692e696f2f7265706f732f3533373433353332342f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/537435324)[![MIT Software License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

This package provides a PHP SDK for interacting with the [factureaza.ro GraphQL API](https://factureaza.ro/documentatie-api).

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

[](#installation)

> The minimum requirement of this package is PHP 8.1.

To install this library in your application, use composer:

```
composer require konekt/factureaza-sdk
```

Usage
-----

[](#usage)

### Live or Sandbox

[](#live-or-sandbox)

To connect to the live system, use the `connect` method and pass your api key:

```
$live = Factureaza::connect('api key here');
$live->myAccount();
// => Konekt\Factureaza\Models\MyAccount
//     id: "555000444",
//     name: "yourcompany",
//     companyName: "Your Company SRL",
//     createdAt: "2019-06-06T16:23:34+03:00",
//     updatedAt: "2022-09-13T08:03:29+03:00"
//     ...
```

To connect to the sandbox system, use the `sandbox` method:

```
$sandbox = Factureaza::sandbox();
$sandbox->myAccount();
// => Konekt\Factureaza\Models\MyAccount
//     id: "340138083",
//     name: "sandbox",
//     companyName: "Test Services SRL",
//     createdAt: "2014-06-06T16:23:34+03:00",
//     updatedAt: "2022-09-13T08:03:29+03:00"
//     ...
```

### Time Zone

[](#time-zone)

The factureaza.ro API returns dates in the Romanian time zone (Europe/Bucharest). This SDK returns dates in that timezone by default.

If you want dates to be returned in UTC, call the `useUTCTime()` method:

```
$factureaza = Factureaza::connect('api key');
$factureaza->myAccount()->createdAt->toIso8601String();
// 2014-06-06T16:23:34+03:00

$factureaza->useUtcTime();
$factureaza->myAccount()->createdAt->toIsoString();
// 2014-06-06T13:23:34+00:00
```

### Create an Invoice

[](#create-an-invoice)

```
$request = CreateInvoice::inSeries('1061104148')
    ->forClient('1064116434')
    ->withEmissionDate('2021-09-17')
    ->addItem(['description' => 'Service', 'price' => 19, 'unit' => 'luna', 'productCode' => '']);

$invoice = Factureaza::sandbox()->createInvoice($request);
//=> Konekt\Factureaza\Models\Invoice {#2760
//     +documentDate: Carbon\CarbonImmutable @1631826000 {#2773
//       date: 2021-09-17 00:00:00.0 Europe/Bucharest (+03:00),
//     },
//     +clientId: "1064116434",
//     +items: [
//       Konekt\Factureaza\Models\InvoiceItem {#2765
//         +description: "Service",
//         +price: 19.0,
//         +unit: "luna",
//         +quantity: 1.0,
//         +productCode: "",
//         +id: "1056077322",
//       },
//     ],
//     +id: "1065254080",
//     +createdAt: Carbon\CarbonImmutable @1665076996 {#2772
//       date: 2022-10-06 20:23:16.0 Europe/Bucharest (+03:00),
//     },
//     +updatedAt: Carbon\CarbonImmutable @1665076996 {#2771
//       date: 2022-10-06 20:23:16.0 Europe/Bucharest (+03:00),
//     },
//   }
```

### Document States

[](#document-states)

Invoices and other documents can have 4 states: `draft`, `open`, `closed`, `cancelled`.

When creating an Invoice, it will have the `open` state by default.

If you want to create an invoice with a different initial state, use one of the following methods on the `CreateInvoice` class:

- `asDraft()`
- `asClosed()`
- `asCancelled()`

```
$request = CreateInvoice::inSeries('1061104148')->asDraft();
//...
Factureaza::sandbox()->createInvoice($request);
```

or:

```
$request = CreateInvoice::inSeries('1061104148')->asClosed();
//...
Factureaza::sandbox()->createInvoice($request);
```

### Retrieve Invoice PDF

[](#retrieve-invoice-pdf)

The PDF of an Invoice can be retrieved in base64 encoded format:

```
$invoiceId = '1234567';
$pdf = Factureaza::connect('your-api-key')->invoiceAsPdfBase64($invoiceId);

// Mind decoding it when you want to save it:

file_put_contents('invoice.pdf', base64_decode($pdf));
```

### Retrieve a Single Invoice

[](#retrieve-a-single-invoice)

Unique invoices can be retrieved by id:

```
$invoiceId = '1065254039';
$invoice = Factureaza::connect('your-api-key')->invoice($invoiceId);
//=> Konekt\Factureaza\Models\Invoice {#2760
```

### Find Clients

[](#find-clients)

You can retrieve a client either by its Factureaza ID, or by tax number (cod fiscal).

#### Find a Client by Factureaza ID

[](#find-a-client-by-factureaza-id)

```
$client = Factureaza::sandbox()->client('1064116434');
//=> Konekt\Factureaza\Models\Client {#2691
//     +name: "CUBUS ARTS S.R.L.",
//     +isCompany: true,
//     +address: "BLD. MIHAI VITEAZU Nr. 7,Ap. 18",
//     +address2: "",
//     +zip: "550350",
//     +city: "SIBIU",
//     +province: "Sibiu",
//     +country: "RO",
//     +email: "office@cubus.ro",
//     +regNo: "J32 /508 /2000",
//     +taxNo: "13548146",
//     +taxNoPrefix: "RO",
//     +id: "1064116434",
//     +createdAt: Carbon\CarbonImmutable @1402061592 {#2708
//       date: 2014-06-06 16:33:12.0 Europe/Bucharest (+03:00),
//     },
//     +updatedAt: Carbon\CarbonImmutable @1402061592 {#2696
//       date: 2014-06-06 16:33:12.0 Europe/Bucharest (+03:00),
//     },
//   }
```

#### Find a Client By Other Fields

[](#find-a-client-by-other-fields)

By Tax Number:

```
$client = Factureaza::sandbox()->clientByTaxNo('13548146');
```

By E-mail address:

```
$client = Factureaza::sandbox()->clientByEmail('client@email.ro');
```

By name:

```
$client = Factureaza::sandbox()->clientByName('Client SRL');
```

### Create a Client

[](#create-a-client)

```
$client = Factureaza::sandbox()->createClient([
    'name' => 'Giovanni Gatto',
    'isCompany' => false,
    'city' => 'Pokyo',
    'address' => 'Mishiaza Vue 72',
]);
//=> Konekt\Factureaza\Models\Client {#2701
//     +name: "Giovanni Gatto",
//     +isCompany: false,
//     +address: "Mishiaza Vue 72",
//     +address2: null,
//     +zip: null,
//     +city: "Pokyo",
//     +province: null,
//     +country: "RO",
//     +email: null,
//     +phone: null,
//     +regNo: null,
//     +taxNo: "",
//     +taxNoPrefix: null,
//     +id: "1064116440",
//     +createdAt: Carbon\CarbonImmutable @1665343572 {#2692
//       date: 2022-10-09 22:26:12.0 Europe/Bucharest (+03:00),
//     },
//     +updatedAt: Carbon\CarbonImmutable @1665343572 {#2722
//       date: 2022-10-09 22:26:12.0 Europe/Bucharest (+03:00),
//     },
//   }
```

Factureaza identifies clients based on their `taxNo` (`uid` in Factureaza API) field, which represents either the tax number (CIF/CUI) of a company or the personal identification number (CNP) of a natural person.

If you try to create a client with a `taxNo` that already exists, a `ClientExistsException`is thrown.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 82.7% 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 ~88 days

Recently: every ~175 days

Total

9

Last Release

607d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c398dd02c93ecf6aa344f367f5744aeb32b4c7bbc23b1b22e95336f45bf0d5a?d=identicon)[konekt](/maintainers/konekt)

---

Top Contributors

[![fulopattila122](https://avatars.githubusercontent.com/u/1162360?v=4)](https://github.com/fulopattila122 "fulopattila122 (43 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (9 commits)")

---

Tags

billinginvoicingfactureazafactureaza.ro

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/konekt-factureaza-sdk/health.svg)

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

###  Alternatives

[lemonsqueezy/laravel

A package to easily integrate your Laravel application with Lemon Squeezy.

58596.1k](/packages/lemonsqueezy-laravel)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

264778.4k3](/packages/laravel-cashier-paddle)[glennraya/xendivel

A Laravel package to easily integrate Xendit payment gateway. It supports credit and debit cards, and e-wallet payments and custom invoices, queued notifications, webhook listeners and more.

412.3k](/packages/glennraya-xendivel)[asciisd/knet

Knet package is provides an expressive, fluent interface to KNet's payment services.

141.1k](/packages/asciisd-knet)

PHPackages © 2026

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