PHPackages                             matejch/webareal-api-handler - 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. matejch/webareal-api-handler

ActiveLibrary[API Development](/categories/api)

matejch/webareal-api-handler
============================

Api for getting and sending data to webareal type eshops

1.1.0(4y ago)112MITPHPPHP &gt;=7.2.0

Since Aug 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Matej-ch/webareal-api-handler)[ Packagist](https://packagist.org/packages/matejch/webareal-api-handler)[ RSS](/packages/matejch-webareal-api-handler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Webareal api handler
====================

[](#webareal-api-handler)

Api for getting and sending data to webareal type eshops

Full documentation [here](https://webareal.docs.apiary.io/#)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist matejch/webareal-api-handler "^1.0"

```

or add

```
"matejch/webareal-api-handler": "^1.0"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

You need *username*, *password* and *token (API key)* from your webareal eshop API key is located in tab **API**

Token bearer for requests is retrieved in login request

`All classes extend from \matejch\webarealApiHandler\WebarealHandler`

```
/** create handler, constructor requires username, password, adn token */
/** all can be acquired from your webareal admin interface */
$handler = new \matejch\webarealApiHandler\WebarealHandler($username,$password,$apiToken);

/** New handler instance can be also created with json file, that contains username, password, apiKey and url(optional) */

$handler = \matejch\webarealApiHandler\WebarealHandler::createFromFile('path_to_the_json_file');

/** login before other requests */
$handler->login();

/** this is function for testing successful login, returns message whether access was granted */
$handler->test();

/**
 * You can check info about how many request you have remaining,
 * what's your limit and whether you are blocked
 */
$handler->apiInfo()

/** API subdomain */
/** If you don't use subdomain set in class use this method*/
$handler->setBaseUrl($apiSubDomainUrl);
```

### Customers

[](#customers)

Info about customers endpoint [here](https://webareal.docs.apiary.io/#reference/0/working-with-registered-customers/get-all-registered-customers)

```
/** Only one api endpoint exists, and that is for getting list of customers */
$customers = new \matejch\webarealApiHandler\WCustomers($username,$password,$apiToken);
$customers->login();

$customers->asArray = true; // optional

/** also query string for searching specific customers can be set*/
$customers->searchBy(['limit' => 20,
                      'offset' => 0,
                      'sortBy' => 'id',
                      'sortDirection' => 'desc',
                      'findBy' => 'id',
                      'searchedString' => 'search string here']);

/** data can be returned as json string or array of customers */
$customers->get();
```

### Products

[](#products)

Info about product endpoints [here](https://webareal.docs.apiary.io/#reference/0/create-product/get-product-list)

#### NEW METHOD for mass product update

[](#new-method-for-mass-product-update)

```
/**For mass update use */

function setFieldsAsString(array_of_products)
```

```
$products = new \matejch\webarealApiHandler\WProduct($username,$password,$apiToken);
$products->login();

$products->asArray = true; // optional

/** get list of products */
/** filter can be set with $products->searchBy(array of searchable options) */
$products->get();

/**
 * id of product necessary for update, delete, view can be obtained with get() method,
 * or through csv from your admin interface
 */

/** create new product */
$products->setFields(['name' => 'Name', ....]);
$products->create();

/** update existing product, you must know id beforehand */
$products->setFields(['secondName' => 'Second', ....]);
$products->update($id);

/** delete existing product, you must know id beforehand */
$products->delete($id);

/** detail info about one product, you must know id beforehand */
$products->view($id);

/** update and create multiple products at once */

$products->setFields(['name' => 'product', ....]);

$products->createMultiple();

/** to update multiple product id is required for every product */
$products->updateMultiple();
```

### Orders

[](#orders)

Info about order endpoints [here](https://webareal.docs.apiary.io/#reference/0/order-list)

```
$orders = new \matejch\webarealApiHandler\WOrder($username,$password,$apiToken);
$orders->login();

$orders->get();

$orders->states();

$orders->view($id);

$products->setFields(['firstname' => 'Jane', 'lastname' => 'Doe',...]);
$orders->update($id);

$orders->delete($id)
```

### Product properties

[](#product-properties)

Info product properties endpoints [here](https://webareal.docs.apiary.io/#reference/0/multiple-manipulation-with-products/update-property)

```
$property = new \matejch\webarealApiHandler\WProductProperty($username,$password,$apiToken);
$property->login();

$property->get();

$property->view($id);

$property->setFields(['name' => 'Color']);
$property->create($id);

/** before calling update, setFields must set fields you want to update on property */
$property->setFields(['name' => 'Color']);
$property->update($id);

/** delete property */
$property->delete($id);

/** create and update multiple */
$property->setFields(['name' => 'Color']);
$property->createMultiple();

/** id for every property must be set when updating */
$property->updateMultiple();
```

### Product variants

[](#product-variants)

Info product variants endpoints [here](https://webareal.docs.apiary.io/#reference/0/get-product-variants/create-product-variant)

```
/** Product variants are products connected to other product */
$variants = new \matejch\webarealApiHandler\WProductVariants($username,$password,$apiToken);
$variants->login();

/** get list of variants, can be search by using searchBy method */
$variants->get();

$variants->view($id);

/** before calling create, setFields must set fields you want to update on property */
$variants->setFields(['idProduct' => 9,'name' => 'Jacket']);
$variants->create($id);

/** before calling update, setFields must set fields you want to update on property */
$variants->setFields(['idProduct' => 9,'name' => 'Jacket']);
$variants->update($id);

/** delete property */
$variants->delete($id);

/** create and update multiple */
$variants->setFields(['name' => 'Color']);
$variants->createMultiple();

/** id for every variant must be set when updating */
$variants->updateMultiple();
```

DONE
----

[](#done)

- Login request
- Test request
- Api info
- Get customers
- Get products
- Create product
- Get product info
- Remove product
- Update product
- Create multiple products
- Update multiple products
- Create properties
- Update properties
- Get property
- Update property
- Remove property
- Get property list
- Create product variant
- Get product variants list
- Get product variant
- Create product variants
- Update product variants
- Get product variant list
- Update product variant list
- Remove product variant
- Get property values list
- Create property values
- Create property value
- Get property value info
- Remove specific property value
- Update specific property value
- Get order list
- Update orders
- Get order info
- Update order
- Remove order
- Get all order states
- Update order products
- Update order product
- Remove order product

TODO
----

[](#todo)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Total

4

Last Release

1664d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/932003?v=4)[Matej Leban](/maintainers/MatejCh)[@matejch](https://github.com/matejch)

---

Top Contributors

[![Matej-ch](https://avatars.githubusercontent.com/u/12380989?v=4)](https://github.com/Matej-ch "Matej-ch (35 commits)")

---

Tags

apiphpwebarealrequestapieshopwebareal

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/matejch-webareal-api-handler/health.svg)

```
[![Health](https://phpackages.com/badges/matejch-webareal-api-handler/health.svg)](https://phpackages.com/packages/matejch-webareal-api-handler)
```

###  Alternatives

[mtownsend/request-xml

The missing XML support for Laravel's Request class.

43432.5k](/packages/mtownsend-request-xml)[agungsugiarto/codeigniter4-cors

Send CORS Headers in a CodeIgniter 4 application.

6524.6k2](/packages/agungsugiarto-codeigniter4-cors)[ideasoft/batch-request-client

Batch request client implementation for php.

2317.1k](/packages/ideasoft-batch-request-client)

PHPackages © 2026

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