Skip to main content
ScripX ships official clients for Python and TypeScript. Both wrap the same /v1 surface with resource namespaces, default to the production base URL, send your key in X-ScripX-Key, auto-attach an Idempotency-Key on writes, retry transient failures with backoff, and map the error envelope onto a typed exception hierarchy.

Python

pip install scripx. Standard library only, no dependencies.

TypeScript

npm install @scripx/sdk. fetch-based, ESM, zero runtime dependencies. Node 18+, browsers, edge.

Install

Authenticate

Construct a client with your key. The base URL is the same for production and sandbox, the key prefix decides which: scripx_live_… trades real money, scripx_test_… runs the identical code against the sandbox (a separate ledger, unmetered, clearly marked). See Authentication.
Money is always integer paise and prices are bps of face, in the SDKs exactly as on the wire. See Money and price.

Resource namespaces

Every /v1 operation lives under a namespace on the client: firms, credits, quotes, orders, positions, group, cross, market, rates, statements, earnings, usage, branding, keys, webhooks, audit. Responses are typed (Python TypedDicts, TypeScript interfaces) and returned as plain data, so additive fields the API adds later still flow through.

Get a quote, then place an order

The core trade loop: take a firm quote, then place an idempotent order at your price limit.
Order placement auto-attaches a fresh Idempotency-Key. Pin your own to make a retry at-most-once (see Idempotency):

List a firm’s scrips and credits

The direct-quote loop: list a connected firm’s inventory, then price a specific credit by its scrip number. List endpoints auto-paginate.
Trading on behalf of a client firm? Register and verify it first, its credits and trades unlock once its state is connected:

Register and verify a webhook

Register a callback, store the one-time signing secret, and verify every inbound delivery in your receiver on the raw request body:
See Webhooks for the event catalog and signature format.

Pull statements and earnings

Errors

Every failure raises a ScripxError subclass carrying .status, .code, .request_id, and .detail. Quote request_id to support.
Classes map to status: AuthError (401/403), ValidationError (400/422), NotFoundError (404), ConflictError (409), RateLimitError (429), ServerError (5xx), plus APIConnectionError / APITimeoutError for transport. The clients retry 429, 5xx, and connection failures with exponential backoff (max_retries=2 by default); non-idempotent writes retry only when an idempotency key is present. See the full error reference and rate limits.

Live OpenAPI spec

The API serves its own machine-readable contract, public, no key. Fetch it in code, or generate a client in any language and import it into Postman or Insomnia:
The same spec backs every page under API Reference.