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
One method per operation, named after the operation id in the reference
(snake_case in Python). Arguments: path parameters in URL order, then the body, then query parameters, then options.
Returns data from the {ok, request_id, data, meta} envelope and raises
an ApiError/ApiException with the stable code, details and
request_id otherwise. Downloads (the accountant package ZIP) return the bytes.
Signing in as a user: login() keeps the tokens; an expired access token is refreshed once,
by itself. Refresh tokens are single-use, so pass the onTokens callback and store the newest pair.
Retries a 429 after Retry-After, and 502/503/504 or network failures on reads and on
requests carrying an Idempotency-Key. Other writes are never retried behind your back.
Money is a decimal ("1500.00"); keep it out of floats.
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