PHPackages                             openapi/openapi-sdk - 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. openapi/openapi-sdk

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

openapi/openapi-sdk
===================

Minimal and agnostic PHP SDK for Openapi® (https://openapi.com)

1.3.0(1mo ago)171.4k4[25 issues](https://github.com/openapi/openapi-php-sdk/issues)[1 PRs](https://github.com/openapi/openapi-php-sdk/pulls)1MITPHPPHP &gt;=8.0.0CI passing

Since Sep 29Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/openapi/openapi-php-sdk)[ Packagist](https://packagist.org/packages/openapi/openapi-sdk)[ RSS](/packages/openapi-openapi-sdk/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (5)Versions (15)Used By (1)

 [ ![Openapi SDK for PHP](.github/assets/repo-header-a3.png) ](https://openapi.com/)Openapi® client for PHP
=======================

[](#openapi-client-for-php)

#### The perfect starting point to integrate [Openapi®](https://openapi.com/) within your PHP project

[](#the-perfect-starting-point-to-integrate-openapi-within-your-php-project)

[![Build Status](https://github.com/openapi/openapi-php-sdk/actions/workflows/php.yml/badge.svg)](https://github.com/openapi/openapi-php-sdk/actions/workflows/php.yml)[![Packagist Version](https://camo.githubusercontent.com/004c21fde25388c8b771476eb79433406be36d3cebfb6012396627dd14858f38/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f70656e6170692f6f70656e6170692d73646b)](https://packagist.org/packages/openapi/openapi-sdk)[![PHP Version](https://camo.githubusercontent.com/bbc401e01fccfb7b31d4f068e97c2d6ca9219db1be691c1f8fd9caafb5e4c3ac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6f70656e6170692f6f70656e6170692d73646b)](https://packagist.org/packages/openapi/openapi-sdk)[![License](https://camo.githubusercontent.com/33fda1d673c1e12010a238ff78995598e09c063529b9e8ad3eef42c80be005d8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f70656e6170692f6f70656e6170692d7068702d73646b3f763d32)](LICENSE)[![Downloads](https://camo.githubusercontent.com/0abae9be4c6ddc94b6fdab016b688617a7223061ca0c73e5a59f57d761d51831/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f70656e6170692f6f70656e6170692d73646b)](https://packagist.org/packages/openapi/openapi-sdk)
[![Linux Foundation Member](https://camo.githubusercontent.com/a9877e65c528205a5aea985180bb46c28cf61c2b2edc99b078351e4564082499/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c696e7578253230466f756e646174696f6e2d53696c7665722532304d656d6265722d3030333737383f6c6f676f3d6c696e75782d666f756e646174696f6e266c6f676f436f6c6f723d7768697465)](https://www.linuxfoundation.org/about/members)

Overview
--------

[](#overview)

A minimal and agnostic PHP SDK for Openapi, inspired by a clean client implementation. This SDK provides only the core HTTP primitives needed to interact with any Openapi service.

Pre-requisites
--------------

[](#pre-requisites)

Before using the Openapi PHP Client, you will need an account at [Openapi](https://console.openapi.com/) and an API key to the sandbox and/or production environment

Features
--------

[](#features)

- **Agnostic Design**: No API-specific classes, works with any Openapi service
- **Minimal Dependencies**: Only requires PHP 8.0+ and cURL
- **OAuth Support**: Built-in OAuth client for token management
- **HTTP Primitives**: GET, POST, PUT, DELETE, PATCH methods
- **Clean Interface**: Similar to the Rust SDK design
- **Static Analysis**: PHPStan level 6 configuration available via Composer

What you can do
---------------

[](#what-you-can-do)

With the Openapi PHP Client, you can easily interact with a variety of services in the Openapi Marketplace. For example, you can:

- 📩 **Send SMS messages** with delivery reports and custom sender IDs
- 💸 **Process bills and payments** in real time via API
- 🧾 **Send electronic invoices** securely to the Italian Revenue Agency
- 📄 **Generate PDFs** from HTML content, including JavaScript rendering
- ✉️ **Manage certified emails** and legal communications via Italian Legalmail

For a complete list of all available services, check out the [Openapi Marketplace](https://console.openapi.com/) 🌐

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

[](#installation)

You can add the Openapi PHP Client to your project with the following command:

```
composer require openapi/openapi-sdk
```

Quick Start
-----------

[](#quick-start)

### Token Generation

[](#token-generation)

```
use Openapi\OauthClient;

$oauthClient = new OauthClient('username', 'apikey', true); // true for test environment

$scopes = [
    'GET:test.imprese.openapi.it/advance',
    'POST:test.postontarget.com/fields/country'
];

$result = $oauthClient->createToken($scopes, 3600);
$tokenData = json_decode($result, true);
$token = $tokenData['token'];
```

### Making API Calls

[](#making-api-calls)

```
use Openapi\Client;

$client = new Client($token);

// GET request
$params = ['denominazione' => 'Stellantis', 'provincia' => 'TO'];
$response = $client->get('https://test.company.openapi.com/IT-advanced', $params);

// POST request
$payload = ['limit' => 10, 'query' => ['country_code' => 'IT']];
$response = $client->post('https://test.postontarget.com/fields/country', $payload);

// Other HTTP methods
$response = $client->put($url, $payload);
$response = $client->delete($url);
$response = $client->patch($url, $payload);
```

Architecture
------------

[](#architecture)

This SDK follows a minimal approach with only essential components:

- `OauthClient`: Handles OAuth authentication and token management
- `Client`: Agnostic HTTP client for API calls
- `Exception`: Error handling
- `Cache\CacheInterface`: Optional caching interface

Requirements
------------

[](#requirements)

- PHP 8.0 or higher
- cURL extension
- JSON extension

Examples
--------

[](#examples)

You can find complete examples in the `examples/` directory:

- `examples/token_generation.php` - OAuth token generation example
- `examples/api_calls.php` - HTTP API calls example
- `examples/complete_workflow.php` - End-to-end workflow example

Run examples with:

```
composer run example:token
composer run example:api
composer run example:complete
```

Testing
-------

[](#testing)

Run tests with:

```
# Run all tests
composer run test

# Run unit tests specifically
composer run test:unit
```

Static Analysis
---------------

[](#static-analysis)

This SDK includes PHPStan as a Composer development dependency to help keep the codebase type-safe and maintainable.

PHPStan is configured in `phpstan.neon` and currently runs at level 6.

Run static analysis with:

```
composer run analyse
```

Contributing
------------

[](#contributing)

Contributions are always welcome! Whether you want to report bugs, suggest new features, improve documentation, or contribute code, your help is appreciated.

See [docs/contributing.md](docs/contributing.md) for detailed instructions on how to get started. Please make sure to follow this project's [docs/code-of-conduct.md](docs/code-of-conduct.md) to help maintain a welcoming and collaborative environment.

Authors
-------

[](#authors)

Meet the project authors:

- L. Paderi ([@lpaderiAltravia](https://www.github.com/lpaderiAltravia))
- Openapi Team ([@openapi-it](https://github.com/openapi-it))

Partners
--------

[](#partners)

Meet our partners using Openapi or contributing to this SDK:

- [Blank](https://www.blank.app/)
- [Credit Safe](https://www.creditsafe.com/)
- [Deliveroo](https://deliveroo.it/)
- [Gruppo MOL](https://molgroupitaly.it/it/)
- [Jakala](https://www.jakala.com/)
- [Octotelematics](https://www.octotelematics.com/)
- [OTOQI](https://otoqi.com/)
- [PWC](https://www.pwc.com/)
- [QOMODO S.R.L.](https://www.qomodo.me/)
- [SOUNDREEF S.P.A.](https://www.soundreef.com/)

Our Commitments
---------------

[](#our-commitments)

We believe in open source and we act on that belief. We became Silver Members of the Linux Foundation because we wanted to formally support the ecosystem we build on every day. Open standards, open collaboration, and open governance are part of how we work and how we think about software.

License
-------

[](#license)

This project is licensed under the [MIT License](LICENSE).

The MIT License is a permissive open-source license that allows you to freely use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, provided that the original copyright notice and this permission notice are included in all copies or substantial portions of the software.

In short, you are free to use this SDK in your personal, academic, or commercial projects, with minimal restrictions. The project is provided "as-is", without any warranty of any kind, either expressed or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement.

For more details, see the full license text at the [MIT License page](https://choosealicense.com/licenses/mit/).

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance71

Regular maintenance activity

Popularity31

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~446 days

Total

10

Last Release

56d ago

Major Versions

v0.9.0 → v1.0.02020-09-29

PHP version history (2 changes)v0.9.0PHP &gt;=7.2.0

1.2.1PHP &gt;=8.0.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/472171?v=4)[Francesco Bianco (yafb)](/maintainers/francescobianco)[@francescobianco](https://github.com/francescobianco)

---

Top Contributors

[![francescobianco](https://avatars.githubusercontent.com/u/472171?v=4)](https://github.com/francescobianco "francescobianco (47 commits)")[![lpaderiAltravia](https://avatars.githubusercontent.com/u/85158884?v=4)](https://github.com/lpaderiAltravia "lpaderiAltravia (24 commits)")[![pberanrdiniAltravia](https://avatars.githubusercontent.com/u/68341384?v=4)](https://github.com/pberanrdiniAltravia "pberanrdiniAltravia (19 commits)")[![pberanrdini](https://avatars.githubusercontent.com/u/99032905?v=4)](https://github.com/pberanrdini "pberanrdini (5 commits)")[![SimoneOpenapi](https://avatars.githubusercontent.com/u/138789490?v=4)](https://github.com/SimoneOpenapi "SimoneOpenapi (3 commits)")[![Seraphim2000](https://avatars.githubusercontent.com/u/12473670?v=4)](https://github.com/Seraphim2000 "Seraphim2000 (2 commits)")[![mijorus](https://avatars.githubusercontent.com/u/39067225?v=4)](https://github.com/mijorus "mijorus (1 commits)")[![SimoneDesantisAltravia](https://avatars.githubusercontent.com/u/67371387?v=4)](https://github.com/SimoneDesantisAltravia "SimoneDesantisAltravia (1 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (1 commits)")

---

Tags

api-clientapi-marketplacecertified-apicrmcurlhttp-clientlaravellibcurlmagento2openapiphpphp-sdkprestashoprest-apisuitecrmsymfonywoocommerceyii2-frameworkhttpphpapiclientsymfonylaravellaminaswordpressgeocodingsdkrestcurlhttp clientpsr-18Guzzleemailslimlumentokenzendcakephpcodeignitersmsoauthoauth2yiiphalconphp8companyoctoberitalianitalyBusiness Registrypecimpresevisurecatasto

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/openapi-openapi-sdk/health.svg)

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

###  Alternatives

[guzzlehttp/guzzle

Guzzle is a PHP HTTP client library

23.5k1.0B35.4k](/packages/guzzlehttp-guzzle)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4640.8k](/packages/ismaeltoe-osms)[e-moe/guzzle6-bundle

Integrates Guzzle 6 into your Symfony application

12262.2k1](/packages/e-moe-guzzle6-bundle)

PHPackages © 2026

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