chrisjohnleah/eworks-manager-api

Framework-agnostic PHP SDK for the eWorks Manager API.

Maintainers

Package info

github.com/chrisjohnleah/eworks-manager-api

pkg:composer/chrisjohnleah/eworks-manager-api

Transparency log

Statistics

Installs: 0

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-08-10 06:55 UTC

This package is auto-updated.

Last update: 2026-08-10 12:29:19 UTC


README

Framework-agnostic PHP SDK for the eWorks Manager API, built on Saloon 4.

composer require chrisjohnleah/eworks-manager-api

The public API contract uses an Authorization: Apikey {username}:{api key} header, a current Central-time Timestamp header, JSON content negotiation, and the https://api.eworkorders.com/v1 base URL.

use ChrisJohnLeah\EworksManager\EworksClient;

$client = EworksClient::fromArray([
    'username' => $username,
    'api_key' => $apiKey,
]);

$customers = $client->get('customers');
foreach ($customers->records() as $customer) {
    // Provider data only: map it in the consuming application.
}

$workorders = $client->workorders();
$notes = $client->workorderLogs('WO-100');
$purchaseOrders = $client->purchaseOrders();
$purchaseOrderLines = $client->purchaseOrderLineItems('PO-100');

$created = $client->postWorkorder([
    'title' => 'Automatic door inspection',
    'type_num' => 2,
    'type_desc' => 'Preventive Maintenance',
    'type_short' => 'PM',
]);

The SDK owns provider transport, headers, response normalization, and transient retries. It does not decide tenant plans, migrations, local models, or archive retention.

postWorkorder() mirrors the documented POST /workorders endpoint. The provider requires title, type_num, type_desc, and type_short; consuming applications remain responsible for choosing tenant-specific work types and for deciding when a write is safe.

Testing

Run the package contract tests with composer install followed by vendor/bin/pest.