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
- Specification
- OpenAPI 3.1 · v1.12
- 01Get credentialsStore both values on your backend.
- 02Load pairsUse the asset and network together.
- 03QuoteDisplay the selected rate.
- 04Create and trackWait for the deposit address.
Quickstart
Initialize the SDK with your xchgo key ID and shared secret. Keep both on your backend; the SDK signs requests automatically.
// 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.
Create a swap
- Load
GET /assetsandGET /pairs?sourceAsset=BTC&sourceNetwork=BTCwith both query parameters. - Request
POST /quotesand display the returned amount, fee, limits, and expiry. - Create with
POST /swapsusing the same quote ID and an idempotency key. - Poll
GET /swaps/{id}.
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 });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.
Permanent conversion routes
A reusable route links supported deposit addresses to a verified Zano or fUSD destination.
- Create an ownership challenge with
POST /permanent-routes/challenges. - Have the destination wallet sign the returned message.
- Create or recover the route with
POST /permanent-routes. - 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.
Endpoints
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.
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.