All SDKs

BUILD WITH ACCOUNTING

The PHP SDK.

Integrate the Accounting API into your PHP application.

INSTALL THE CLIENT

composer require accounting-sh/php_sdk

Use the repository documentation to choose a compatible release and confirm package availability.

A first read in the sandbox

Set ACCOUNTING_API_TOKEN to a sandbox company credential in your server environment. Handle failures before using the result in your application.

<?php
require __DIR__ . '/vendor/autoload.php';

$token = getenv('ACCOUNTING_API_TOKEN');
if (!$token) throw new RuntimeException('Set ACCOUNTING_API_TOKEN');

$api = new \Accounting\Accounting($token, 'https://sandbox.api.accounting.sh');
$accounts = $api->accounts()->listAccounts(page: '1', perPage: '10');

Build with PHP

Connect an existing PHP application, a sales back office or scheduled server tasks through the PHP client. Load the client through Composer’s autoloader and protect its credential in server configuration.

Install and choose a release

The installation command below uses the package name declared by the SDK project. Consult the linked repository for release availability, requirements and the documentation matching your installed version. Pin the release you test instead of assuming every version exposes the same methods.

Start with a small read

Enable API access for the company, then use the SDK’s documented configuration for the intended environment and credential. Start by listing a resource and inspect pagination and error responses. The API reference remains the source for fields and permissions.

Add writes carefully

Validate your inputs and retain returned resource identifiers. Review uncertain network results before repeating a write. Connect webhook processing only after your synchronous workflow is tested, and re-read state before acting on an event.

Understand service boundaries

One payment enables API access forever for your company. See the country price on the pricing page. Integrations have their own access and do not require this purchase.

Work in another language?

JavaScript

Integrate the Accounting API into your JavaScript application.

accountingshExplore the SDK

PHP

Integrate the Accounting API into your PHP application.

accounting-sh/php_sdkExplore the SDK

Python

Integrate the Accounting API into your Python application.

accounting_shExplore the SDK