Interpose

SDKs & Tools

SDKs & Postman

Official client libraries for TypeScript and Python, plus Postman collections for every pillar. All SDKs are generated from the same OpenAPI 3.1 specs that power the interactive API reference.

TypeScript / Node.js SDK

Works in Node.js 18+ and modern browsers. Fully typed — every request and response shape is inferred from the OpenAPI spec. Monetary values are returned as strings to preserve decimal precision.

Install

bash
npm install @interpose/sdk
# or
yarn add @interpose/sdk
# or
pnpm add @interpose/sdk

Initialize the client

typescript
import { InterposeClient } from '@interpose/sdk';

const client = new InterposeClient({
  apiKey: process.env.INTERPOSE_API_KEY!,
  baseUrl: 'https://api.interposehq.com',   // omit to use production default
});

BaaS — accounts & orders

typescript
// Open an account
const account = await client.baas.accounts.create({
  owner_name:   'Jane Smith',
  account_type: 'INDIVIDUAL',
  currency:     'USD',
});
// account.id → "acct_01HV4Y2K3M5N8P9QR2ST4UVWXY"

// Place a market order
const order = await client.baas.orders.create({
  account_id:      account.id,
  side:            'BUY',
  order_type:      'MARKET',
  quantity:        '10.00000000',
  security:        { type: 'ticker', value: 'AAPL' },
});

// Stream positions in real time
const stream = client.baas.positions.stream(account.id);
stream.on('data', (event) => console.log(event.data.market_value));
stream.on('error', console.error);
stream.close();

Portfolio Management — rebalancing

typescript
// List portfolios
const { items } = await client.pm.portfolios.list({ page: 1, page_size: 25 });

// Trigger a rebalance
const run = await client.pm.rebalancing.trigger({
  portfolio_id: 'ptf_01HV4Y2K3M5N8P9QR2ST4UVWXY',
  drift_threshold: '0.0500',   // 5 % drift
});

// Poll until approved (or subscribe to the WebSocket stream)
const approved = await client.pm.rebalancing.approve(run.id, { notes: 'LGTM' });
console.log(approved.status); // "APPROVED"

Post-Trade — settlement

typescript
// Initiate settlement
const txn = await client.postTrade.transactions.initiate({
  order_id:        'ord_01HV4Y2K3M5N8P9QR2ST4UVWXY',
  settlement_date: '2026-05-14',
});

// Get current status
const updated = await client.postTrade.transactions.get(txn.id);
console.log(updated.status); // "PENDING" | "SETTLING" | "SETTLED" | "FAILED"

TPA — retirement plans

typescript
// Create a 401(k) plan
const plan = await client.tpa.plans.create({
  plan_name:   'Acme Corp 401(k)',
  plan_type:   '401k',
  tax_year:    2026,
  employer_id: 'emp_01HV4Y2K3M5N8P9QR2ST4UVWXY',
});

// Enroll a participant
const participant = await client.tpa.participants.create({
  plan_id:    plan.id,
  ssn_last4:  '4321',
  first_name: 'Alice',
  last_name:  'Smith',
  hire_date:  '2022-01-15',
});

// Run ADP/ACP nondiscrimination test
const testResult = await client.tpa.compliance.runAdpAcp({ plan_id: plan.id, tax_year: 2026 });
console.log(testResult.adp_passed, testResult.acp_passed);

Error handling

typescript
import { InterposeError, RateLimitError } from '@interpose/sdk';

try {
  await client.baas.orders.create({ ... });
} catch (err) {
  if (err instanceof RateLimitError) {
    await new Promise(r => setTimeout(r, err.retryAfterMs));
  } else if (err instanceof InterposeError) {
    console.error(err.status, err.detail, err.failedChecks);
  }
}

Python SDK

Supports Python 3.10+. Uses httpx under the hood — both sync and async clients are available. All monetary values are returned as Decimal instances to avoid float precision issues.

Install

bash
pip install interpose
# extras: async support is included; no extra installs needed

Initialize the client

python
import os
from interpose import InterposeClient

client = InterposeClient(
    api_key=os.environ["INTERPOSE_API_KEY"],
    base_url="https://api.interposehq.com",   # optional; defaults to production
)

Async client

python
import asyncio
from interpose import AsyncInterposeClient

async def main():
    async with AsyncInterposeClient(api_key="...") as client:
        account = await client.baas.accounts.create(
            owner_name="Jane Smith",
            account_type="INDIVIDUAL",
            currency="USD",
        )
        print(account.id)

asyncio.run(main())

BaaS — accounts & orders

python
from decimal import Decimal

# Open an account
account = client.baas.accounts.create(
    owner_name="Jane Smith",
    account_type="INDIVIDUAL",
    currency="USD",
)

# Place a market order
order = client.baas.orders.create(
    account_id=account.id,
    side="BUY",
    order_type="MARKET",
    quantity=Decimal("10.00000000"),
    security={"type": "ticker", "value": "AAPL"},
)
print(order.id)        # "ord_01HV4Y2K3M5N8P9QR2ST4UVWXY"
print(order.status)    # "PENDING"

TPA — contributions & limits

python
from decimal import Decimal

# Process a contribution
contribution = client.tpa.contributions.create(
    participant_id="part_01HV4Y2K3M5N8P9QR2ST4UVWXY",
    amount=Decimal("2000.0000"),
    currency="USD",
    contribution_type="EMPLOYEE_PRE_TAX",
    payroll_date="2026-05-31",
)

# Check §402(g) headroom
limits = client.tpa.limits.get(
    participant_id="part_01HV4Y2K3M5N8P9QR2ST4UVWXY",
    tax_year=2026,
)
print(limits.annual_402g_limit)      # Decimal("23500.0000")
print(limits.ytd_contributions)      # Decimal("14200.0000")
print(limits.remaining_402g_limit)   # Decimal("9300.0000")

Error handling

python
from interpose.exceptions import InterposeError, RateLimitError
import time

try:
    client.baas.orders.create(...)
except RateLimitError as e:
    time.sleep(e.retry_after)
except InterposeError as e:
    print(e.status, e.detail, e.failed_checks)

Postman Collections

Each pillar ships a pre-built Postman collection with every endpoint, example request bodies, and environment variables for baseUrl, apiKey, and common entity IDs. Import a collection into Postman, set the environment variables, and you can exercise the full API in minutes.

Environment setup

After importing a collection, create a Postman environment with these variables:

json
{
  "baseUrl":        "https://api.interposehq.com",
  "apiKey":         "your-api-key-here",
  "accountId":      "acct_01HV4Y2K3M5N8P9QR2ST4UVWXY",
  "portfolioId":    "ptf_01HV4Y2K3M5N8P9QR2ST4UVWXY",
  "planId":         "plan_01HV4Y2K3M5N8P9QR2ST4UVWXY"
}

Each collection's pre-request scripts automatically compute the HMAC-SHA256 signature if you set an hmacSecret environment variable — no manual signing required.

Next steps