firefly-iii/api-support-classes
Support classes for the Firefly III API, providing reusable PHP components for building and integrating with Firefly III clients. Helps structure API requests, responses, and related data in Laravel or standalone PHP applications.
firefly-iii/api-support-classes is a small, low-level library that holds classes shared between the Firefly III core application and its API layer. It is not a standalone product — it exists so the API payload shapes (resources, transformers, value objects, shared constants) can be versioned and consumed without pulling in the entire Firefly III monolith. For most applications it arrives as a transitive dependency; you only add it explicitly when you need to speak Firefly III's API dialect from your own code.
Minimal steps:
composer require firefly-iii/api-support-classes
composer.json first. That is your real documentation here. Check the PSR-4 root (the namespace is under FireflyIII\...) and, more importantly, the php and illuminate/* constraints. The package tracks Firefly III releases, so its constraints tell you which Firefly version it is designed to match.src/. With a package this size the class list is the API. Look for resource/transformer classes and any constant or enum-like classes describing account types, transaction types, or webhook events.firefly-iii/firefly-iii itself. Search for the fully-qualified class names there rather than trusting the package README (which is typically terse).First use case: you are writing a service or plugin that must produce or consume Firefly III API payloads and you want the serialized output to match exactly what the Firefly instance emits — same field names, same type coercion, same JSON:API envelope. Instantiate (or call) the relevant support class, serialize, and return.
Adopt it as an internal contract, not a public dependency. Wrap the package behind a thin adapter of your own:
namespace App\Support;
use FireflyIII\...\SomeResource; // whatever the package actually exposes
final class FireflyApi
{
public function accountPayload(array $attributes): array
{
return (new SomeResource($attributes))->toArray();
}
}
Everything else in your app depends on FireflyApi, never on the package directly. When the package's classes shift, you patch one file.
Pin to the same minor version as the Firefly instance you talk to. If you are integrating against Firefly III 6.x, constrain the package to the matching line. Treat the pair as a single deployment unit and upgrade them together.
Use it to build test fixtures. The single highest-value day-to-day use is generating realistic API responses for your test suite:
$response = $this->fireflyApi->accountPayload($this->accountAttributes());
$this->assertJsonPath('data.attributes.name', 'Checking');
This catches the "my payload looks right but Firefly rejects it" class of bug before it reaches a live instance.
Mirror it in validation. If the package defines allowed values (account types, transaction types), build your FormRequest::rules() from those same definitions rather than hard-coding a Rule::in([...]) list that will silently drift.
Inside a Firefly III installation (custom module, local plugin, theme work), the package is already present — reference its classes directly instead of copying constants into your module. Duplicated constants are the most common source of "the API accepts it but the UI does not" inconsistencies.
Keep a contract test against a real instance. A small integration test that posts your generated payload to a disposable Firefly III container and asserts a 200/201 is worth more than any unit test here, because it validates the package version, your adapter, and the server together.
0.x line, and minor bumps have historically been the place where shapes change. Your adapter wrapper plus a lockfile is the mitigation.FireflyIII\.... If the full monolith is also installed in the same project, you have two sources for the same namespace. Composer will autoload only one, and which one wins depends on autoload ordering. Do not install both deliberately.config/api-support-classes.php or a FireflyApi facade, stop — instantiate the classes directly or write your own binding in a service provider.json_encode(..., JSON_PRETTY_PRINT) and diff it field-by-field against a real GET /api/v1/... response from a running instance. Also fetch the Firefly III OpenAPI spec from the instance and compare your output against the schema — that is the authoritative description of what the server expects.How can I help you explore Laravel packages today?