PHPackages                             almalio/api-php - 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. almalio/api-php

ActiveLibrary[API Development](/categories/api)

almalio/api-php
===============

Almalio.com API Wrapper

v1.0.0-beta(2y ago)15.8kGPL-3.0-onlyPHPPHP &gt;=7.4

Since Apr 12Pushed 1y agoCompare

[ Source](https://github.com/Almalio/php-wrapper)[ Packagist](https://packagist.org/packages/almalio/api-php)[ RSS](/packages/almalio-api-php/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

PHP wrapper for Almalio API
===========================

[](#php-wrapper-for-almalio-api)

Instalation
===========

[](#instalation)

```
composer require almalio/api-php
```

Usage
=====

[](#usage)

```
$api = new Almalio('API_KEY');
$result = $api->addContact('SITE_KEY', [
    'order_number' => '12345',
    'order_total' => 123.45,
    'order_currency' => 'EUR',
    'order_delivery_type' => 1,
    'firstname' => 'John',
    'lastname' => 'Doe',
    'email' => 'mail@example.org',
    'phone' => '+421905000000',
    'street' => 'Main Street 123',
    'city' => 'New York',
    'postcode' => '12345',
    'country_code' => 'SK',
]);

// Check if the request was successful, otherwise check the error message, validate data (see rules lower) and try again
```

Available methods
=================

[](#available-methods)

\_\_construct(string $apiKey, string $apiUrl = '')
------------------------------------------------------------------------------

[](#__constructstring-apikey-string-apiurl--httpsalmaliocomapiv1)

Create new instance of Almalio API wrapper.

### Parameters

[](#parameters)

- `string $apiKey` - API key
- `string $apiUrl` - API URL

addContact(string $siteKey, array $data)
----------------------------------------

[](#addcontactstring-sitekey-array-data)

Add contact to the Almalio system.

### Parameters

[](#parameters-1)

- `string $siteKey` - Site key
- `array $data` - Contact data
    - `order_number` - Order number (`required|string|between:1,255`)
    - `order_total` - Order total (`required|numeric|min:0`)
    - `order_currency` - Order currency code (`required|string|size:3`) - ISO 4217, e.g. EUR
    - `order_delivery_type` - Order delivery type (`required|integer|in:1,2`) - ENUM, see below
    - `firstname` - First name (`required|string|between:1,255|regex:/^[\p{L} ]+$/u`)
    - `lastname` - Last name (`required|string|between:1,255|regex:/^[\p{L} ]+$/u`)
    - `email` - Email (`required|email|between:1,255`)
    - `phone` - Phone (`required|string|between:1,255`)
    - `street` - Street (`required|string|between:1,255|regex:/^(?=.*\d)(?=.*[a-zA-Z].*[a-zA-Z]).+$/`)
    - `city` - City (`required|string|between:1,255|regex:/^[\p{L} ]+$/u`)
    - `postcode` - Postcode (`required|string|between:1,255`)
    - `country_code` - Country code (`required|string|size:2`) - ISO 3166-1 alpha-2, e.g. SK
    - `testing` - Testing mode (`optional|boolean`) - **do not send on production**, it is only used to validate the request

#### Order delivery type ENUM

[](#order-delivery-type-enum)

- `1` - Delivery to the address
- `2` - Personal pickup

### Responses

[](#responses)

#### Validation error

[](#validation-error)

**Status code:** 400

```
{
  "message": "Validation failed",
  "error": [
    "The street field format is invalid.",
    "The postcode field is required."
  ]
}
```

#### Imported

[](#imported)

**Status code:** 200

```
{
  "message": "Contact added to queue successfully",
  "success": true
}
```

#### Duplicate

[](#duplicate)

**Status code:** 200

```
{
  "message": "Contact already imported",
  "success": false
}
```

#### Test successful

[](#test-successful)

**Status code:** 200

```
{
  "message": "Test successful",
  "success": true,
  "data": {
    "order_number": "12345",
    "order_total": 123.45,
    "order_currency": "EUR",
    "order_delivery_type": 1,
    "firstname": "John",
    "lastname": "Doe",
    "email": "mail@example.org",
    "phone": "+421905000000",
    "street": "Main Street 123",
    "city": "New York",
    "postcode": "12345",
    "country_code": "SK"
  }
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

766d ago

### Community

Maintainers

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

---

Top Contributors

[![Webess](https://avatars.githubusercontent.com/u/11719946?v=4)](https://github.com/Webess "Webess (10 commits)")

---

Tags

apiwrapperalmalio

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/almalio-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/almalio-api-php/health.svg)](https://phpackages.com/packages/almalio-api-php)
```

###  Alternatives

[gabrielbull/ups-api

PHP UPS API

4642.4M10](/packages/gabrielbull-ups-api)[wtfzdotnet/php-tmdb-api

PHP wrapper for TMDB (TheMovieDatabase) API v3. Supports two types of approaches, one modelled with repositories, models and factories. And the other by simple array access to RAW data from The Movie Database.

4252.9k](/packages/wtfzdotnet-php-tmdb-api)[walle89/swedbank-json

Unofficial API client for the Swedbank's and Sparbanken's mobile apps in Sweden.

752.5k](/packages/walle89-swedbank-json)

PHPackages © 2026

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