crisphive/crisphive-php
Composer 安装命令:
composer require crisphive/crisphive-php
包简介
Official PHP SDK for the CrispHive API.
README 文档
README
The official PHP SDK for the CrispHive API.
Typed access to the public /v1 API — customers, bookings, catalog, team and
fleet.
Requirements
PHP 7.4+ with the curl, json and mbstring extensions.
Installation
composer require crisphive/crisphive-php
Authentication
Every 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.
Usage
<?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' => 'ada@example.com', ]); $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.
Pagination
List methods accept $page / $limit and return a meta object (total,
count, per_page, current_page, total_pages).
Idempotency
create* calls (customers, bookings) accept an Idempotency-Key so retries
never create a duplicate.
Errors
Non-2xx responses throw Crisphive\ApiException; inspect $e->getCode() and
$e->getResponseBody() for the CrispHive error code.
Documentation
- Docs: https://docs.crisphive.com
- API reference: https://docs.crisphive.com/technical-reference
- Webhooks: https://docs.crisphive.com/webhook
License
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: unlicense
- 更新时间: 2026-07-02