Skip to content
HisarPay

SDKs and plugins

SDKs

The official libraries cover every /v1 endpoint and take care of retries, idempotency keys, pagination and webhook signature verification for you.

Installation

npm install https://hisarpay.com/downloads/hisarpay-node-1.0.0.tgz
LibraryRequirementsPackage
Node.jsNode 18+ · ESM and CommonJS · no dependencies@hisarpay/node
PHPPHP 8.1+ · ext-curl, ext-jsonhisarpay/hisarpay-php
PythonPython 3.9+ · httpx · sync and async clientshisarpay

Configuration

import { HisarPay } from '@hisarpay/node';

const hisarpay = new HisarPay(process.env.HISARPAY_API_KEY!, {
  timeoutMs: 30_000, // per attempt
  maxRetries: 2, // network errors, 408, 429, 5xx
});

Every method also takes options for that call only (timeout, retries, idempotency key). The packages’ READMEs have the details.

What they share

  • Retries: network errors, 408, 429, 5xx and 409 request_in_progress are retried twice by default, with delays growing from 0.5 s to 8 s; Retry-After is honoured.
  • Idempotency: every POST carries an automatic Idempotency-Key, reused on retries.
  • Webhooks: constructEvent / construct_event checks the signature, the time tolerance and secret rotation, then returns the event.
  • Pagination: listAll / list_all walks every page in order.
  • Types: the Node.js package ships TypeScript types, the Python package TypedDict definitions.
  • Errors: each HTTP status has its own error class, and all of them carry code and request_id.

Other languages

In a language without an official library, use the API directly over HTTP: a JSON body, a Bearer key and an Idempotency-Key header are all it takes. Every endpoint is in the API reference, and signature verification in the Webhooks guide.