PHPackages                             rossaddison/storecove-client - 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. rossaddison/storecove-client

ActiveLibrary

rossaddison/storecove-client
============================

Hand-written PHP client for the Storecove API (v2), for use by rossaddison/invoice

00PHP

Since Aug 28Pushed todayCompare

[ Source](https://github.com/rossaddison/storecove-client)[ Packagist](https://packagist.org/packages/rossaddison/storecove-client)[ RSS](/packages/rossaddison-storecove-client/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

rossaddison/storecove-client
============================

[](#rossaddisonstorecove-client)

A small, hand-written PHP client for the [Storecove API](https://www.storecove.com/docs) (v2), built for [rossaddison/invoice](https://github.com/rossaddison/invoice).

Why not a generated client?
---------------------------

[](#why-not-a-generated-client)

This started as a full client generated from Storecove's OpenAPI spec (via `openapi-generator-cli`, the classic `php` template, and separately via [Jane](https://github.com/janephp/janephp)). Both produced a working client — and both were unusable at Psalm `errorLevel="1"`: 16,505 and 8,975 errors respectively, almost entirely `Mixed*` errors from a generic, reflection-based (de)serialization engine that has to handle all ~150 of Storecove's model types generically (`new $class()` where `$class` is a runtime string, `$data->{$discriminator}` where `$discriminator` is computed at runtime, and so on — inherent to how that style of generator works, not a bug in either tool).

`rossaddison/invoice` only ever needs six of those ~150 shapes, to call one endpoint (`POST /document_submissions`). So this package hand-writes just those six as plain, `readonly`, constructor-promoted PHP 8.4 classes with no dynamic class resolution or property access anywhere — Psalm level-1 clean by construction, not by suppression or baseline.

What's here
-----------

[](#whats-here)

- `Model\RoutingIdentifier`, `Model\Routing`, `Model\RawDocumentData`, `Model\SendableDocument`, `Model\DocumentSubmission`, `Model\DocumentSubmissionResult` — the request/response shapes for `POST /document_submissions`.
- `StorecoveClient` — a thin Guzzle wrapper around that one endpoint.
- `Exception\StorecoveApiException` — thrown on a non-2xx response, carrying the raw response body.

Deliberately **not** here: Storecove's other ~34 endpoints (legal entities, discovery, webhooks, purchase invoices, ...). Add a model + client method the same way, only when `rossaddison/invoice` actually needs one.

Usage
-----

[](#usage)

```
use RossAddison\StorecoveClient\StorecoveClient;
use RossAddison\StorecoveClient\Model\{DocumentSubmission, Routing, RoutingIdentifier, SendableDocument, RawDocumentData};

$client = new StorecoveClient(apiKey: $apiKey);

$submission = new DocumentSubmission(
    document: new SendableDocument(
        documentType: 'invoice',
        rawDocumentData: new RawDocumentData(document: base64_encode($ublXml)),
    ),
    legalEntityId: $legalEntityId,
    idempotencyGuid: Uuid::uuid4()->toString(), // a fresh one per invoice — never a fixed literal
    routing: new Routing(eIdentifiers: [
        new RoutingIdentifier(scheme: $scheme, id: $participantId),
    ]),
);

$result = $client->createDocumentSubmission($submission);
// $result->guid — store this against the invoice for later status lookup
```

###  Health Score

20

—

LowBetter than 12% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/79f16141a5b619c098d6bec3812cd770dfc9b48eacc093f4ef88fbf20e735ec1?d=identicon)[yii2house2house](/maintainers/yii2house2house)

---

Top Contributors

[![rossaddison](https://avatars.githubusercontent.com/u/8538339?v=4)](https://github.com/rossaddison "rossaddison (5 commits)")

### Embed Badge

![Health badge](/badges/rossaddison-storecove-client/health.svg)

```
[![Health](https://phpackages.com/badges/rossaddison-storecove-client/health.svg)](https://phpackages.com/packages/rossaddison-storecove-client)
```

PHPackages © 2026

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