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

# Swap Quickstart

> Crypto-to-crypto on the same network — quote, deposit, and payout.

Exchange one crypto currency for another on the **same network**. Both quote legs use `currency` + `network`; order type is inferred automatically.

<Warning>
  `from.network` and `to.network` must match. Cross-chain swaps are not supported.
</Warning>

## Prerequisites

* KYB-approved partner account with `sk_*` and `enc_*` keys
* Destination wallet address on the target network
* [HMAC signing](/getting-started/authentication) on all write requests

<Note>
  End-user KYC is **not** required for swap. It is required for [onramp](/quickstarts/onramp) and [offramp](/quickstarts/offramp).
</Note>

## End-to-end flow

<Steps>
  <Step title="Create a quote">
    Reserve a rate between two currencies on the same network.
  </Step>

  <Step title="Create the order">
    Pass `quote_id` and `recipient.address` (where swapped tokens are delivered).
  </Step>

  <Step title="Collect source crypto">
    Customer sends the source currency to the `payin` deposit address.
  </Step>

  <Step title="Wait for payment confirmation">
    Liquidramp auto-detects the deposit. Optionally submit `tx_hash` via fulfill if confirmation is delayed.
  </Step>

  <Step title="Receive payout">
    Destination currency arrives at `recipient.address`; track via order or webhooks.
  </Step>
</Steps>

```mermaid theme={null}
sequenceDiagram
    participant App as Your App
    participant API as Liquidramp API
    participant User as Customer

    App->>API: POST /v1/orders/quote
    API-->>App: quote_id (USDT → USDC)
    App->>API: POST /v1/orders
    API-->>App: order + payin (deposit address)
    User->>API: Send USDT on BSC
    opt Delayed confirmation
        App->>API: POST /v1/orders/:ref/fulfill (tx_hash)
    end
    API-->>App: webhook order.asset_locked
    API-->>App: webhook order.settled
```

## 1. Create a quote

```bash theme={null}
curl -X POST "$BASE_URL/orders/quote" \
  -H "Content-Type: application/json" \
  -H "liquidramp-client-id: $CLIENT_ID" \
  -H "Authorization: Bearer $SECRET_KEY" \
  -H "liquidramp-timestamp: $TIMESTAMP" \
  -H "liquidramp-signature: $SIGNATURE" \
  -d '{
  "from": { "currency": "USDT", "network": "BSC", "amount": 50 },
  "to": { "currency": "USDC", "network": "BSC" },
  "partner_fee": 0
}'
```

## 2. Create the order

```bash theme={null}
curl -X POST "$BASE_URL/orders" \
  -H "Content-Type: application/json" \
  -H "liquidramp-client-id: $CLIENT_ID" \
  -H "Authorization: Bearer $SECRET_KEY" \
  -H "liquidramp-timestamp: $TIMESTAMP" \
  -H "liquidramp-signature: $SIGNATURE" \
  -d '{
  "quote_id": "QUOTE_ID_FROM_STEP_1",
  "recipient": { "address": "0x34DF48981ce4d1899a2b1139CC0fDDb6951C4053" },
  "customer": {
    "reference": "cust-001",
    "name": "Jane Doe",
    "email": "jane@example.com"
  }
}'
```

Swap orders require `recipient.address` but not bank details. `merchant_reference` is optional. There is no wallet-management API — you own key management on your side. Validate that the address matches `to.network`; sending to the wrong chain is irreversible.

The response `payin` object is the source-currency deposit:

```json theme={null}
"payin": {
  "asset": "USDT",
  "address": "0xDepositAddress...",
  "network": "BSC",
  "amount": 50,
  "expires_at": "2026-06-27T13:00:00.000Z",
  "paid_at": null
}
```

## 3. Confirm pay-in (optional)

Liquidramp auto-detects the source-currency deposit. Call fulfill only if confirmation is delayed:

```bash theme={null}
curl -X POST "$BASE_URL/orders/ORD-REFERENCE/fulfill" \
  -H "Content-Type: application/json" \
  -H "liquidramp-client-id: $CLIENT_ID" \
  -H "Authorization: Bearer $SECRET_KEY" \
  -H "liquidramp-timestamp: $TIMESTAMP" \
  -H "liquidramp-signature: $SIGNATURE" \
  -d '{
  "tx_hash": "0xabc123def456789"
}'
```

## 4. Check payout

Request `?include=payout` for destination delivery details (`asset`, `address`, `network`, `amount`, `tx_hash`, `paid_at`).

```bash theme={null}
curl -X GET "$BASE_URL/orders/ORD-REFERENCE?include=payout,timeline" \
  -H "liquidramp-client-id: $CLIENT_ID" \
  -H "Authorization: Bearer $SECRET_KEY" \
  -H "liquidramp-timestamp: $TIMESTAMP" \
  -H "liquidramp-signature: $SIGNATURE"
```

## Related

| Endpoint                                                      | Method | Purpose                                          |
| ------------------------------------------------------------- | ------ | ------------------------------------------------ |
| [`/orders/quote`](/api-reference/create-quote)                | POST   | Reserve swap rate                                |
| [`/orders`](/api-reference/create-order)                      | POST   | Create swap order                                |
| [`/orders/{reference}/fulfill`](/api-reference/fulfill-order) | POST   | Optional pay-in proof if confirmation is delayed |
| [`/orders/{reference}`](/api-reference/get-order)             | GET    | Status + payout                                  |

* [Exchange rates](/concepts/exchange-rates)
* [Escrow](/concepts/escrow)
