LIGHTNING-WAITINVOICE(7)
π
LIGHTNING-WAITINVOICE(7) β the lightning-waitinvoice girlies' guide β¨
okay bestie so you found the lightning-waitinvoice manual page, and honestly? it's lowkey iconic. it's a page from the Core Lightning docs (that's the LIGHTNING part, iykyk) and it's section 7, which is the ~misc/commands~ section. anyway, let's get into it π«Ά
πΈ NAME πΈ
waitinvoice β the command for waiting for one specific payment to show up. like, you pick the invoice, and you just... sit there. patiently. main character energy fr π
β¨ SYNOPSIS β¨
waitinvoice label
that's it. that's the whole vibe. one label, one command, one wait π
π¦ DESCRIPTION π¦
the waitinvoice RPC command waits until a specific invoice gets paid, and then it hands you back that single entry, formatted exactly like it would come out of listinvoices. one entry, no scrolling, no drama. we love a focused queen π
labelβ one of the following. this is the unique label of the invoice you're waiting to see paid πΈ- (string)
- (integer)
so yeah, it takes a string or an integer, and that's the whole parameter list. not me expecting more, but honestly? simplicity ate. periodt π
π RETURN VALUE π
on success you get an object back, and it's giving full inventory. here's everything that can show up in it:
label(string) β the unique label you supplied at invoice creation. the name tag of your invoice π·οΈpayment_hash(hash) β the hash of thepayment_preimagethat will prove payment. it's the receipt-to-be, basically πstatus(string, one of"paid"or"expired") β whether the invoice is paid or expired. the ultimate vibe check πexpires_at(u64) β UNIX timestamp of when it will become / became unpayable. the deadline, bestie β°created_index(u64) β 1-based index indicating the order this invoice was created in. (added v23.08)description(string, optional) β the description used in the invoice πamount_msat(msat, optional) β the amount required to pay this invoice. the price tag π°bolt11(string, optional) β the BOLT11 string. always present unlessbolt12is π§Ύbolt12(string, optional) β the BOLT12 string. always present unlessbolt11is π§Ύupdated_index(u64, optional) β 1-based index indicating the order this invoice was changed. only present if it actually has changed since creation, so if it's missing, nothing's happened, no cap. (added v23.08)
and if status is "paid", you ALSO get this whole extra glow-up of fields:
pay_index(u64) β unique incrementing index for this payment π’amount_received_msat(msat) β the amount actually received. note that this could be slightly greater thanamount_msat, because clients may overpay (generous of them honestly, we stan an overpayer π«Ά)paid_at(u64) β UNIX timestamp of when it was paid πpayment_preimage(secret) β proof of payment. the crown jewel of this whole response πpaid_outpoint(object, optional) β the outpoint this invoice was paid with (added v23.11):txid(txid) β ID of the transaction that paid the invoice (added v23.11)outnum(u32) β the 0-based output number of the transaction that paid the invoice (added v23.11)
π ERRORS π
when things go wrong, the returned object contains code and message properties, and code is gonna be one of these bad boys:
-32602β if the given parameters are wrong. typo era, we've all been there π-1β if the invoice is deleted while unpaid, or if the invoice simply does not exist. it's gone, bestie, it's not coming back π903β if the invoice expires before being paid, or if it's already expired. the deadline passed while you were waiting, tragic β³
π§ AUTHOR π§
Christian Decker decker.christian@gmail.com is mainly responsible. thank you for your service king π«‘
β SEE ALSO β
(the whole invoice cinematic universe, honestly π)
π RESOURCES π
Main web site: https://github.com/ElementsProject/lightning
go poke around, it's a good time β¨
π EXAMPLES π
Example 1: the -k era π₯
Request:
$ lightning-cli waitinvoice -k "label"="inv2"
{
"id": "example:waitinvoice#1",
"method": "waitinvoice",
"params": {
"label": "inv2"
}
}
Response:
{
"label": "inv2",
"bolt11": "lnbcrt222n1pnt3005720bolt11wtinv01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101",
"payment_hash": "paymenthashwaitinv0101010101010101010101010101010101010101010101",
"amount_msat": 2000,
"status": "paid",
"pay_index": 5,
"amount_received_msat": 2000,
"paid_at": 1738500000,
"payment_preimage": "paymentpreimagewaitinv0010101010101010101010101010101010101010101",
"description": "inv2",
"expires_at": 1739000000,
"created_index": 13,
"updated_index": 5
}
like look at that updated_index: 5. it changed, and it told us. we love transparency β¨
Example 2: the positional-argument serve π
Request:
$ lightning-cli waitinvoice "inv3"
{
"id": "example:waitinvoice#2",
"method": "waitinvoice",
"params": [
"inv3"
]
}
Response:
{
"label": "inv3",
"bolt11": "lnbcrt222n1pnt3005720bolt11wtinv02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202",
"payment_hash": "paymenthashwaitinv0202020202020202020202020202020202020202020202",
"amount_msat": 3000,
"status": "paid",
"pay_index": 6,
"amount_received_msat": 3000,
"paid_at": 1738500000,
"payment_preimage": "paymentpreimagewaitinv0020202020202020202020202020202020202020202",
"description": "inv3",
"expires_at": 1739000000,
"created_index": 14,
"updated_index": 6
}
both forms work, -k or positional, pick your fighter π
ngl the whole thing is basically "tell me when this one invoice gets paid, and then give me the receipts" and honestly? relatable. waiting is hard, but waitinvoice makes it cute π
okay that's the whole page bestie, and before you go β this absolute baddie of a manual page is from Core Lightning v26.06.9, so go forth and wait on invoices responsibly ππ¦β¨
π¦ where this page comes from
- nixpkgs unstable: clightning 26.06.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms