xchgo developer platform

xchgo API

One key ID and one secret. One executable rate.

Add cross-chain swaps and reusable conversion addresses to a wallet or service.

Environment
Production
Base URL
https://xchgo.com/api/v1
Authentication
Backend-only key ID + secret
  1. 01
    Get credentialsStore both values on your backend.
  2. 02
    Load pairsUse the asset and network together.
  3. 03
    QuoteDisplay the selected rate.
  4. 04
    Create and trackWait for the deposit address.
Get started

Quickstart

Initialize the SDK with your xchgo key ID and shared secret. Keep both on your backend; the SDK signs requests automatically.

Node.js · setup
// Download from https://xchgo.com/sdk/xchgo-client.mjs
import {
  createXchgoClient,
  createIdempotencyKey
} from "./xchgo-client.mjs";

const xchgo = createXchgoClient({
  baseUrl: process.env.XCHGO_API_BASE,
  audience: process.env.XCHGO_API_AUDIENCE,
  keyId: process.env.XCHGO_KEY_ID,
  sharedSecret: process.env.XCHGO_SHARED_SECRET,
  userId: customer.id
});

Base URL: https://xchgo.com/api/v1. Set XCHGO_API_AUDIENCE=https://xchgo.com.

Keep both credentials server-side. Do not place them in client code.
Core flow

Create a swap

  1. Load GET /assets and GET /pairs?sourceAsset=BTC&sourceNetwork=BTC with both query parameters.
  2. Request POST /quotes and display the returned amount, fee, limits, and expiry.
  3. Create with POST /swaps using the same quote ID and an idempotency key.
  4. Poll GET /swaps/{id}.
Node.js · quote and create
const { quote } = await xchgo.quote({
  sourceAsset: "BTC",
  sourceNetwork: "BTC",
  destinationAsset: "ETH",
  destinationNetwork: "ETH",
  sourceAmount: "0.01",
  rateType: "best",
  refundMode: "sender"
});

const idempotencyKey = createIdempotencyKey();
const { order, accessToken } = await xchgo.createSwap({
  sourceAsset: "BTC",
  sourceNetwork: "BTC",
  destinationAsset: "ETH",
  destinationNetwork: "ETH",
  sourceAmount: "0.01",
  destinationAddress: customer.ethAddress,
  rateType: quote.rateType,
  refundMode: "sender",
  quoteId: quote.id
}, { idempotencyKey });
Wait for depositAddress. A newly accepted request may still be preparing its funding address.

If a create response is lost, retry the identical body with the same Idempotency-Key. The response is not always terminal; track terminal and actionRequired.

Reusable addresses

Permanent conversion routes

A reusable route links supported deposit addresses to a verified Zano or fUSD destination.

  1. Create an ownership challenge with POST /permanent-routes/challenges.
  2. Have the destination wallet sign the returned message.
  3. Create or recover the route with POST /permanent-routes.
  4. Read deposits from GET /permanent-routes/{id}/deposits.

Use the addresses, status, fee cap, minimum, and automatic-processing maximum returned by the route. Deposits below the minimum accumulate only with later deposits of the same asset. Call expect-deposit before an expected payment for faster polling.

Reference

Endpoints

MethodEndpointDescription
GET/api/v1/healthService availability.
GET/api/v1/assetsSupported assets and networks.
GET/api/v1/pairsDestinations and limits for a source asset.
POST/api/v1/quotesGet one selected quote.
POST/api/v1/swapsCreate a swap from a quote.
GET/api/v1/swapsList swaps for the partner user.
GET/api/v1/swaps/{id}Get swap status.
GET, PUT/api/v1/partner/webhookRead or set the signed status webhook URL.
GET, PUT/api/v1/partner/markupRead or set the markup applied to new permanent routes.
GET/api/v1/partner/earningsList markup earnings.
POST/api/v1/permanent-routes/challengesStart wallet ownership verification.
POST/api/v1/permanent-routesCreate or recover a reusable route.
GET/api/v1/permanent-routesList reusable routes.
GET/api/v1/permanent-routes/{id}Get one reusable route.
GET/api/v1/permanent-routes/{id}/depositsList deposits for a route.
POST/api/v1/permanent-routes/{id}/expect-depositTemporarily increase polling for an expected deposit.

Full request and response schemas are in the OpenAPI document. The same short guide is available as Markdown.

Operations

Errors and support

Errors use { "error": { "code": "…", "message": "…" } }. Correct 400 requests, refresh unavailable or expired quotes, and retry 429 or temporary service errors with backoff. Use the returned Retry-After header when present.

For credentials or integration support, contact support@xchgo.com.