The official PHP SDK for the Crisphive API.
Typed access to the public /v1 API — customers, bookings, catalog, team and
fleet.
PHP 7.4+ with the curl, json and mbstring extensions.
composer require crisphive/crisphive-phpEvery request is authenticated with a secret API key sent as a bearer token. Create keys from your Crisphive business dashboard. The key prefix selects the data environment:
chsk_live_…→ live (production) datachsk_test_…→ sandbox (isolated test) data
Load keys from the environment — never commit them.
<?php
require_once __DIR__ . '/vendor/autoload.php';
$config = Crisphive\Configuration::getDefaultConfiguration()
->setAccessToken(getenv('CRISPHIVE_API_KEY')); // SDK adds the "Bearer " prefix
$customers = new Crisphive\Api\CustomerApi(new GuzzleHttp\Client(), $config);
// List customers.
$res = $customers->listCustomers(null, null, null, null, null, 1, 20);
foreach ($res->getData()->getCustomers() ?? [] as $c) {
echo $c->getId() . ' ' . $c->getFullName() . "\n";
}
// Create a customer.
try {
$body = new Crisphive\Model\CustomerCreateRequest([
'full_name' => 'Ada Lovelace',
'email' => '[email protected]',
]);
$created = $customers->createCustomer($body);
echo 'created ' . $created->getData()->getCustomerId() . "\n";
} catch (Crisphive\ApiException $e) {
echo 'error ' . $e->getCode() . ' ' . $e->getResponseBody() . "\n";
}Method parameter lists follow the generated signatures — see the API reference for the exact arguments of each call.
List methods accept $page / $limit and return a meta object (total,
count, per_page, current_page, total_pages).
create* calls (customers, bookings) accept an Idempotency-Key so retries
never create a duplicate.
Non-2xx responses throw Crisphive\ApiException; inspect $e->getCode() and
$e->getResponseBody() for the Crisphive error code.
- Docs: https://docs.crisphive.com
- API reference: https://docs.crisphive.com/technical-reference
- Webhooks: https://docs.crisphive.com/webhook