Warddocs
Client SDKs

Client SDKs

Language Package Install
Python mandate-ward pip install mandate-ward
JavaScript / TypeScript @mandatelabs/ward npm install @mandatelabs/ward

Both clients:

  • read the key from WARD_API_KEY (or take it as an argument) and send it in X-API-Key;
  • retry 429 and 5xx with backoff, honouring Retry-After, and send an Idempotency-Key on /decide so a retry never decides or bills twice;
  • never retry calls that send or check a KYC code;
  • raise typed errors (InsufficientBalanceError, RateLimitError, …) carrying code, request_id and details;
  • read and base64-encode statement files for you;
  • wait for async jobs.

Use them server-side only. The REST API is the contract: anything the SDKs do, you can do with plain HTTP.

Publishing

The packages are being published to PyPI and npm. Until then install from the repository: pip install ./sdk/ward-python or npm install ./sdk/ward-js.