LNPay Docs
Search…
Generate Invoice
The Generate Invoice endpoint is unique in that it returns an LnTx object vs a wtx object. The LnTx object in this case represents an unpaid invoice. To check the status of this - use the /lntx
post
https://api.lnpay.co/
v1/wallet/:wallet_key/invoice
PostWalletInvoice
To check if an invoice has been paid or not use the LnTx endpoint
cURL
Node.js
Python
JavaScript
1
curl -u sak_XXXXXXX: \
2
-H "Content-Type: application/json" \
3
-X POST \
4
-d '{"num_satoshis":5, "memo":"Test invoice from the docs","passThru":" {\"ticketId\":\"556\"} "}' \
5
https://api.lnpay.co/v1/wallet/wal_XXXX/invoice
Copied!
1
const lnpay = LNPay({
2
secretKey: 'sak_XXXXX',
3
walletAccessKey: 'wal_XXXXX',
4
});
5
6
const invoice = await lnpay.generateInvoice({
7
num_satoshis: 100,
8
passTru: {
9
order_id: '100',
10
},
11
description_hash: 'MTIzNDY1Nzg5N...',
12
memo: 'Invoice memo.',
13
expiry: 86400, // 1 day
14
});
Copied!
1
lnpay_py.initialize('sak_XXXXXXX')
2
from lnpay_py.wallet import LNPayWallet
3
4
my_wallet = LNPayWallet('wal_XXXXX')
5
invoice_params = {
6
'num_satoshis': 2,
7
'memo': 'Tester'
8
}
9
invoice = my_wallet.create_invoice(invoice_params)
Copied!
1
LNPay.Initialize('pak_XXXXXXX');
2
3
let myWallet = new LNPayWallet('waki_XXXXXX');
4
let invoiceParams = {"num_satoshis":2,"memo":"Tester"};
5
myWallet.createInvoice(invoiceParams,
6
function(result) {
7
console.log(result);
8
}
9
);
Copied!
See the Access Keys section on how to define wallet_key
Last modified 3mo ago
Copy link