Swap API • Quick Start

Use provider-backed swaps with normalized quotes and webhook-driven status. No direct blockchain calls required.

Quotes
POST /quotes → normalized provider quotes with LZD utility.
Swaps
POST /swaps, GET /swaps/:id + provider webhooks.
SplitShield
Sequential legs (plan/execute/status). Coming next.

Authentication

Client → API: Bearer or API Key • Webhooks: HMAC

Client Request Headers

Authorization: Bearer <token>
Idempotency-Key: 8b6e7b4c-...
X-Request-Id: req_123

Provider Webhook Headers

X-Provider: ChangeNow
X-Provider-Signature: sha256=<hmac>

1) Get Quotes

Aggregate offers from providers. LZD fee utility applied at aggregation time.

Request

POST /v1/quotes
{
  "asset_in": "USD",
  "network_in": "fiat",
  "asset_out": "USDT",
  "network_out": "tron",
  "amount": "5000.00",
  "rate_type": "fixed",
  "coverage": false,
  "preferences": {
    "max_slippage_bps": 50,
    "providers_allow": ["ChangeNow","Exolix"],
    "providers_deny": []
  }
}

Response

200 OK
{
  "quotes": [
    {
      "quoteId": "q_123",
      "provider": "ChangeNow",
      "rate_type": "fixed",
      "expires_at": "2025-10-16T12:34:56Z",
      "amount_in": "5000.00",
      "amount_out_est": "4980.50",
      "fees": {
        "provider_fee": "10.00",
        "platform_fee": "7.50",
        "coverage_fee": "0.00",
        "lzd_discount_applied": true
      },
      "notes": []
    }
  ]
}

2) Create Swap

Create a swap from a chosen quote; deposit address comes from the provider.

Request

POST /v1/swaps
{
  "quoteId": "q_123",
  "destination": {
    "withdraw_to": "user_wallet",
    "address": "TV...tron...address"
  },
  "metadata": {"client_ref": "order-789"}
}

Response

201 Created
{
  "swapId": "s_123",
  "provider": "ChangeNow",
  "providerRef": "chg_abc",
  "deposit": {
    "address": "provider-deposit-address",
    "memo": "optional",
    "expires_at": "2025-10-16T12:45:00Z"
  },
  "state": "pending"
}

3) Webhooks & Status

Use webhooks for status; poll as fallback.

Provider → Lizard (Webhook)

POST /v1/webhooks/provider
{
  "providerRef":"chg_abc",
  "event":"SWAP_UPDATED",
  "status":"COMPLETED",
  "amounts":{"in":"1000.00","out":"996.10"},
  "timestamp":"2025-10-16T12:20:00Z"
}

Get Status

GET /v1/swaps/s_123
{
  "swapId":"s_123",
  "state":"executing",
  "provider":"ChangeNow",
  "providerRef":"chg_abc",
  "amounts":{"in_received":"1000.00","out_delivered":"996.10"},
  "events":[{"ts":"2025-10-16T12:00:01Z","type":"DEPOSIT_SEEN"}]
}

Next up: SplitShield (sequential legs) • Back to Home