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

# POST /v1/loop/in

`POST /v1/loop/in`

## Request body

- LoopInRequest
  - `amount` integer, required — amount you wish to swap in to the channel (in satoshi).
  - `last_hop` string
  - `channel_id` 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.
    - string — both bolt-style triplet and lnd-compatible style concatenated.
  - `pair_id` string
  - `label` string, nullable — Additional label for this request.
  - `max_miner_fee` integer, nullable — Maximum on-chain fees that we are willing to spend. If we want to publish the on-chain htlc and the fee estimate turns out higher than this value, we cancel the swap. Default value depends on the asset type, (see NLoop.Server/Options/CryptoCodeParams.fs)
  - `max_swap_fee` integer, nullable — Maximum we are willing to pay the server for the swap (by diff of on/off-chain payment). If the server asks for a higher fee, we do not perform 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. Default number depends on the asset type, and a channel size. (see NLoop.Server/Options/CryptoCodeParams.fs)
  - `htlc_conf_target` integer, nullable — Confimation target for estimating the fee for HTLC tx (a.k.a. swaptx, lockuptx) If the server is not willing to accept zero-conf swap, Making this value smaller might make a swap fast. Default number depends on the asset type, (see NLoop.Server/Options/CryptoCodeParams.fs)

## Response `200`

OK

- LoopInResponse
  - `id` string — Swap identifier to track status.
  - `address` string

## Other responses

- `400` — invalid request

## Changes

- **2022-01-26** `b52777465fee` — 1 info
  - added `subschema #3` to the `channel_id/oneOf[#/components/schemas/ShortChannelId]/` request property `oneOf` list
- **2022-01-26** `2fa641145178` — 5 breaking, 5 info
  - removed `subschema #1, subschema #2` from the `channel_id` request property `oneOf` list
  - the `last_hop` request property type/format changed from `string`/`` to ``/``
  - the `pair_id` request property type/format changed from `string`/`` to ``/``
  - added `#/components/schemas/P2WSH` to the `address` response property `oneOf` list for the response status `200`
  - …6 more
- **2022-01-24** `2f51ef5daa6d` — 2 info
  - request property `channel_id` 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`
- **2022-01-19** `ebc31c9ff358` — 9 breaking, 1 warning, 2 info
  - the `last_hop` request property's minLength was increased from `0` to `33`
  - removed `#/components/schemas/PubKey` from the `last_hop` request property `oneOf` list
  - removed `#/components/schemas/ShortChannelId` from the `channel_id` request property `oneOf` list
  - removed `#/components/schemas/pairId` from the `pair_id` request property `oneOf` list
  - …8 more

[Change history](https://skmtc.dev/bitbankinc/apis/nloop-server-openapi-definition/changes/v1/loop/in/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/633782f04ad9/schema)
