Skip to Content
developersOverview

Developers

The 7.Exchange swap API is live in production. Discover assets and providers, request routes, lock and execute a quote, and track the result — all through one public REST API.

Base URL
https://api.7.exchange/api/v1

No API key required. Public swap integration endpoints are open. See affiliate attribution.

Make your first call

This works right now, with no setup:

curl -s "https://api.7.exchange/api/v1/swap/chains?query=ethereum"
200 OK
{ "data": [ { "key": "ethereum", "name": "Ethereum", "shortname": "ETH", "chainId": 1, "type": "EVM", "active": true } ], "pagination": { "page": 1, "perPage": 100, "total": 1, "hasMore": false } }

That key is what you’ll pass as srcChain and dstChain everywhere else.

How an integration works

Discover

Fetch chains and assets once and cache them. Use the chain key and asset address from these responses as your identifiers — don’t hardcode them.

Quote

POST /quote returns every available route for a pair and amount. Each route names its provider and carries a routeId. An empty data array means no route exists — it’s a 200, not an error.

Lock

POST /quote/lock reserves one selected route and returns a short-lived lockId. Locks expire; drive your UI from ttlMs.

Execute

POST /quote/execute takes only the lockId — everything else comes from the server-side lock record. You get back a public transaction.id, and for client-side routes an exec payload describing the wallet call to make.

Track and poll

If your client performed the wallet call, report the resulting hash to POST /transaction/track. Then poll GET /transaction/status until final is true.

Full details, including the four execution modes and the tracking rules, are in the API reference.

Endpoint index

Discovery

MethodEndpointPurpose
GET/swap/chainsSupported chains
GET/swap/assetsSupported assets
GET/swap/sourcesActive routing providers

Quote and execution

MethodEndpointPurpose
POST/quoteAvailable routes for a pair and amount
POST/quote/lockReserve a route, get a lockId
POST/quote/executeExecute the locked quote

Transactions

MethodEndpointPurpose
GET/transaction/statusCurrent status; poll until final
POST/transaction/trackReport a wallet or deposit hash
GET/transaction/historyPublic transaction history

Affiliate attribution

There’s no API key, so swaps are attributed by referral code instead.

Create an account

Sign up or sign in to 7.Exchange in the webapp.

Complete the affiliate flow

Open the affiliate dashboard .

Copy your referral code

Create or copy a referral code.

Send it with lock and execute

Pass it as referralCode in POST /quote/lock and POST /quote/execute. If omitted on execute, the code stored on the lock is used.

See the referral program for payout terms.

Before you go to production

  • Tolerate unknown fields. New response fields and enum values can appear within v1 without a version bump.
  • Branch on error.code, not error.message. Messages are human-facing and change.
  • Don’t hardcode provider names. The routing set changes as providers are added, paused, and removed.
  • Respect Retry-After on 429 rather than retrying on a fixed interval.
  • Keep X-Request-Id. It’s on every response, and it’s the first thing we’ll ask for.

Coming later

The SDK and embeddable widget are in development and not yet available. The REST API is the supported integration path today — announcements ship in #dev-announcements  when that changes.

Get help

Breaking changes are announced in #dev-announcements before they ship. If you’re running an integration in production, subscribe — it’s the only place changes are communicated ahead of the changelog.

Last updated on