Quick Installation

Get started with Xero in PHP in under a minute

Terminal
composer require apideck/apideck-php
<?php
require_once 'vendor/autoload.php';

use Apideck\Client\Apideck;

$apideck = new Apideck([
    'api_key' => getenv('APIDECK_API_KEY'),
    'app_id' => getenv('APIDECK_APP_ID'),
    'consumer_id' => 'user-123'
]);

// Connect to Xero
$connections = $apideck->accounting->connectionsAll([
    'service_id' => 'xero'
]);

// List data from Xero
$companies = $apideck->accounting->companiesAll([
    'service_id' => 'xero'
]);

print_r($companies);

Why use the PHP SDK?

Type Safety

Full type definitions for PHP. Catch errors at compile time, not runtime.

Auto-generated

SDK is auto-generated from our OpenAPI spec, always up-to-date with the latest API.

Error Handling

Built-in error types and retry logic. Handle rate limits and errors gracefully.

Pagination

Automatic pagination handling. Iterate through large datasets effortlessly.

Authentication

OAuth, API keys, and consumer tokens handled automatically.

Documentation

Comprehensive docs with examples for every endpoint and method.

Xero available in all SDKs

Choose your preferred language

Launch accounting integrations in weeks, not months

Sign Up