Skip to content

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 build

Both 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 PythonEndpoint
corridors.search(params)corridors.search(**params)POST /v1/corridors/search
eligibility.check(params)eligibility.check(**params)POST /v1/eligibility
providers.list(params)providers.list(product=, country=)GET /v1/providers
providers.retrieve(slug)providers.retrieve(slug)GET /v1/providers/{id}
compare({ providers })compare(providers)POST /v1/compare
capabilities.list(params) · listAll()capabilities.list(...) · list_all()GET /v1/capabilities
changes.list(params)changes.list(limit=, provider=, since=)GET /v1/changes
watchlists.list/create/retrieve/update/delete/alertswatchlists.*/v1/watchlists
decisions.create/retrieve/revalidate/events/evidence—/v1/decisions
policies.list/create/retrieve/createVersion/activate—/v1/policies