Skip to main content
POST
/
api
/
v1
/
lsps1
/
create_order
Create Order
curl --request POST \
  --url https://api.staging.kaleidoswap.com/api/v1/lsps1/create_order \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "client_pubkey": "<string>",
  "lsp_balance_sat": 1,
  "client_balance_sat": 1,
  "required_channel_confirmations": 1,
  "funding_confirms_within_blocks": 2,
  "channel_expiry_blocks": 2,
  "token": "<string>",
  "refund_onchain_address": "<string>",
  "announce_channel": true,
  "asset_id": "<string>",
  "lsp_asset_amount": 123,
  "client_asset_amount": 123,
  "rfq_id": "<string>",
  "email": "<string>"
}
'
{
  "order_id": "<string>",
  "client_pubkey": "<string>",
  "lsp_balance_sat": 123,
  "client_balance_sat": 123,
  "required_channel_confirmations": 123,
  "funding_confirms_within_blocks": 123,
  "channel_expiry_blocks": 123,
  "announce_channel": true,
  "order_state": "CREATED",
  "payment": {
    "bolt11": {
      "state": "EXPECT_PAYMENT",
      "expires_at": "2023-11-07T05:31:56Z",
      "fee_total_sat": 123,
      "order_total_sat": 123,
      "invoice": "<string>"
    },
    "onchain": {
      "state": "EXPECT_PAYMENT",
      "expires_at": "2023-11-07T05:31:56Z",
      "fee_total_sat": 123,
      "order_total_sat": 123,
      "address": "<string>",
      "min_fee_for_0conf": 123,
      "min_onchain_payment_confirmations": 123,
      "refund_onchain_address": "<string>",
      "payment_status": "<string>",
      "payment_difference": 123,
      "last_payment_check": 123
    }
  },
  "token": "",
  "created_at": "2023-11-07T05:31:56Z",
  "channel": {
    "channel_id": "<string>",
    "temporary_channel_id": "<string>",
    "funded_at": "2023-11-07T05:31:56Z",
    "funding_outpoint": "<string>",
    "expires_at": "2023-11-07T05:31:56Z"
  },
  "asset_id": "<string>",
  "lsp_asset_amount": 123,
  "client_asset_amount": 123,
  "rfq_id": "<string>",
  "asset_price_sat": 123,
  "asset_delivery_status": "NOT_REQUIRED",
  "asset_delivery_payment_hash": "<string>",
  "asset_delivery_completed_at": "2023-11-07T05:31:56Z",
  "asset_delivery_error": "<string>"
}

Prerequisites

  • Valid client public key
  • Sufficient balance for channel fees
  • Optional: RFQ ID if purchasing assets
Ensure you have a refund address if paying onchain to avoid lost funds in case of errors.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
client_pubkey
string
required
lsp_balance_sat
integer
required
Required range: x >= 0
client_balance_sat
integer
required
Required range: x >= 0
required_channel_confirmations
integer
required
Required range: x >= 0
funding_confirms_within_blocks
integer
required
Required range: x >= 1
channel_expiry_blocks
integer
required
Required range: x >= 1
token
string | null
refund_onchain_address
string | null
announce_channel
boolean
default:true
asset_id
string | null
lsp_asset_amount
integer | null
client_asset_amount
integer | null
rfq_id
string | null
email
string | null

Optional email for notifications

Response

Successful Response

order_id
string
required
client_pubkey
string
required
lsp_balance_sat
integer
required
client_balance_sat
integer
required
required_channel_confirmations
integer
required
funding_confirms_within_blocks
integer
required
channel_expiry_blocks
integer
required
announce_channel
boolean
required
order_state
enum<string>
required
Available options:
CREATED,
CHANNEL_OPENING,
COMPLETED,
FAILED,
PENDING_RATE_DECISION
payment
PaymentDetails · object
required
token
string | null
default:""
created_at
string<date-time>
channel
ChannelDetails · object
asset_id
string | null
lsp_asset_amount
integer | null
client_asset_amount
integer | null
rfq_id
string | null
asset_price_sat
integer | null
asset_delivery_status
enum<string> | null

Status of asset delivery via keysend after channel opening

Available options:
NOT_REQUIRED,
PENDING,
IN_PROGRESS,
COMPLETED,
FAILED,
RATE_CHANGED
asset_delivery_payment_hash
string | null
asset_delivery_completed_at
string<date-time> | null
asset_delivery_error
string | null