LNPay Docs
Search…
Pay Invoice
Generate an LN invoice from the specified wallet
post
https://api.lnpay.co/
v1/wallet/:wallet_key/withdraw
PostWalletSend
FAILURE_REASON_NO_ROUTE is a common error that means one of two things
    There is no route because the fee_limit_msat is too low or the default 5% is too low (this is usually the issue)
    There is no route because the lightning node cannot find a path (sometimes this happens with private nodes, or new nodes)
Check the QueryRoutes endpoint for help in determining what the issue is.
cURL
Node.js
Python
JavaScript
1
curl -u sak_XXXXXXX: \
2
-H "Content-Type: application/json" \
3
-X POST \
4
-d '{"payment_request":"lnbc50n1p0qjf84p..."}' \
5
https://api.lnpay.co/v1/wallet/wal_XXXXX/withdraw
Copied!
1
const lnpay = LNPay({
2
secretKey: 'sak_XXXXX',
3
walletAccessKey: 'wal_XXXXX',
4
});
5
6
const payInvoice = await lnpay.payInvoice({
7
payment_request: 'lnbc50n1p0qjf84p...',
8
passTru: {
9
order_id: '100',
10
},
11
});
Copied!
1
lnpay_py.initialize('sak_XXXXXXX')
2
from lnpay_py.wallet import LNPayWallet
3
4
my_wallet = LNPayWallet('wal_XXXXXXX')
5
invoice_params = {
6
'payment_request': 'lnbc....'
7
}
8
pay_result = my_wallet.pay_invoice(invoice_params)
9
print(pay_result)
Copied!
1
LNPay.Initialize('pak_XXXXXXX');
2
3
let myWallet = new LNPayWallet('waka_XXXXXXX');
4
let invoiceParams = {"payment_request":"lnbc1111..."};
5
myWallet.payInvoice(invoiceParams,
6
function(result) {
7
console.log(result);
8
}
9
);
Copied!
The Content-Type: application/json header is required for all POST request with a JSON body!
Last modified 3mo ago
Copy link