Developer reference

API Docs

Gridex provides a streamlined exchange API for creating swaps, tracking order status, and managing the full transaction lifecycle in a privacy-focused environment. All operations are designed to minimize data exposure while maintaining reliable execution and clear status visibility across exchanges, including high-value transactions processed through internal settlement logic.

Overview

Use the API to quote a pair, create an exchange order, then poll the transaction endpoint until the order reaches a terminal state.

Content-Type: application/json

Exchange endpoint

Create a swap by sending the source asset, target asset, amount, and payout address.

POST /api/exchange

{
  "fromCurrency": "btc",
  "toCurrency": "xmr",
  "fromAmount": 1,
  "payoutAddress": "84j7...xmr"
}
200 OK

{
  "orderId": "0f7d6d1a-2e1d-4dd2-b0df-7a4a8a902999",
  "routing": "gridex",
  "depositAddress": "bc1q...internal",
  "expectedReceiveAmount": 312.4821,
  "status": "waiting"
}

Order creation flow

  1. Validate the selected currency pair and the entered amount to ensure they are supported and within allowed limits.
  2. Fetch the current market pricing for the source and target assets.
  3. Convert the entered amount into its USD equivalent using the live rate.
  4. Process the exchange order based on the internal routing logic.

Status tracking endpoints

Clients should poll the order endpoint every 10–15 seconds while the order is active.

GET /api/orders/{orderId}

{
  "orderId": "0f7d6d1a-2e1d-4dd2-b0df-7a4a8a902999",
  "routing": "api",
  "providerStatus": "exchanging",
  "displayStatus": "exchanging",
  "steps": ["waiting", "confirming", "exchanging", "sending", "finished"]
}

Authentication notes

Public exchange creation and order tracking use rate limits and payload validation. Admin operations require a signed-in admin session and server-side role verification.

Error codes

400Invalid request payload, unsupported currency pair, or amount outside supported bounds.
401Authentication is required for protected operational endpoints.
404Order or transaction ID was not found.
409Order state does not allow the requested operation.
429Too many requests. Retry after the rate-limit window.
500Upstream provider or internal routing service is temporarily unavailable.