LNPay Docs
Search…
⌃K

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
curl -u sak_XXXXXXX: \
-H "Content-Type: application/json" \
-X POST \
-d '{"num_satoshis":5, "memo":"Test invoice from the docs","passThru":" {\"ticketId\":\"556\"} "}' \
https://api.lnpay.co/v1/wallet/wal_XXXX/invoice
const lnpay = LNPay({
secretKey: 'sak_XXXXX',
walletAccessKey: 'wal_XXXXX',
});
const invoice = await lnpay.generateInvoice({
num_satoshis: 100,
passTru: {
order_id: '100',
},
description_hash: 'MTIzNDY1Nzg5N...',
memo: 'Invoice memo.',
expiry: 86400, // 1 day
});
lnpay_py.initialize('sak_XXXXXXX')
from lnpay_py.wallet import LNPayWallet
my_wallet = LNPayWallet('wal_XXXXX')
invoice_params = {
'num_satoshis': 2,
'memo': 'Tester'
}
invoice = my_wallet.create_invoice(invoice_params)
LNPay.Initialize('pak_XXXXXXX');
let myWallet = new LNPayWallet('waki_XXXXXX');
let invoiceParams = {"num_satoshis":2,"memo":"Tester"};
myWallet.createInvoice(invoiceParams,
function(result) {
console.log(result);
}
);
See the Access Keys section on how to define wallet_key