Search by

cmelda / mpohoda

cmelda

Strictly typed PHP client for the mPohoda REST API

Package info

gitlab.com/cmelda/mpohoda

Issues

pkg:composer/cmelda/mpohoda

Fund package maintenance!

Ko-Fi

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

dev-main 2026-09-27 22:50 UTC

This package is auto-updated.

Last update: 2026-09-27 20:52:03 UTC


README

Latest Stable Version Total Downloads License PHP Version Require

Strictly typed PHP 8.4+ client for the Czech mPohoda REST API. The project is in its initial pre-1.0 development phase and implements all 90 operations in the bundled official OpenAPI contract through 27 typed API groups and 162 generated DTOs/enums.

The bundled, normalized upstream contract is OpenAPI v1.0. Exact snapshot identity is available through composer schema:version; freshness is checked against the official OpenAPI document.

Installation

composer require cmelda/mpohoda

Runtime requirements are PHP 8.4+ and ext-json. Choose Guzzle, Symfony HTTP Client, a custom transport, or the built-in ext-curl fallback.

Quick start

<?php

declare(strict_types=1);

use Cmelda\MPohoda\Authentication\ApiKeyAuthentication;
use Cmelda\MPohoda\MPohodaClient;
use Cmelda\MPohoda\Request\CursorListQuery;

require __DIR__ . '/vendor/autoload.php';

$client = new MPohodaClient(new ApiKeyAuthentication($_ENV['MPOHODA_API_KEY']));

$partners = $client->getBusinessPartners()->list(
    new CursorListQuery(pageNumber: 1, pageSize: 100),
);

foreach ($partners->items ?? [] as $partner) {
    echo ($partner->companyName ?? $partner->name ?? $partner->id->value) . PHP_EOL;
}

See the documentation index, especially configuration, usage, and errors.

The get*() methods return small typed operation groups: for example getBanks() returns BanksApi, on which list() or get() performs the request. Request DTOs use ::create() for required values and immutable with...() methods for optional values, avoiding long positional constructors. Installed Guzzle 8 or Symfony HTTP Client is detected directly; cURL remains the final fallback. Laravel's HTTP client already installs Guzzle and therefore needs no special adapter. See transport configuration.

Development

Run composer build once after installation, then use composer check. Mutation testing and BC checking are available as composer mutation and composer backward-compatibility. See the changelog and development documentation.

License and funding

Released under the MIT License. You can support development on Ko-fi.