Reference
SDKsBeta
The SDK surface mirrors the REST tree, so a method name is a path and nothing has to be learned twice. Inputs are idiomatic (camelCase in TypeScript, snake_case in Python); responses come back exactly as the API sent them, evidence and confidence included.
Install
# inside this monorepo (workspace package, zero dependencies)
pnpm add @railor/sdk --workspace
# or build a publishable copy
pnpm --filter @railor/sdk buildBoth packages live in the Railor repository; registry publication is pending, so install from source.
Quick start
import { Railor, RailorAPIError } from "@railor/sdk"
const railor = new Railor({ apiKey: "rail_test_your_key_here", baseUrl: "https://www.railor.xyz" })
const routes = await railor.corridors.search({
entityCountry: "IN",
destinationCountry: "AE",
sourceAsset: "USDC",
destinationCurrency: "AED",
})
console.log(routes.providers_checked, routes.data)
const profile = await railor.providers.retrieve("northwind-rails")
const diff = await railor.compare({ providers: ["northwind-rails", "meridian-pay"], onlyDifferences: true })
for await (const row of railor.capabilities.listAll({ destinationCountry: "AE" })) {
// every row carries availability, confidence and its evidence
}
try {
await railor.providers.retrieve("does-not-exist")
} catch (error) {
if (error instanceof RailorAPIError) console.log(error.status, error.code)
}Signed in, these samples render with your workspace's test key. Idempotent requests retry on 429/5xx; writes never retry.
Methods
| TypeScript | Python | Endpoint |
|---|---|---|
| corridors.search(params) | corridors.search(**params) | POST / |
| eligibility.check(params) | eligibility.check(**params) | POST / |
| providers.list(params) | providers.list(product=, country=) | GET / |
| providers.retrieve(slug) | providers.retrieve(slug) | GET / |
| compare({ providers }) | compare(providers) | POST / |
| capabilities.list(params) · listAll() | capabilities.list(...) · list_all() | GET / |
| changes.list(params) | changes.list(limit=, provider=, since=) | GET / |
| watchlists.list/ | watchlists.* | / |
| decisions.create/ | — | / |
| policies.list/ | — | / |