getzazu / zazu-php
PHP SDK for the Zazu API
Requires
- php: >=8.2
- ext-json: *
- guzzlehttp/guzzle: ^7.8
Requires (Dev)
- phpunit/phpunit: ^11.0
- symfony/yaml: ^7.0
This package is not auto-updated.
Last update: 2026-07-16 22:03:38 UTC
README
PHP SDK for the Zazu API.
composer require getzazu/zazu-php
use Zazu\Client; $client = new Client(apiKey: getenv('ZAZU_API_KEY')); $entity = $client->entity->get(); $page = $client->accounts->list(); foreach ($page->data as $account) { echo $account['id'], ' ', $account['name'], PHP_EOL; } // Initiate a transfer — it lands in your workspace's in-app approval // queue; the API never executes a transfer itself. $draft = $client->transferDrafts->create([ 'account_id' => $accountId, 'beneficiary_id' => $beneficiaryId, 'amount' => '150.00', 'payment_reference' => 'INV-000042', ]);
Response shape
Response bodies are returned as-is from the API — snake_case keys in an
associative array, no typed models. The same shape ships across every Zazu
SDK (Ruby, TypeScript, Python, Go, PHP, ...) so the cassette contract is
one-to-one.
Pagination
List endpoints return a Zazu\Page with data, hasMore, and
nextCursor; call next() to fetch the following page (null when done).
Page size is capped at 100.
Errors
Non-2xx responses throw Zazu\Exception\ApiException with status,
kind (authentication, forbidden, not_found, validation,
rate_limit, server, api), the API's type/message/param, the
requestId, and retryAfter for 429s. Transport failures throw
Zazu\Exception\ConnectionException; client misconfiguration throws
Zazu\Exception\ConfigurationException.
Tests
Tests replay the canonical cassettes recorded by zazu-ruby. The cassettes are downloaded from the Ruby SDK's release tarball and served from a Guzzle replay handler. Same interactions, same assertions, every language.
scripts/fetch-cassettes.sh composer install vendor/bin/phpunit
The SDK family
- zazu-ruby — reference implementation (records the cassettes)
- zazu-ts
- zazu-python
- zazu-go
- cli