Skip to main content
Use the LightSwap API from your backend when you want to create swaps inside your own product experience. This page is the best place to start if you are the engineer responsible for the integration.

Base URL

https://lightswap.me/api/partner/v1

How to get access

Email the LightSwap partner team to request API access or discuss your rollout. Share:
  • your product and company
  • the integration you want to launch
  • the pairs or networks you expect to support first
  • your target rollout timeline

Email partner team

1

Load assets

Use GET /asset to build your pair selector and confirm canonical lowercase network values, decimals, and memo requirements.
2

Validate the destination address

Use POST /address before creating a quote so the user can correct address mistakes early.
3

Create a quote

Use POST /quote with the send asset, receive asset, and exact send amount.
4

Create the swap

Use POST /swap with the quote ID and destination address.
5

Poll status

Use GET /swap/{id} until the swap reaches a terminal status.

First requests

Set your key on your backend:
export LIGHTSWAP_PARTNER_KEY="lsk_live_..."
List assets:
curl "https://lightswap.me/api/partner/v1/asset?network=tron&symbol=USDT" \
  -H "x-api-key: $LIGHTSWAP_PARTNER_KEY"
Validate the destination address:
curl -X POST "https://lightswap.me/api/partner/v1/address" \
  -H "content-type: application/json" \
  -H "x-api-key: $LIGHTSWAP_PARTNER_KEY" \
  -d '{
    "network": "tron",
    "token": "USDT",
    "address": "TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r",
    "memo": null
  }'
Create a quote:
curl -X POST "https://lightswap.me/api/partner/v1/quote" \
  -H "content-type: application/json" \
  -H "x-api-key: $LIGHTSWAP_PARTNER_KEY" \
  -d '{
    "from": {
      "network": "bitcoin",
      "token": "BTC",
      "amount": "0.01"
    },
    "to": {
      "network": "tron",
      "token": "USDT"
    },
    "customerId": "u_123",
    "externalId": "partner-order-123"
  }'
Create the swap:
curl -X POST "https://lightswap.me/api/partner/v1/swap" \
  -H "content-type: application/json" \
  -H "x-api-key: $LIGHTSWAP_PARTNER_KEY" \
  -d '{
    "quoteId": "pq_aaaaaaaaaaaaaaaaaaaaaaaa",
    "destination": {
      "address": "TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r",
      "memo": null
    },
    "notificationEmail": "optional@example.com"
  }'
Poll status:
curl "https://lightswap.me/api/partner/v1/swap/AB12CD34EF56" \
  -H "x-api-key: $LIGHTSWAP_PARTNER_KEY"
Use the exact lowercase network values returned by GET /asset. The Partner API rejects mixed-case network names.

Where to go next

Authentication

Review API keys, externalId, customerId, and rate limits.

Integration flow

See the recommended quote-to-swap flow in more detail.

Statuses and errors

Handle terminal states, retry behavior, and troubleshooting.

API Reference

Review request fields, response fields, and endpoint examples.