> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lightswap.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Use the LightSwap Direct API from your backend to quote, create, and track swaps inside your product experience.

Use the LightSwap API from your backend when you want to create swaps inside your own product experience.

Start here if you are the engineer responsible for the integration.

## Base URL

```text theme={null}
https://lightswap.me/api/partner/v1
```

## How to get access

[Email us](mailto:partner@laptev-fzco.com?subject=LightSwap%20Direct%20API%20access) 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

<Card title="Contact Us" href="mailto:partner@laptev-fzco.com?subject=LightSwap%20Direct%20API%20access">
  [partner@laptev-fzco.com](mailto:partner@laptev-fzco.com)
</Card>

## Recommended integration flow

<Steps>
  <Step title="Load assets">
    Use `GET /asset` to build your pair selector and confirm canonical lowercase network values, decimals, and memo requirements.
  </Step>

  <Step title="Validate the destination address">
    Use `POST /address` before creating a quote so the user can correct address mistakes early.
  </Step>

  <Step title="Create a quote">
    Use `POST /quote` with the send asset, receive asset, and exact send amount.
  </Step>

  <Step title="Create the swap">
    Use `POST /swap` with the quote ID and destination address.
  </Step>

  <Step title="Poll status">
    Use `GET /swap/{id}` until the swap reaches a terminal status.
  </Step>
</Steps>

## First requests

Set your key on your backend:

```bash theme={null}
export LIGHTSWAP_API_KEY="lsk_live_..."
```

List assets:

```bash theme={null}
curl "https://lightswap.me/api/partner/v1/asset?network=tron&symbol=USDT" \
  -H "x-api-key: $LIGHTSWAP_API_KEY"
```

Validate the destination address:

```bash theme={null}
curl -X POST "https://lightswap.me/api/partner/v1/address" \
  -H "content-type: application/json" \
  -H "x-api-key: $LIGHTSWAP_API_KEY" \
  -d '{
    "network": "tron",
    "token": "USDT",
    "address": "TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r",
    "memo": null
  }'
```

Create a quote:

```bash theme={null}
curl -X POST "https://lightswap.me/api/partner/v1/quote" \
  -H "content-type: application/json" \
  -H "x-api-key: $LIGHTSWAP_API_KEY" \
  -d '{
    "from": {
      "network": "bitcoin",
      "token": "BTC",
      "amount": "0.01"
    },
    "to": {
      "network": "tron",
      "token": "USDT"
    },
    "customerId": "u_123",
    "externalId": "order-123"
  }'
```

Create the swap:

```bash theme={null}
curl -X POST "https://lightswap.me/api/partner/v1/swap" \
  -H "content-type: application/json" \
  -H "x-api-key: $LIGHTSWAP_API_KEY" \
  -d '{
    "quoteId": "pq_aaaaaaaaaaaaaaaaaaaaaaaa",
    "destination": {
      "address": "TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r",
      "memo": null
    },
    "notificationEmail": "optional@example.com"
  }'
```

Poll status:

```bash theme={null}
curl "https://lightswap.me/api/partner/v1/swap/AB12CD34EF56" \
  -H "x-api-key: $LIGHTSWAP_API_KEY"
```

Use the exact lowercase `network` values returned by `GET /asset`. The API rejects mixed-case network names.

## Where to go next

<CardGroup cols={2}>
  <Card title="Authentication" icon="shield-check" href="/integrations/direct-api/authentication">
    Review API keys, `externalId`, `customerId`, and rate limits.
  </Card>

  <Card title="Integration flow" icon="plug" href="/integrations/direct-api/integration-flow">
    See the recommended quote-to-swap flow in more detail.
  </Card>

  <Card title="Statuses and errors" icon="circle-check" href="/integrations/direct-api/statuses-errors">
    Handle terminal states, retry behavior, and troubleshooting.
  </Card>

  <Card title="API Reference" icon="brackets-curly" href="/api-reference/introduction">
    Review request fields, response fields, and endpoint examples.
  </Card>
</CardGroup>
