Most custodians should use scheduled downloads — see Audit Exports. This page is for the minority of custodians who need programmatic access: real-time accounting reconciliation or downstream systems that can’t consume batch exports.
When to use this
- Your downstream systems are event-driven (real-time, not batch-ingested)
- Your accounting system reconciles continuously and can’t wait for daily exports
- You’re automating the accept/reject authorization decision itself
- You need sub-second settlement notifications (most custodians do not)
Authentication
JWT bearer token, refreshed roughly every hour. Full details in Authentication. Typical pattern: cache the token, refresh ~60 s before expiry, retry once on 401 after forcing a refresh.Proposal + quote workflow via REST
Full endpoint shapes, request/response examples: API Reference.
WebClientResponseException.Unauthorized on 401 → force-refresh the token and retry once; surface Conflict on 409 (expired quote, order already advanced) back to whatever subsystem triggered the call. For rejectQuote, surface UnprocessableEntity on 422 (rejection_detail too short) as a client-side validation bug — auditors expect ≥ 20 chars.
Real-time settlement events via SSE
Production notes
- Idempotency. Handle
SETTLEDevents idempotently — SSE reconnects can replay the latest event. Key your accounting write byintentId + transactionHash. - Ordering.
order_updatedevents are per-contract — you may seeEXECUTINGthenSETTLEDfor the same intent. Filter toSETTLEDonly if that’s the only state your accounting cares about. - Backpressure. If your downstream is slow, switch
.doOnNextto.concatMap(ev -> Mono.fromCallable(() -> handle(ev)).subscribeOn(Schedulers.boundedElastic()))so slow handlers don’t starve the event loop.
Other stacks
Same shape, different clients:- Node —
fetchfor REST;EventSource(native) oreventsourcepackage for SSE - Python —
httpxorrequestsfor REST;httpx-sseorsseclient-pyfor SSE - Kotlin — same
WebClientas Java; orktor-client-cio+SSE
order_updated with status == SETTLED, dispatch to your downstream handlers with idempotency keyed on intentId + transactionHash.