Withdrawals
Withdraw Lightning
POST
/account/withdraw/lightningPrivatePay a Lightning invoice from your balance. The maxFees amount (0.5% of the amount, at least 100 sats) is reserved from your balance to pay the routing fees; what is left of this reserve goes back to your balance once the withdrawal completes. 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
application/json- body
invoice*stringLightning invoice. The invoice's amount must be between 1,000 and 10,000,000 sats.
OK
application/json- response
id*stringUnique identifier for the withdrawal
paymentHash*stringPayment hash of the withdrawal
amount*numberAmount of the withdrawal
maxFees*numberMaximum 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
}