SDKs & Postman

Client libraries for PHP, JavaScript/TypeScript and Python, and a Postman collection, generated from the HassleFreeBooks API's OpenAPI document — all 156 operations. Each one handles authentication, token refresh, retries on rate limits and the response envelope, and verifies webhook signatures. MIT licensed, no dependencies.

Version 1.0.3 · regenerated whenever the API changes · OpenAPI document

PHP

PHP 8.1+, ext-curl. Composer or plain require.

Download the PHP SDK

Install with Composer

Add this repository to composer.json, then composer require hasslefreebooks/hasslefreebooks-php.

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "hasslefreebooks/hasslefreebooks-php",
                "version": "1.0.3",
                "dist": {
                    "url": "https://hasslefreebooks.com/developer-portal/sdks/hasslefreebooks-php.zip",
                    "type": "zip"
                },
                "require": {
                    "php": ">=8.1",
                    "ext-curl": "*",
                    "ext-json": "*"
                },
                "autoload": {
                    "psr-4": {
                        "HassleFreeBooks\\": "src/"
                    }
                }
            }
        }
    ]
}

JavaScript / TypeScript

Node 20+, Deno, Bun, browsers. ESM + CommonJS, typings included.

Download the JS SDK

npm install https://hasslefreebooks.com/developer-portal/sdks/hasslefreebooks-js.tgz

Python

Python 3.8+, standard library only.

Download the Python SDK

pip install https://hasslefreebooks.com/developer-portal/sdks/hasslefreebooks-python.zip

Postman

Every operation, foldered by area. In Postman: Import → paste the link.

Collection Environment

https://hasslefreebooks.com/developer-portal/sdks/hasslefreebooks.postman_collection.json

Paste an API key into the environment's accessToken, or set email and password and run Authentication → User Login once (it stores the tokens).

Quick start

Create an API key at /api-keys (choose its scopes; it is shown once). Then:

use HassleFreeBooks\Client;
use HassleFreeBooks\ApiException;

$hfb = new Client(['api_key' => getenv('HFB_API_KEY')]);

try {
    $page    = $hfb->listTransactions(query: ['start_date' => '2026-01-01', 'page' => 1]);
    $invoice = $hfb->getInvoice(42);
    $entry   = $hfb->createJournalEntry($body, options: ['headers' => ['Idempotency-Key' => $uuid]]);
} catch (ApiException $e) {
    error_log("{$e->status} {$e->errorCode} {$e->requestId}");   // branch on errorCode
}

What every SDK does for you

Webhooks

Each SDK verifies X-HassleFreBooks-Signature (sha256= + HMAC-SHA256 of the raw body, keyed with the endpoint's signing secret) in constant time: Webhook::verify(), verifyWebhookSignature(), verify_webhook_signature(). Verify the raw bytes before decoding, answer 2xx within 30 seconds, and de-duplicate on X-HassleFreBooks-Delivery.

Another language

Point any OpenAPI 3.0 generator at the live document, for example:

npx @openapitools/openapi-generator-cli generate -i https://hasslefreebooks.com/api/v1/openapi -g go -o hasslefreebooks-go