PHPackages                             afosto/postnl-ecs - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. afosto/postnl-ecs

ActivePackage[HTTP &amp; Networking](/categories/http)

afosto/postnl-ecs
=================

Afosto PostNL ECS Client

1.0.8(8y ago)01.4kApache-2.0PHP

Since Feb 20Pushed 8y agoCompare

[ Source](https://github.com/afosto/postnl-ecs)[ Packagist](https://packagist.org/packages/afosto/postnl-ecs)[ Docs](https://afosto.com)[ RSS](/packages/afosto-postnl-ecs/feed)WikiDiscussions master Synced 1mo ago

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

PostNL ECS
==========

[](#postnl-ecs)

Use this client to convieniently interact with PostNL ECS . This PHP package was developed by Afosto to make a reliable connection between Afosto (Retail Software) and PostNL ECS and provides the following functionality:

- send product information to ECS
- send order information to ECS
- receive stock information (mutations or full list)
- receive shipment updates (track&amp;trace codes)

Getting Started
---------------

[](#getting-started)

Simply follow the installation instructions. You will need an account at PostNL ECS that is set up for you to use.

### Prerequisites

[](#prerequisites)

What things you need to install the software and how to install them

- PHP5.5+
- Composer (for installation)

### Installing

[](#installing)

Installing is easy through [Composer](http://www.getcomposer.org/).

```
composer require afosto/ecs

```

Examples
--------

[](#examples)

Now, to insert a product at ECS, use the following code.

First set some configuration parameters:

```
$config = [
    'host'       => 'sftp-postnlint-accp.xs4.mendix.net',
    'port'       => 22,
    'username'   => '',
    'privateKey' => '',
    'root'       => '/home/{username}/'
];
```

Initialze the application with the configuration

```
App::init($config);
```

### Send a product

[](#send-a-product)

Build the product object

```
$product = new Product();
$product->sku = 'ART-1-TEST';
$product->shortDescription = 'Test article';
$product->ean = '1000000000016';
$product->height = $product->weight = $product->depth = $product->width = 1;
```

Make a message container and insert a message number (in this case 1) and add the product and send the message:

```
$message = new ProductMessage(1);
```

Insert a single product or add multiple:

```
$message->addMessagePart($product);
$message->addMessagePart([$product2, $product3]);
```

Now send the message:

```
$message->send();
```

For debugging you can also download or show the XML file:

```
$message->show();
$message->download();
```

Now the product should be available in ECS.

### Stock updates

[](#stock-updates)

To parse a batch of stock messages, use the following code.

```
$stockListUpdates = new StockList();
```

Load the messages (XML files from the SFTP server):

```
foreach ($stockListUpdates->getUpdates() as $model) {
    //Do something with the message
    $message = [
        'sku'   => $model->sku,
        'count' => $model->count,
    ];
}
```

Mark the processed messages as read (they will be deleted):

```
$stockListUpdates->markAsRead();
```

### Other examples

[](#other-examples)

In the examples directory you will find more examples of this project.

Versioning
----------

[](#versioning)

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/afosto/dnl/tags).

License
-------

[](#license)

This project is licensed under the Apache License 2.0 - see the [LICENSE.md](LICENSE.md) file for details

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity71

Established project with proven stability

 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

Recently: every ~22 days

Total

15

Last Release

3255d ago

Major Versions

0.1.5 → 1.0.02017-02-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/9396ebbc376698bfad31f77a42ee333fbc38b559f0ae79ad651ea5ebadbdb8de?d=identicon)[afosto](/maintainers/afosto)

---

Top Contributors

[![bakkerpeter](https://avatars.githubusercontent.com/u/23257320?v=4)](https://github.com/bakkerpeter "bakkerpeter (32 commits)")

---

Tags

clientECSpostnl

### Embed Badge

![Health badge](/badges/afosto-postnl-ecs/health.svg)

```
[![Health](https://phpackages.com/badges/afosto-postnl-ecs/health.svg)](https://phpackages.com/packages/afosto-postnl-ecs)
```

###  Alternatives

[php-http/httplug

HTTPlug, the HTTP client abstraction for PHP

2.6k307.6M679](/packages/php-http-httplug)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[php-http/client-common

Common HTTP Client implementations and tools for HTTPlug

1.0k225.5M571](/packages/php-http-client-common)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)[mashape/unirest-php

Unirest PHP

1.3k9.7M161](/packages/mashape-unirest-php)[smi2/phpclickhouse

PHP ClickHouse Client

83510.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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