Official PHP SDK for the Xalantis API

Maintainers

Package info

github.com/xalantis-hub/xalantis-php

pkg:composer/xalantis/sdk

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-04-04 09:54 UTC

This package is auto-updated.

Last update: 2026-05-04 10:40:59 UTC


README

Official PHP SDK for the Xalantis API.

Installation

composer require xalantis/sdk

Quick Start

use Xalantis\Xalantis;

$client = new Xalantis('sk_live_...');

Tickets

Create a ticket

$response = $client->tickets()->create([
    'subject' => 'Login issue',
    'description' => 'Cannot login since the latest update',
    'requester_email' => 'user@example.com',
    'priority' => 'high',
    'category_slug' => 'technical-support', // optional
]);

echo $response['data']['uuid'];
echo $response['data']['reference'];

List tickets

$response = $client->tickets()->list([
    'status' => 'open',
    'priority' => 'high',
    'per_page' => 10,
    'sort_by' => 'created_at',
    'sort_dir' => 'desc',
]);

echo $response['meta']['total'] . ' tickets found';

Get a ticket

$response = $client->tickets()->get('ticket-uuid');
$ticket = $response['data'];

Update a ticket

$client->tickets()->update('ticket-uuid', [
    'status' => 'resolved',
    'priority' => 'low',
]);

Reply to a ticket

$client->tickets()->reply('ticket-uuid', [
    'content' => 'This has been fixed in v2.1.0',
]);

// Internal note (not visible to requester)
$client->tickets()->reply('ticket-uuid', [
    'content' => 'Deployed hotfix to production',
    'is_internal' => true,
]);

List replies

$response = $client->tickets()->listReplies('ticket-uuid');

Error Handling

use Xalantis\Xalantis;
use Xalantis\Exceptions\XalantisException;

try {
    $client->tickets()->create([...]);
} catch (XalantisException $e) {
    echo $e->errorCode;  // 'VALIDATION_ERROR'
    echo $e->getMessage(); // 'Validation failed.'
    echo $e->status;      // 422
    print_r($e->details); // ['subject' => ['Required']]

    // Rate limiting
    if ($e->status === 429) {
        sleep($e->retryAfter ?? 60);
    }
}

License

MIT