PHPackages                             megachriz/afasprofit - 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. megachriz/afasprofit

ActiveLibrary[API Development](/categories/api)

megachriz/afasprofit
====================

An API to connect to Afas Profit written in PHP.

3.3.1(2mo ago)1710.3k↓29.2%10[2 issues](https://github.com/MegaChriz/afasprofit/issues)GPL-3.0PHPPHP &gt;=8.1

Since Nov 21Pushed 5mo ago5 watchersCompare

[ Source](https://github.com/MegaChriz/afasprofit)[ Packagist](https://packagist.org/packages/megachriz/afasprofit)[ RSS](/packages/megachriz-afasprofit/feed)WikiDiscussions 3.x Synced 1mo ago

READMEChangelog (3)Dependencies (16)Versions (9)Used By (0)

Afas Profit API
===============

[](#afas-profit-api)

[![Build Status](https://camo.githubusercontent.com/8c29419ecc94d3b19bcb8ce445608362ab54c3a6ea33f64581605c999c0b7e8b/68747470733a2f2f7472617669732d63692e636f6d2f4d656761436872697a2f6166617370726f6669742e7376673f6272616e63683d332e78)](https://travis-ci.com/github/MegaChriz/afasprofit)

An API to connect to Afas Profit written in PHP.

Features:

- Getting data from Profit GetConnectors.
- Insert, update or delete data into Profit using Profit UpdateConnectors.
- Getting files from Profit using Profit Subjectconnectors.
- Getting UpdateConnectors XML Schema's using the Profit DataConnector.

Usage
-----

[](#usage)

Get data from Profit (GetConnector):

```
use Afas\Core\Server;

// Initialize server.
$server = new Server('https://12345.soap.afas.online/profitservices', 'ABCDEFGHIJK1234');

// Get data from GetConnector 'Products', filter by 'sku'.
$products = $server->get('Products')
  ->filter('sku', '2612')
  ->execute()
  ->asArray();
```

Insert data into Profit (UpdateConnector):

```
use Afas\Core\Server;

// Initialize server.
$server = new Server('https://12345.soap.afas.online/profitservices', 'ABCDEFGHIJK1234');

// Insert an order into Profit.
$server->insert('FbSales', [
  'OrNu' => 'test_001',
  'DbId' => 123456,
  'War' => 1,
  'FbSalesLines' => [
    [
      'ItCd' => 1201,
      'QuUn' => 1,
    ],
    [
      'ItCd' => 1202,
      'QuUn' => 1,
    ],
  ],
])
  ->execute();
```

Update data into Profit (UpdateConnector):

```
use Afas\Core\Server;

// Initialize server.
$server = new Server('https://12345.soap.afas.online/profitservices', 'ABCDEFGHIJK1234');

// Update an existing order, change quantity of existing item.
$server->update('FbSales', [
  'OrNu' => 'test_001',
  'FbSalesLines' => [
    [
      'GuLi' => '{6BA270E1-BFA7-4B67-86FF-72391A2CB5E3}',
      'QuUn' => 2,
    ],
  ],
])
  ->execute();
```

Delete data from Profit (UpdateConnector):

```
use Afas\Core\Server;

// Initialize server.
$server = new Server('https://12345.soap.afas.online/profitservices', 'ABCDEFGHIJK1234');

$server->delete('FbSales', [
  'OrNu' => 'test_001',
])
  ->execute();
```

Get a file from Profit (SubjectConnector):

```
use Afas\Afas;
use Afas\Core\Connector\SubjectConnector;
use Afas\Core\Server;

// Initialize server.
$server = new Server('https://12345.soap.afas.online/profitservices', 'ABCDEFGHIJK1234');

// Create Soap client.
/** @var \Afas\Component\Soap\SoapClientInterface $client */
$client = Afas::service('afas.soap_client_factory')->create($server);

// Create SubjectConnector.
$connector = new SubjectConnector($client, $server);

// To get an attachment, pass a subject ID and a file ID.
$attachment = $connector->getAttachment(300001, '8D36870843A516C2514D74BE69F87E15');
```

Get a XML Schema for a Profit UpdateConnector from Profit (DataConnector):

```
use Afas\Afas;
use Afas\Core\Connector\DataConnector;
use Afas\Core\Server;

// Initialize server.
$server = new Server('https://12345.soap.afas.online/profitservices', 'ABCDEFGHIJK1234');

// Create Soap client.
/** @var \Afas\Component\Soap\SoapClientInterface $client */
$client = Afas::service('afas.soap_client_factory')->create($server);

// Create DataConnector.
$connector = new DataConnector($client, $server);

// Get schema.
/** @var \Afas\Core\Result\DataConnectorResult $result */
$result = $connector->getXmlSchema('FbSales');

// Save complete schema.
file_put_contents('FbSales.xsd', $result->asArray()[0]['Schema']);

// Or save without custom fields.
file_put_contents('FbSales.xsd', $result->removeCustomFieldsFromSchema()[0]['Schema']);
```

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance75

Regular maintenance activity

Popularity35

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 95.5% 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 ~484 days

Recently: every ~389 days

Total

8

Last Release

76d ago

Major Versions

2.1 → 3.0.02019-01-02

PHP version history (5 changes)2.0.7PHP &gt;=5.3.0

3.0.0PHP &gt;=5.5.9

3.1.0PHP &gt;=7.0

3.2.0PHP &gt;=7.3

3.3.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf6964b913d1caabe6ae2f707487d578c7d6de551a96bfbb8e6ba3e37996b0dd?d=identicon)[MegaChriz](/maintainers/MegaChriz)

---

Top Contributors

[![MegaChriz](https://avatars.githubusercontent.com/u/6292443?v=4)](https://github.com/MegaChriz "MegaChriz (128 commits)")[![Dylan-DutchAndBold](https://avatars.githubusercontent.com/u/36036362?v=4)](https://github.com/Dylan-DutchAndBold "Dylan-DutchAndBold (2 commits)")[![89peter](https://avatars.githubusercontent.com/u/17990931?v=4)](https://github.com/89peter "89peter (1 commits)")[![boboldehampsink](https://avatars.githubusercontent.com/u/378974?v=4)](https://github.com/boboldehampsink "boboldehampsink (1 commits)")[![gijsstegehuis](https://avatars.githubusercontent.com/u/5496039?v=4)](https://github.com/gijsstegehuis "gijsstegehuis (1 commits)")[![tomsix](https://avatars.githubusercontent.com/u/60874146?v=4)](https://github.com/tomsix "tomsix (1 commits)")

---

Tags

afasprofit

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/megachriz-afasprofit/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[worksome/graphlint

A static analysis tool for GraphQL

13189.4k](/packages/worksome-graphlint)[rekalogika/mapper

An object mapper for PHP and Symfony. Maps an object to another object. Primarily used for transforming an entity to a DTO and vice versa.

3847.7k1](/packages/rekalogika-mapper)[adrenalinkin/swagger-resolver-bundle

Provides possibility for validate data according to Swagger documentation

1013.3k](/packages/adrenalinkin-swagger-resolver-bundle)

PHPackages © 2026

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