Skip to content

Textile FX API

The API lets you integrate Textile FX swaps into your own product instead of using the web app. Quote a corridor, get back the exact unsigned transactions to run a swap, sign them with your own wallet, and broadcast them yourself.

It is non-custodial by design. The API never signs anything, never touches your keys, and never holds funds. Every write endpoint hands you either an unsigned transaction (to, data, value) or an EIP-712 payload to sign. Your wallet stays yours.

Base URL

https://api.textilecredit.com/v1

Everything lives under /v1. Local development runs at http://localhost:8911/v1.

What you can do

  • List corridors — the pairs you can trade and their live oracle rates (GET /v1/pools).
  • Inspect liquidity — list live funded offers and aggregate capacity for a pair (GET /v1/order-book).
  • Quote — a live, executable price for a sell amount against resting liquidity (GET /v1/quote).
  • Swap — build the unsigned approval + executeBatch transactions for an instant swap, then track it to settlement (POST /v1/swaps).
  • Limit orders — build the EIP-712 payload for a resting order, submit the signed order, and list your orders.
  • Webhooks — register an endpoint and get a signed callback when a swap settles.

The shape of a swap

GET  /v1/quote          → is there liquidity, and at what rate?
POST /v1/swaps          → returns { approval, swap } unsigned transactions
      you sign + broadcast both with your own wallet
POST /v1/swaps/{id}/submit  → tell us the tx hash so we can track it
      (optional) webhook fires when it settles on-chain
GET  /v1/swaps/{id}     → status + the reconciled fill

Conventions

  • Amounts are strings. Every token amount is in atomic units (no decimals) as a base-10 string, e.g. "1000000" for 1 USDT. Rates are RAY-scaled (1e27) strings. This keeps values lossless — JSON numbers can't hold a uint256.
  • Addresses are standard EVM addresses. Lowercase is fine; we normalize.
  • Timestamps are ISO-8601 UTC.
  • Every response carries an X-Request-Id header. Include it when you report an issue.

Get started

  1. Get a key from the Textile team (contact us). You'll get a test key and a live key.
  2. Read Authentication.
  3. Import the Postman collection or the OpenAPI spec and set api_key.
  4. Try GET /v1/pools, then GET /v1/quote.