Search by

PHP SDK for the PEV Registry partner API.

dev-main 2026-09-24 09:57 UTC

This package is auto-updated.

Last update: 2026-09-24 09:59:03 UTC


README

Dependency-free PHP client for the PEV Registry partner API. Requires the cURL extension.

Installation

Once published, install via Composer:

composer require pevregistry/sdk

Until then, point Composer at the git repository directly:

{
  "repositories": [{ "type": "vcs", "url": "https://github.com/YOUR_ORG/pevregistry-php-sdk" }],
  "require": { "pevregistry/sdk": "^1.0" }
}

Usage

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

use PevRegistry\Sdk\PevRegistryClient;

$client = new PevRegistryClient(getenv('PEV_REGISTRY_API_KEY'));

$result = $client->lookup('WT2500W26070581');
print_r($result);

Methods

$client->lookup($identifier);

$client->reportPossession(['identifier' => $identifier]);
$client->reportPossession(['registrationId' => $registrationId]);

$client->createServiceLog([
    'identifier' => $identifier,
    'serviceType' => 'Brake adjustment',
    'notes' => 'Adjusted rear brake caliper.',
    'odometerReading' => 842,
    'servicedAt' => '2026-09-22T14:30:00-04:00',
]);

$imageBytes = $client->getPhotoByIndex($registrationId, 0);
// New devices are registered through the embeddable registration widget (see the "Registration
// Widget" section of /docs), not this SDK — there is no registerDevice() method.

$client->getAccount();
$client->updateAccount(['companyName' => 'Example Shop']);
$client->rotateApiKey();
$client->updateWebhook('https://example.com/webhooks/pev-registry');
$client->generateWebhookSecret();

API errors throw PevRegistryException with status and response fields.