Overview
HPTS is the sole programmatic interface to the Clarivo lending ledger. All money-movement events — payments, disbursements, daily accruals, reversals — are posted through this API. All balance and history reads are served through this API. Base URL:https://ledger.clarivo.co/v1
Core invariants
| # | Invariant | Detail |
|---|---|---|
| 1 | Append-only | No mutation endpoints exist. Corrections are reversals. |
| 2 | Double-entry | Every posting produces balanced journal lines. |
| 3 | Idempotent writes | Every POST requires an Idempotency-Key header. |
| 4 | Tenant-isolated | Every request is scoped to one tenant via JWT claims. |
| 5 | Mutual auth for B2B | Partner endpoints require mTLS + OAuth. |
Authentication
All endpoints are secured with OAuth 2.0 bearer tokens. Tokens are validated at the API Gateway via a Lambda Authorizer that checks signature,iss, aud, exp, nbf, and
the tenant_id custom claim. Each operation requires a specific scope.
Idempotency
EveryPOST request must include an Idempotency-Key header.
- Keys are scoped per tenant and retained for 24 hours minimum.
- Same key + same payload → returns the original result (
HTTP 200). - Same key + different payload →
HTTP 422withidempotency_mismatch. - Concurrent requests with the same in-flight key →
HTTP 409withidempotency_in_progress.
<event_type>:<resource_id>:<natural_key>
Errors
All errors follow RFC 7807 Problem Details withContent-Type: application/problem+json. Field-level validation failures include an
optional errors[] array with field, code, and message.