LIGHTNING-INVOICEREQUEST(7)
π LIGHTNING-INVOICEREQUEST(7) π
okay bestie, so this is the manual page for lightning-invoicerequest β yes the whole thing, section 7 and everything. welcome to the invoicerequest era, it's giving β¨formal invitationβ¨ vibes.
π NAME π
invoicerequest β the command for offering payments. like, you're putting it out into the universe. manifesting that bag. πΈ
πΈ SYNOPSIS πΈ
invoicerequest amount description [issuer] [label] [absolute_expiry]
[single_use]
that's it. that's the whole recipe. six little slots, one big slay. π«Ά
β¨ DESCRIPTION β¨
ngl this command is new new β it was added in v22.11, so if you're on some ancient node bestie, it's not gonna be there, sorry π.
so what does the invoicerequest RPC command actually DO? it creates an invoice_request to send payments, and the way it works is lowkey iconic: it automatically enables the processing of an incoming invoice, and payment of it. periodt. then whoever's holding the resulting invoice_request can hit up lightning-sendinvoice(7) to collect their payment. the reader gets paid, you get your thing, everyone eats. π
here's the deets on every single parameter, no gatekeeping:
amount(msat) β a positive value in millisatoshi precision. and it's flexible fr fr: it can be a whole number, or a whole number ending inmsatorsat, or a number with three decimal places ending insat, or a number with 1 to 11 decimal places ending inbtc. so many lewks, all valid πdescription(string) β a short description of purpose of the payment, e.g.ATM withdrawl. (yes that's exactly how it's spelled in the source, i don't make the rules π« .) this value is encoded into the resultinginvoice_requestand is viewable by anyone you expose it to β so like, don't put your secrets in there bestie, everyone can see it π. it must be UTF-8, and it cannot use\uJSON escape codes.issuer(string, optional) β who is issuing it (i.e. you) if appropriate. your name in lights, main character energy πlabel(string, optional) β an internal-use name for the offer, which can be any UTF-8 string. this one's just for you, it's your little tag π·οΈabsolute_expiry(u64, optional) β the time the offer is valid until, in seconds since the first day of 1970 UTC. if not set, theinvoice_requestremains valid (though it can be deactivated by the issuer of course β that's you, you have the power). this is encoded in theinvoice_request.single_use(boolean, optional) β indicates that theinvoice_requestis only valid once. we may attempt multiple payments, but as soon as one is successful no more invoices are accepted (i.e. only one person can take the money π«°). the default is True. the default is so real.
π RETURN VALUE π
on success, you get an object back, and here's everything inside it, no crumbs left:
invreq_id(hash) β the SHA256 hash of allinvoice_requestfields less than160.active(boolean) (always true) β whether theinvoice_requestis currently active. it just went live bestie π’single_use(boolean) β whether theinvoice_requestwill become inactive after we pay an invoice for it.bolt12(string) β the bolt12 string starting withlnr. she's long, she's iconic, she's a whole string π«used(boolean) (always false) β whether theinvoice_requesthas already been used. fresh out the box πΈlabel(string, optional) β the label provided when creating theinvoice_request. only shows up if you gave one π
π¨ ERRORS π¨
on failure, an error is returned and no invoice_request is created. and here's the slightly scary part: if the lightning process fails before responding, the caller should use lightning-listinvoicerequests(7) to query whether it was created or not. like, go check if the thing exists, don't just assume π
-1β catchall nonspecific error. the "idk what happened, it just didn't work" of error codes π
π§ AUTHOR π§
Rusty Russell rusty@rustcorp.com.au is mainly responsible. ty king π«Ά
π₯ SEE ALSO π₯
(the full trio, use them together, they're a set π)
π RESOURCES π
main web site: https://github.com/ElementsProject/lightning
go look, it's right there, it's free β
π EXAMPLES π
Example 1:
Request:
$ lightning-cli invoicerequest -k "amount"=1000000 "description"="Simple test"
{
"id": "example:invoicerequest#1",
"method": "invoicerequest",
"params": {
"amount": 1000000,
"description": "Simple test"
}
}
Response:
{
"invreq_id": "invreqid01010101010101010101010101010101010101010101010101010101",
"active": true,
"single_use": true,
"bolt12": "lno1qgsq000bolt210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000",
"used": false
}
Example 2:
Request:
$ lightning-cli invoicerequest -k "amount"="10000sat" "description"="Requesting for invoice" "issuer"="clightning store"
{
"id": "example:invoicerequest#2",
"method": "invoicerequest",
"params": {
"amount": "10000sat",
"description": "Requesting for invoice",
"issuer": "clightning store"
}
}
Response:
{
"invreq_id": "invreqid02020202020202020202020202020202020202020202020202020202",
"active": true,
"single_use": true,
"bolt12": "lno1qgsq000bolt240002400024000240002400024000240002400024000240002400024000240002400024000240002400024000240002400024000240002400024000",
"used": false
}
look at those juicy bolt12 strings. absolute units. π₯
and that's the whole page babes π this was Core Lightning v26.06.9, so if you're reading this from some other version, vibe check your node first. mwah, go request some invoices, you got this πΈπ¦π
π¦ 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