MakeSwap Swap API
Headless and iframe-widget surface for token discovery, quotes, deposit channels, swap execution, and status tracking.
This is the MakeSwap headless and widget surface. Use the SDK or direct HTTP routes to discover supported tokens, quote routes, start swaps, and track progress across deposit, swap, outbound, completed, and failed phases.
Browser requests should use a short-lived integration token. Keep MakeSwap key secrets on your backend and exchange them for tokens before mounting an iframe or running headless requests.
https://www.makeswap.io/api/v1Authentication
Browser/widget calls use x-makeswap-integration-token and x-makeswap-session-id. Token issuance uses x-makeswap-key-id and x-makeswap-key-secret on the backend.
x-makeswap-integration-tokenMAKESWAP_INTEGRATION_TOKENx-makeswap-session-idms_session_123x-makeswap-key-idMAKESWAP_KEY_IDx-makeswap-key-secretMAKESWAP_KEY_SECRETWidget events
Embedded widgets communicate with the host page through postMessage events. Listen for makeswap.ready, makeswap.quote.updated, makeswap.swap.started, makeswap.swap.status, and makeswap.error to update host UI, resize containers, or persist swap status.
Operation reference
Endpoints
List tokens
Returns supported swap assets with chain, symbol, identifier, decimals, and logo metadata. Use this before building a quote form or widget prefill.
Body
Responses
application/jsonThe request completed successfully.
Response
tokensarray Object[]required/api/v1/tokenscurl "https://www.makeswap.io/api/v1/tokens" \
-H "Content-Type: application/json" \
-H "x-makeswap-integration-token: MAKESWAP_INTEGRATION_TOKEN" \
-H "x-makeswap-session-id: ms_session_123"{
"tokens": [
{
"chain": "Bitcoin",
"chainId": "BTC",
"ticker": "BTC",
"identifier": "BTC.BTC",
"symbol": "BTC",
"name": "Bitcoin",
"decimals": 8
}
]
}List providers
Returns swap providers available to the current integration context. Use provider filters when you need to force or hide specific liquidity routes.
Body
Responses
application/jsonThe request completed successfully.
Response
providersarray string[]required[
"CHAINFLIP",
"THORCHAIN",
"NEAR_INTENTS"
]/api/v1/providerscurl "https://www.makeswap.io/api/v1/providers" \
-H "Content-Type: application/json" \
-H "x-makeswap-integration-token: MAKESWAP_INTEGRATION_TOKEN" \
-H "x-makeswap-session-id: ms_session_123"{
"providers": [
"CHAINFLIP",
"THORCHAIN",
"NEAR_INTENTS"
]
}Create quote
Quotes one or more swap routes for a source asset, destination asset, amount, optional addresses, slippage, and provider filters.
Body
Request
sellAssetstringrequiredBTC.BTCbuyAssetstringrequiredETH.USDC-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48sellAmountstringrequired0.01sourceAddressstringrequiredbc1qsource...destinationAddressstringrequired0xdestination...slippageintegerrequired1includeTxbooleanrequiredfalsedisableBalanceCheckbooleanrequiredtrueResponses
application/jsonThe request completed successfully.
Response
routesarray Object[]required/api/v1/quotecurl -X POST "https://www.makeswap.io/api/v1/quote" \
-H "Content-Type: application/json" \
-H "x-makeswap-integration-token: MAKESWAP_INTEGRATION_TOKEN" \
-H "x-makeswap-session-id: ms_session_123" \
-d '{
"sellAsset": "BTC.BTC",
"buyAsset": "ETH.USDC-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"sellAmount": "0.01",
"sourceAddress": "bc1qsource...",
"destinationAddress": "0xdestination...",
"slippage": 1,
"includeTx": false,
"disableBalanceCheck": true
}'{
"routes": [
{
"routeId": "route-CHAINFLIP-0",
"providers": [
"CHAINFLIP"
],
"sellAsset": "BTC.BTC",
"sellAmount": "0.01",
"buyAsset": "ETH.USDC-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"expectedBuyAmount": "620.12",
"fees": [
{
"type": "network",
"amount": "0.00002",
"asset": "BTC.BTC"
}
],
"estimatedTime": {
"total": 900
}
}
]
}Create deposit channel
Creates a Chainflip-style deposit channel for a quoted route and returns the address or channel identifiers that the payer should fund.
Body
Request
routeIdstringrequiredroute-CHAINFLIP-0sourceAddressstringrequiredbc1qsource...destinationAddressstringrequired0xdestination...chainflipMetaObjectrequiredResponses
application/jsonThe request completed successfully.
Response
depositAddressstringrequiredbc1qdeposit...channelIdstringrequired210-Bitcoin-12345depositChannelIdstringrequired12345providerstringrequiredCHAINFLIP/api/v1/channelcurl -X POST "https://www.makeswap.io/api/v1/channel" \
-H "Content-Type: application/json" \
-H "x-makeswap-integration-token: MAKESWAP_INTEGRATION_TOKEN" \
-H "x-makeswap-session-id: ms_session_123" \
-d '{
"routeId": "route-CHAINFLIP-0",
"sourceAddress": "bc1qsource...",
"destinationAddress": "0xdestination...",
"chainflipMeta": {
"sourceChain": "Bitcoin"
}
}'{
"depositAddress": "bc1qdeposit...",
"channelId": "210-Bitcoin-12345",
"depositChannelId": "12345",
"provider": "CHAINFLIP"
}Start swap
Builds or starts a swap execution from the selected route, source address, destination address, amount, slippage, and provider preferences.
Body
Request
routeIdstringrequiredroute-CHAINFLIP-0sourceAddressstringrequiredbc1qsource...destinationAddressstringrequired0xdestination...sellAssetstringrequiredBTC.BTCbuyAssetstringrequiredETH.USDC-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48sellAmountstringrequired0.01slippageintegerrequired1includeRoutebooleanrequiredtrueResponses
application/jsonThe request completed successfully.
Response
swapIdstringrequiredswap_01j...depositAddressstringrequiredbc1qdeposit...statusstringrequiredwaiting_depositrouteIdstringrequiredroute-CHAINFLIP-0/api/v1/swapcurl -X POST "https://www.makeswap.io/api/v1/swap" \
-H "Content-Type: application/json" \
-H "x-makeswap-integration-token: MAKESWAP_INTEGRATION_TOKEN" \
-H "x-makeswap-session-id: ms_session_123" \
-d '{
"routeId": "route-CHAINFLIP-0",
"sourceAddress": "bc1qsource...",
"destinationAddress": "0xdestination...",
"sellAsset": "BTC.BTC",
"buyAsset": "ETH.USDC-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"sellAmount": "0.01",
"slippage": 1,
"includeRoute": true
}'{
"swapId": "swap_01j...",
"depositAddress": "bc1qdeposit...",
"status": "waiting_deposit",
"routeId": "route-CHAINFLIP-0"
}Track swap
Tracks swap progress by transaction hash and chain, deposit channel id, swap id, or deposit address. Responses normalize phases into deposit, swapping, sending, complete, and failed states.
Body
Request
hashstringrequired0xsource_tx_hashchainIdstringrequiredETHdepositChannelIdstringrequired12345depositAddressstringrequiredbc1qdeposit...Responses
application/jsonThe request completed successfully.
Response
trackingStatusstringrequiredswappingstatusstringrequiredpendinglegsarray Object[]required/api/v1/trackcurl -X POST "https://www.makeswap.io/api/v1/track" \
-H "Content-Type: application/json" \
-H "x-makeswap-integration-token: MAKESWAP_INTEGRATION_TOKEN" \
-H "x-makeswap-session-id: ms_session_123" \
-d '{
"hash": "0xsource_tx_hash",
"chainId": "ETH",
"depositChannelId": "12345",
"depositAddress": "bc1qdeposit..."
}'{
"trackingStatus": "swapping",
"status": "pending",
"legs": [
{
"type": "native_send",
"hash": "0xsource_tx_hash",
"status": "confirmed"
},
{
"type": "swap",
"trackingStatus": "swapping"
}
]
}Issue integration token
Exchanges a MakeSwap key ID and secret for a browser-safe integration token bound to an origin, optional affiliate address, affiliate fee, and branding.
Body
Request
originstringrequiredhttps://merchant.exampleaffiliateAddressstringrequired0xaffiliate...affiliateFeeBpsintegerrequired25brandingObjectrequiredResponses
application/jsonThe request completed successfully.
Response
tokenstringrequiredmsit_...expiresAtstringrequired2026-04-19T12:00:00.000Zoriginstringrequiredhttps://merchant.example/api/v1/integrations/tokencurl -X POST "https://www.makeswap.io/api/v1/integrations/token" \
-H "Content-Type: application/json" \
-H "x-makeswap-key-id: MAKESWAP_KEY_ID" \
-H "x-makeswap-key-secret: MAKESWAP_KEY_SECRET" \
-d '{
"origin": "https://merchant.example",
"affiliateAddress": "0xaffiliate...",
"affiliateFeeBps": 25,
"branding": {
"name": "Merchant Co",
"primaryColor": "#0f766e"
}
}'{
"token": "msit_...",
"expiresAt": "2026-04-19T12:00:00.000Z",
"origin": "https://merchant.example"
}SDK
Use @makeswap/sdk
The SDK wraps token discovery, quote, swap, tracking, and iframe lifecycle behavior while preserving the same HTTP routes shown above.
import { createMakeSwapClient } from "@makeswap/sdk";
const client = createMakeSwapClient({
baseUrl: "https://www.makeswap.io",
integrationToken: process.env.MAKESWAP_INTEGRATION_TOKEN,
});
const quote = await client.quote({
sellAsset: "BTC.BTC",
buyAsset: "ETH.ETH",
sellAmount: "0.01",
});