xalantis / sdk
Official PHP SDK for the Xalantis API
v0.2.0
2026-07-28 21:03 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- mockery/mockery: ^1.6
- phpunit/phpunit: ^11.0|^12.0
README
Official PHP SDK for the Xalantis API.
Release 0.2.0 covers every current public /api/v1 endpoint exposed by Xalantis at the time of release.
Installation
composer require xalantis/sdk
Quick start
use Xalantis\Xalantis; $client = new Xalantis($_ENV['XALANTIS_API_KEY']);
For local testing:
$client = new Xalantis('sk_live_...', 'https://xalantis-application.test');
Covered domains
- Support / Service Desk: tickets, replies, attachments, reports, links, watchers, time entries, subtasks, incidents, service requests, SLA, automations, categories, tags, service catalog, agents.
- CRM: clients, representatives, contacts, deals, pipelines.
- Knowledge: articles, search, categories.
- Billing: subscription and invoices.
- Finance: invoices and expenses read-only APIs.
- Contracts: contracts, comments, negotiations, obligations, approvals, signatures, clauses, requests, PDF designs, assets, assignments.
Examples
Support tickets
$ticket = $client->tickets()->create([ 'subject' => 'Login issue', 'description' => 'Cannot login since the latest update', 'requester_email' => 'user@example.com', 'type' => 'incident', 'priority' => 'high', ]); $client->tickets()->reply($ticket['data']['uuid'], [ 'content' => 'We are investigating this.', ]); $activities = $client->tickets()->activities($ticket['data']['uuid']);
Attachments and downloads
$client->tickets()->uploadAttachment('ticket-uuid', [ [ 'name' => 'file', 'contents' => fopen('/path/to/file.pdf', 'r'), 'filename' => 'file.pdf', ], ]); $response = $client->tickets()->downloadAttachment('ticket-uuid', 'attachment-uuid'); file_put_contents('/tmp/attachment.pdf', $response->getBody()->getContents());
CRM
$clients = $client->clients()->list(['search' => 'Acme']); $contact = $client->contacts()->create([ 'first_name' => 'Awa', 'email' => 'awa@example.com', ]); $client->deals()->update('deal-uuid', [ 'stage_uuid' => 'stage-uuid', ]);
Knowledge
$articles = $client->knowledge()->search(['search' => 'SLA']); $article = $client->knowledge()->get('how-to-configure-sla');
Billing and finance
$subscription = $client->billing()->subscription(); $billingInvoices = $client->billing()->listInvoices(); $expenses = $client->finance()->listExpenses();
Contracts
$contract = $client->contracts()->get('contract-uuid'); $client->contracts()->addComment($contract['data']['uuid'], [ 'content' => 'Reviewed by legal.', ]); $client->contracts()->submitForApproval($contract['data']['uuid']); $client->contracts()->requestSignatures($contract['data']['uuid']);
Error handling
use Xalantis\Exceptions\XalantisException; try { $client->tickets()->create([ 'subject' => '', 'description' => 'Missing subject', 'requester_email' => 'user@example.com', ]); } catch (XalantisException $e) { echo $e->errorCode; echo $e->status; print_r($e->details); }
Safety notes
- UUID path parameters are validated client-side to reduce accidental path misuse.
- Destructive operations such as delete, merge, split, waive, archive and attachment deletion are available because they are part of the public API. Applications should ask users for confirmation before calling them.
- The SDK does not bypass backend permissions, plan gates, tenant scoping or rate limits.
- Packagist versioning should be driven by Git tags such as
v0.2.0.
Development
composer install
composer test
License
MIT