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

ActiveLibrary[API Development](/categories/api)

affiliateforge/php-admitad-api
==============================

Provides Admitad API

v1.0.12(1y ago)51261[2 PRs](https://github.com/affiliateforge/php-admitad-api/pulls)MITPHPPHP ^8.1

Since Apr 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/affiliateforge/php-admitad-api)[ Packagist](https://packagist.org/packages/affiliateforge/php-admitad-api)[ RSS](/packages/affiliateforge-php-admitad-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (18)Used By (0)

php-admitad-api
===============

[](#php-admitad-api)

The package provides [Admitad API Client](https://developers.admitad.com/hc/en-us/articles/7981317512337-Introduction).

Requirements
============

[](#requirements)

- `php ^8.1`
- any implementation for PSR-18 `Client Interface`. For example, `symfony/http-client`

Installation
============

[](#installation)

`composer require affiliateforge/php-admitad-api`

Usage
=====

[](#usage)

### Example

[](#example)

For example, to get a list of coupons for a website, you first need to get an authorization token, and then use your token to get a list of coupons. The code for these requests will look like this

```
$api = new \Affiliateforge\PhpAdmitadApi\APIClient();

$clientID = '777xyz';
$authHash = 'XE5NVl0bU5NcQ==';
$scopes = ['coupons'];

$getTokenCmd = new \Affiliateforge\PhpAdmitadApi\Api\Endpoints\ClientAuthorization\GetToken($clientID, $scopes);
$getTokenResponse = $api->doRequest($getTokenCmd, [
    'Authorization' => 'Basic ' . $authHash,
]);

$headers = [
    'Authorization' => 'Bearer ' . $getTokenResponse->getAccessToken(),
];
$couponsCmd = new \Affiliateforge\PhpAdmitadApi\Api\Endpoints\Coupons\GetList(limit: 1);
$couponsResponse = $api->doRequest($couponsCmd, $headers);

var_dump($couponsResponse->getResults());

```

### Description

[](#description)

The package provides DTO objects for each (not yet) endpoint in the API. These DTO objects are distributed by namespace in accordance with their description in the documentation.

Each such DTO accepts in the constructor all the parameters that the endpoint can accept (from the documentation). They will be substituted when the request is executed in the right place (query parameters or the request body). In response, you will receive a DTO that has getters for each response field from the documentation.

To execute a request, you must create an DTO object and pass it to the `Affiliateforge\PhpAdmitadApi\APIClient` class in the `doRequest(CommandDTO $command, array $headers = []): ResponseDTO`.

Many API endpoints require a token to be specified in the authorization headers. Headers are passed in the `$headers` parameter of the `doRequest` method.

To receive a token, you should use the DTO `Affiliateforge\PhpAdmitadApi\Api\Endpoints\ClientAuthorization\GetToken`. In the constructor you should specify the `clientID` and the requested scopes. In response, you will receive a DTO for this endpoint, from which you can receive the token itself.

Then, you must pass this token in the `Authorization` header for every request for other endpoints.

### APIClient Configuration

[](#apiclient-configuration)

You can pass any implementation of the PSR-18 `Client Interface` when creating a `APIClient` object. If no implementation is passed, the package will try to find one in your dependencies using the package `php-http/discovery`.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69% 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 ~9 days

Total

13

Last Release

652d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/00dece8aec04066c11a09bd87cc54f329f08f1569693465f2052eda552ed8929?d=identicon)[forgeworker](/maintainers/forgeworker)

---

Top Contributors

[![postfriday](https://avatars.githubusercontent.com/u/888136?v=4)](https://github.com/postfriday "postfriday (20 commits)")[![kvatra](https://avatars.githubusercontent.com/u/23643570?v=4)](https://github.com/kvatra "kvatra (9 commits)")

---

Tags

admitadadmitad api

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[deeplcom/deepl-php

Official DeepL API Client Library

2616.2M66](/packages/deeplcom-deepl-php)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)

PHPackages © 2026

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