Appearance
API reference
v2 RFQ is the API. You ask for a size, makers answer, and you get one executable quote or a clear no-quote. It is what the public Swap page runs on, and it is where every new integration belongs.
v2 Ramp is the fiat side. It moves local currency into a stablecoin and back out (today NGN ↔ cNGN) through a licensed provider, from your own UI. Same claim-token model as RFQ, no key needed. Use it when the user is starting from a bank account rather than a wallet balance.
v1 is deprecated. It stays served so existing integrations keep working, but it is closed to new ones. No new features, no new endpoints. Do not start a project on it.
One exception worth knowing: webhook endpoints are registered on /v1/webhooks for both versions. That registry is shared, not legacy. See v2 webhooks.
| v2 RFQ | v1 (deprecated) | |
|---|---|---|
| Status | Current. Build here. | Closed to new integrations |
| Base URL | https://api.textilecredit.com/v2 | https://api.textilecredit.com/v1 |
| Liquidity | Firm quotes solicited from makers on demand | Resting limit orders |
| Price | Quoted for your exact size, held for 60 seconds | The price you named, until a maker takes it |
| Partial fills | None. Makers cover the whole amount or there is no quote | None. An order fills whole or not at all |
| Latency | One request that blocks while makers answer, sub-second | The order waits until it fills or expires |
| Exact-output | Native. Ask for a buyAmount | Via the amounts you named on the order |
Both are non-custodial. Neither version signs anything, touches your keys, or holds funds. Every write endpoint hands you an unsigned transaction or an EIP-712 payload. Your wallet stays yours.
Shared conventions
- Amounts are strings in atomic units, base-10, no decimals.
"1000000"is 1 USDT. Rates are RAY-scaled (1e27) strings. JSON numbers cannot hold a uint256 losslessly, so we do not use them. The one exception is the Ramp API, which is a fiat surface and takes human decimals:"50000"is fifty thousand naira. - Addresses are standard EVM addresses. Lowercase is fine, we normalize.
- Timestamps are ISO-8601 UTC.
- Every response carries an
X-Request-Idheader. Quote it when you report a problem. - Errors share one envelope and one set of codes. See v2 errors and v1 errors.
Machine-readable specs
- v2:
openapi-v2.json - v1, deprecated:
openapi.json, Postman collection
Both are generated from the same source the server runs, so they do not drift.
Getting a key
Create one yourself in the app. Connect your wallet, click your address in the top right, and pick API keys. Test keys work right away. Live keys need a short access request first. How to get an API key walks through it with screenshots. The same key works on both versions.
The two don't cover the same ground. The live key (tx_live_…) reaches every mainnet corridor. The test key (tx_test_…) works on two testnets only: BNB Smart Chain testnet (chainId: 97, cNGN ↔ USDT) and Base Sepolia (chainId: 84532, cNGN ↔ USDC). Those are the only testnets with settlement contracts deployed, so a test key pointed at any other chain comes back 400. Testnet has the faucets and setup.