Skip to content
Seismic Orchestration

Requesting quotes

A quote is a ranked comparison across every eligible rail for a given (source → destination, amount). The response contains a snapshot id, a list of quotes, and a pre-computed best_quote_id. Accept a quote to turn it into an order.

Full flow

import {  } from "seismic-orchestration";
 
const  = .();
 
// (Assume you've already logged in and MFA'd.)
 
// 1. Price the corridor across every option. wait=true blocks until pricing is complete.
//    Omit `rails` on the source to fan out across every USD-in rail. The
//    destination is always a registered account; pass its id, or
//    `{ account, rails }` to pin a rail.
const  = await ..(
  {
    : "7c4b…",
    : "individual",
    : "1000",
    : { : "USD" },
    : "3c92d2a1-…",
  },
  { : true },
);
 
// 2. (Optional) Show the user the ranked list, one entry per rail.
for (const  of .) {
  .(
    `${...(6)} → ${..} ${..}  ` +
    `rate=${.}  fee=${..} ${..}`,
  );
}
 
// 3. Accept the best pick; use `.accept(snapshotId, quoteId, opts)` to override.
//    A payment reason is required on every accept.
const orderArrow
= await ..(., { : "purchase_of_goods" });

Sync vs. async: wait=1

create has two modes, controlled by the wait option.

const quotes = await api.quotes.create(req, { wait: true });
// quotes.status === "ready"; every option has been priced.
ModeBehavior
wait: trueSingle round-trip. The response blocks until every option has priced.
Async (default)Returns immediately with status: "pending". Poll until status === "ready".

Picking a quote manually

acceptBest(snapshotId, opts) accepts the server's best_quote_id. To accept a specific entry, use accept with that quote's id:

import {  } from "./client";
 
// The `quoteId` comes from `snapshot.quotes[n].id`.
await ..(, "q_9e4d…", {
  : "purchase_of_goods",
});

The server returns 400 if quote_id isn't in the snapshot.

Error handling

import {  } from "./client";
import {  } from "seismic-orchestration";
 
try {
  await ..(
    {
      : "7c4b…",
      : "individual",
      : "1000",
      : { : "USD" },
      : "3c92d2a1-…",
    },
    { : true },
  );
} catch () {
  if ( instanceof  && . === 422) {
    // No eligible options for this corridor.
  } else {
    throw ;
  }
}

The full error taxonomy is at API reference → Errors.

What's next