---
title: "POST /v1/loop/out"
method: POST
path: "/v1/loop/out"
tags: ["loop"]
---

# POST /v1/loop/out

`POST /v1/loop/out`

## Request body

- LoopOutRequest
  - `channel_id` ShortChannelId[], nullable — < ShortChannelId for the one you want to get inbound liquidity. default is the one it has least.
    - union
      - string — pointer to the funding outpoint. i.e. triplet of 1. block height, 2. tx index number in the block. 3. tx out index Of the funding tx of the channel.
      - integer — uint64 representation used in LND.
  - `pair_id` string — Pair of cryptoCode
  - `address` union
    - string
    - string
  - `amount` integer, required — < amount in satoshi.
  - `swap_tx_conf_requirement` integer, nullable — < The number of confirmation of the swaptx (htlc tx) before we make an off-chain offer. a.k.a. `htlc_confirmations` on lightning loop. Default number depends on the asset type.
  - `label` string, nullable — < Additional label for this request.
  - `max_swap_routing_fee` integer, nullable — < Maximum off-chain fee in sat that may be paied for swap payment to the server. This limit is applied during path finding.
  - `max_prepay_routing_fee` integer, nullable — < Maximum off-chain fee in sat that may be paid for the prepay to the server. This limit is applied during path finding.
  - `max_swap_fee` integer, nullable — < Maximum we are willing to pay the server for the swap. This value is not disclosed in the swap initiation call, but if the server asks for a higher fee, we abort the swap. For multi-asset swap, the unit of this value is off-chain currency. We use a rate information from external exchanges to calculate the value.
  - `max_prepay_amount` integer, nullable — < Maximum amount of the (loop-out) swap fee that may be charged as a prepayment
  - `max_miner_fee` integer, nullable — < Maximum on-chain fees that we are willing to spend. If we want to sweep the on-chain htlc and the fee estimate turns out higher than this value, we cancel the swap. If the fee estimate is lower, we publish the sweep tx. If the sweep tx is not confirmed, we are forced to ratchet up fees until it is swept. Possibly even exceeding max_miner_fee if we get close to the HTLC timeout. Because the initial publication revealed the preimage, we have no other choice. The server may already have pulled the off-chain HTLC. Only when the fee becomes higher than the swap amount, we can wait for fees to come down and hope -- if we are past the timeout -- that the server is not publishing the revocation.
  - `sweep_conf_target` integer, nullable — < Confimation target for sweeping the HTLC (a.k.a. swaptx, lockuptx)

## Response `200`

OK

- LoopOutResponse
  - `id` unknown
  - `address` union
    - string
    - string
  - `claim_tx_id` unknown

## Other responses

- `400` — invalid request

## Changes

- **2022-01-24** `2f51ef5daa6d` — 2 info
  - request property `channel_id/items/` list-of-types was widened by adding types `integer` to media type `application/json`
  - removed the pattern `(\d{3})x(\d{3})x(\d{2})` from the request property `channel_id/items/`
- **2022-01-19** `ebc31c9ff358` — 4 breaking, 1 warning, 3 info
  - removed `#/components/schemas/BitcoinAddressNonMalleable` from the `address` request property `oneOf` list
  - removed `#/components/schemas/pairId` from the `pair_id` request property `oneOf` list
  - the `pair_id` request property type/format changed from ``/`` to `string`/``
  - added `#/components/schemas/P2WSH, #/components/schemas/P2WPKH` to the `address` response property `oneOf` list for the response status `200`
  - …4 more

[Change history](https://skmtc.dev/bitbankinc/apis/nloop-server-openapi-definition/changes/v1/loop/out/post.md)

---

[API](https://skmtc.dev/bitbankinc/apis/nloop-server-openapi-definition.md) · [All operations](https://skmtc.dev/bitbankinc/apis/nloop-server-openapi-definition/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/bitbankinc/nloop-server-openapi-definition/revisions/2f51ef5daa6d/schema)
