Withdrawals

Withdraw Lightning

POST/account/withdraw/lightningPrivate

Initiates a new Lightning withdrawal. The maxFees amount will be reserved from your balance to pay the routing fees. Any remains from this reserve will be available in your balance after the withdrawal is completed. Withdrawals at or above the Travel Rule threshold are rejected with a 403 TRAVEL_RULE_REQUIRED error and must be completed in the LN Markets app, where the required transfer information can be provided.

Permissions: account:withdrawals:write

Request Body

application/json
  1. body
invoice*string

Lightning invoice. The invoice's amount must be between 1 and 10,000,000 sats.

Response Body

OK

application/json
  1. response
id*string

Unique identifier for the withdrawal

paymentHash*string

Payment hash of the withdrawal

amount*number

Amount of the withdrawal

maxFees*number

Maximum fees of the withdrawal

import { createHttpClient } from '@ln-markets/sdk/rest/v3'const client = createHttpClient({  key: 'your-key',  secret: 'your-secret',  passphrase: 'your-passphrase',})const result = await client.account.withdrawLightning({  invoice: 'lnbc13370n1pjufy72pp5eyxlltyeyzhvppmzqvy2np7d44xq3vpmgqj90cysznsuxzncn6vqdqqcqzzsxqyz5vqsp59auvwgxtl873ptdyv08x7vqz0hyq3ddx893ejr26zvyz4za7c3hq9qyyssq89j8u6vd84z4u7tn9azrd49nfrg6nczvv03fh0u5sk0tlw9tv05zvxdm0ggmnyscwr8k2jj7cuj0f2yeqnfu7c05vpe2rhs8j4zryecpp59v2s'})
{  "id": "f8cc0da3-127b-4583-9b56-e2cc074db218",  "paymentHash": "c90dffac9920aec087620308a987cdad4c08b03b402457e09014e1c30a789e98",  "amount": 1337,  "maxFees": 2}