PHPackages                             texhub/virtual-pos-andoz - 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. texhub/virtual-pos-andoz

ActiveLibrary[Payment Processing](/categories/payments)

texhub/virtual-pos-andoz
========================

Virtual POS / fiscal cash register (Andoz / ОФД) API SDK for any PHP framework with first-class Laravel support: device status, shifts, receipts &amp; corrections, fiscal documents, X/FN/cash reports, cash in/out and universal counters.

v1.0.1(1mo ago)01MITPHPPHP ^8.2

Since Jun 12Pushed 1mo agoCompare

[ Source](https://github.com/TexhubPro/virtual-pos-andoz)[ Packagist](https://packagist.org/packages/texhub/virtual-pos-andoz)[ Docs](https://texhub.pro)[ RSS](/packages/texhub-virtual-pos-andoz/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (3)Used By (0)

TexHub · Virtual POS (Andoz / ОФД)
==================================

[](#texhub--virtual-pos-andoz--офд)

**English** · [Русский](README.ru.md)

[![License: MIT](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP](https://camo.githubusercontent.com/d91d3d1139cf0d8faaa80eeeeac7d3c59c9319e56960ef81c948e4160be4c4c1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322d3737376262342e737667)](composer.json)[![Laravel](https://camo.githubusercontent.com/3e9242504354dbb5afd360f9a1ec114126b2caddb73d9e789d9102c3285d2b05/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d3131253230253743253230313225323025374325323031332d6666326432302e737667)](#laravel)

A clean, framework-agnostic PHP SDK for the **Virtual POS / fiscal cash register API** (ОФД / Andoz, `vkassa-api.ofd.tj`) — device status, shifts, receipts &amp; corrections, fiscal documents, X/FN/cash reports, cash in/out and universal counters — with first-class **Laravel** support.

> **Full method reference** (every method, parameters &amp; example responses): [`docs/REFERENCE.md`](docs/REFERENCE.md) · [Русский](docs/REFERENCE.ru.md)

Features
--------

[](#features)

- **Receipts &amp; corrections** with a fluent builder (auto `receiptSum`, auto VAT)
- **Shift lifecycle** — status, open, close
- **Fiscal documents** — last, by FD number, by external id
- **Reports** — X-report, FN report, shift cash (инкассация), queue
- **Cash for change** — add / remove
- **Universal counters** — create, list, increase, decrease, reset, delete
- Typed **enums** (operation type, tax type, commodity, VAT, result codes)
- Fully **unit-tested**, no network needed (injectable transport)
- **Laravel** service provider, facade and publishable config

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

[](#requirements)

- PHP `^8.2`, `ext-curl`, `ext-json`
- Laravel 11/12/13 (optional)

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

[](#installation)

```
composer require texhub/virtual-pos-andoz
```

Quick start (any PHP project)
-----------------------------

[](#quick-start-any-php-project)

```
use TexHub\VirtualPosAndoz\VirtualPos;
use TexHub\VirtualPosAndoz\Enums\TaxType;
use TexHub\VirtualPosAndoz\Requests\Product;
use TexHub\VirtualPosAndoz\Requests\ReceiptRequest;

$pos = VirtualPos::make('YOUR_OFD_TOKEN');

// 1) Open a shift
$pos->register()->openShift('Бульбашев Б.Б.');

// 2) Issue a cash income receipt
$receipt = $pos->receipts()->create(
    ReceiptRequest::income(TaxType::General)
        ->addProduct(Product::make('Шкаф', price: 10000, quantity: 1))
        ->cash(10000)
        ->consumer('sim@mail.ru')
        ->externalId('7887788778')
);

echo $receipt->get('fdNumber');   // 3
echo $receipt->get('fpd');        // 0305354977

// 3) Close the shift
$pos->register()->closeShift('Бульбашев Б.Б.');
```

> All money values are in **minimal currency units** (e.g. dirams). `price` and `quantity` produce the line `sum` automatically (`price * quantity`), and `receiptSum` is the total of all lines.

Authentication
--------------

[](#authentication)

The token issued by your ОФД operator is sent in the `Authorization` header. By default the raw token is sent; if your operator expects a scheme, set a prefix:

```
use TexHub\VirtualPosAndoz\Config;
use TexHub\VirtualPosAndoz\VirtualPos;

$pos = new VirtualPos(new Config(token: 'TOKEN', authPrefix: 'Bearer'));
```

Receipts
--------

[](#receipts)

```
use TexHub\VirtualPosAndoz\Enums\{TaxType, VatCode, Commodity};
use TexHub\VirtualPosAndoz\Requests\{Product, ReceiptRequest};

$receipt = ReceiptRequest::income(TaxType::General)
    ->addProduct(
        Product::make('Гречка', price: 2500, quantity: 2, commodity: Commodity::Goods, vatCode: VatCode::Standard)
            ->codeFromRaw('4880230146327')   // marking/barcode → Base64
    )
    ->addProduct(Product::make('Доставка', price: 1000, vatCode: VatCode::Reduced1))
    ->cash(6000)
    // ->nonCash(6000, bankRRN: '123456789012', bankCard: '123456****1234')
    ->consumer('992900123456')
    ->externalId('ORD-100032');

$pos->receipts()->create($receipt);
```

**VAT** — by default the SDK extracts VAT-included tax per rate. To send exact amounts yourself, call `->vat(VatCode::Standard, 1228)` (disables auto VAT), or `->withoutAutoVat()`.

### Corrections

[](#corrections)

```
use TexHub\VirtualPosAndoz\Requests\CorrectionReceiptRequest;

$pos->receipts()->createCorrection(
    CorrectionReceiptRequest::income(TaxType::General)
        ->self(timestamp: 1731332618, orderNumber: '123Ж-Э1')  // or ->forced(...)
        ->addProduct(Product::make('Шкаф', 10000, 1))
        ->cash(10000)
);
```

Documents, reports, cash &amp; counters
---------------------------------------

[](#documents-reports-cash--counters)

```
$pos->documents()->last();
$pos->documents()->byNumber(9);
$pos->documents()->byExternalId('5665566556');

$pos->reports()->xReport();
$pos->reports()->fnReport();
$pos->reports()->shiftCashReport();
$pos->reports()->queueReport();

$pos->cash()->add(10000);
$pos->cash()->remove(5000);

$pos->counters()->create(101, 'Отмененные операции');
$pos->counters()->list();
$pos->counters()->increase(101, 3);
$pos->counters()->decrease(101, 1);
$pos->counters()->reset(101);
$pos->counters()->delete(101);
```

Reading responses
-----------------

[](#reading-responses)

Every call returns a `Response`. `get()` reads (dot-path) inside the `data`block; `all()` returns the full body, `success()` checks `rc === SUCCESS`.

```
$status = $pos->register()->status();
$status->get('shiftStatus');         // bool
$status->get('exchangeBalance');     // change balance
$status->get('registrationInformation.orgName');
```

Error handling
--------------

[](#error-handling)

A result code other than `SUCCESS` throws an `ApiException`:

```
use TexHub\VirtualPosAndoz\Exceptions\ApiException;
use TexHub\VirtualPosAndoz\Enums\ResultCode;

try {
    $pos->receipts()->create($receipt);
} catch (ApiException $e) {
    $e->rc;                       // 'SHIFT_MUST_BE_OPENED'
    $e->code();                   // ResultCode::ShiftMustBeOpened | null
    $e->getMessage();             // 'Смена должна быть открыта.'
    if ($e->is(ResultCode::ShiftMustBeOpened)) {
        $pos->register()->openShift('Кассир');
    }
}
```

Laravel
-------

[](#laravel)

Auto-discovered. Publish the config:

```
php artisan vendor:publish --tag=virtual-pos-andoz-config
```

`.env`:

```
VIRTUAL_POS_TOKEN=your-ofd-token
# VIRTUAL_POS_AUTH_PREFIX=Bearer
# VIRTUAL_POS_BASE_URL=https://vkassa-api.ofd.tj
# VIRTUAL_POS_TIMEOUT=30
```

Use the facade or inject the client:

```
use TexHub\VirtualPosAndoz\Laravel\VirtualPos;
use TexHub\VirtualPosAndoz\Requests\{Product, ReceiptRequest};

VirtualPos::register()->status();

VirtualPos::receipts()->create(
    ReceiptRequest::income()->addProduct(Product::make('Шкаф', 10000, 1))->cash(10000)
);
```

```
public function __construct(private \TexHub\VirtualPosAndoz\VirtualPos $pos) {}
```

Testing
-------

[](#testing)

The SDK ships with an injectable `Transport`, so you can test without the network:

```
use TexHub\VirtualPosAndoz\Tests\Support\FakeTransport;
use TexHub\VirtualPosAndoz\{Config, VirtualPos};

$t = (new FakeTransport())->push(['fdNumber' => 3, 'fpd' => '0305354977']);
$pos = new VirtualPos(new Config(token: 'TKN'), $t);
```

```
composer test
```

License
-------

[](#license)

MIT © TexHub Pro — developed by Mahmudi Shodmehr.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance92

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

Total

2

Last Release

37d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/217647751?v=4)[TexHub Pro](/maintainers/TexhubPro)[@TexhubPro](https://github.com/TexhubPro)

---

Top Contributors

[![TexhubPro](https://avatars.githubusercontent.com/u/217647751?v=4)](https://github.com/TexhubPro "TexhubPro (3 commits)")

---

Tags

andozcash-registerfiscallaravelofdphpreceipttajikistantexhubvirtual-posphplaravelreceipttaxfiscalvirtual-posОФДTajikistancash-registertexhubandozvkassa

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/texhub-virtual-pos-andoz/health.svg)

```
[![Health](https://phpackages.com/badges/texhub-virtual-pos-andoz/health.svg)](https://phpackages.com/packages/texhub-virtual-pos-andoz)
```

PHPackages © 2026

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