LIGHTNING-XPAY(7)
okay so you just opened lightning-xpay(7) and honestly? bestie, you picked a good one. this is the xpay command from Core Lightning, and it's about to send a payment for you. buckle up. ๐
๐ธ NAME ๐ธ
xpay โ Command for sending a payment. that's it. that's the whole gig. it sends money. iconic behavior. ๐ธ
โจ SYNOPSIS โจ
xpay invstring [amount_msat] [maxfee] [layers] [retry_for]
[partial_msat] [maxdelay] [payer_note] [label] [localinvreqid]
๐ DESCRIPTION ๐
Command added in v24.11. yes, she's new-ish, and yes, she's already that girl. ๐
The xpay RPC command attempts to make the specified payment. it's flexible like that โ it can look up BIP353 names (such as โฟrusty@blockstream.com, which is genuinely adorable), it can resolve simple offers (lno1...), and it can pay bolt11 (lnbc...) and bolt12 invoices (lni1...). one command, all the invoice flavors. we love a multitasker. ๐
This plugin is both simpler and more sophisticated than the older pay plugin. both things can be true at once, that's called range. ๐ฆ
invstring(string) โ bolt11 or bolt12 invoice, a bolt12 (non-recursive) offer or a BIP353 name. if it's a bip353 name, an offer is fetched withfetchbip353if available. if it's an offer, the invoice is fetched usingfetchinvoiceautomatically. she does the legwork so you don't have to. ๐ซถamount_msat(msat, optional) โ Only possible for a bolt11 invoice which does not have an amount (in which case, it's compulsory).amount_msatis in millisatoshi precision; it can be a whole number, or a whole number with suffixmsatorsat, or a three decimal point number with suffixsat, or an 1 to 11 decimal point number suffixed bybtc. numbers, but make it fashion. ๐ฅmaxfee(msat, optional) โ maxfee creates an absolute limit on what fee we will pay. The default is5000msat, or 1% (whatever is greater). no getting fleeced on your watch. ๐ซlayers(array of strings, optional) โ These are askrene layers to apply in addition to xpay's own: these can alter the topology or provide additional information on the lightning network. This lets you exclude particular nodes or channels, or bias against them: seeaskrene-create-layer.: ๐ซ- (string, optional): name of an existing layer
retry_for(u32, optional) โ Untilretry_forseconds passes, the command will keep finding routes and retrying the payment. The default is60seconds. she's persistent, not clingy. ๐ญpartial_msat(msat, optional) โ Explicitly state that you are only paying some part of the invoice. Presumably someone else is paying the rest (otherwise the payment will time out at the recipient). squad mode activated. ๐คmaxdelay(u32, optional) โ A payment may be delayed for up tomaxdelayblocks by another node; clients should be prepared for this worst case. The default is2016. (added v25.02) โณpayer_note(string, optional) โ A message that a payer is willing to send to a payee within an invoice request. (added v26.04) say something nice!! ๐label(string, optional) โ Attach a label to payments for which is returned inlistpaysandlistsendpays. This is for your own use: it is not visible to the recipient. your little secret, no cap. ๐ (added v26.06)localinvreqid(hex, optional) โlocalinvreqidis used by offers to link a payment attempt to a localinvoice_requestoffer created bylightningd-invoicerequest(7). This ensures that we only make a single payment for an offer, and that the offer is marked used once paid. (added v26.06) ๐
๐ RETURN VALUE ๐
On success, an object is returned, containing:
payment_preimage(secret) โ The proof of payment: SHA256 of thispayment_hash. iykyk. ๐failed_parts(u64) โ How many separate payment parts failed. ๐successful_parts(u64) โ How many separate payment parts succeeded (or are anticipated to succeed). This will be at least one. periodt. ๐amount_msat(msat) โ Amount the recipient received. ๐amount_sent_msat(msat) โ Total amount we sent (including fees). the fees are part of the vibe, unfortunately. ๐ฎโ๐จ
๐ ERRORS ๐
The following error codes may occur:
-1โ Catchall nonspecific error. the "something happened" of errors. ๐ซ๏ธ203โ Permanent failure from destination (e.g. it said it didn't recognize invoice). they literally don't know her. ๐ค205โ Couldn't find, or find a way to, the destination. she's lost in the graph. ๐บ๏ธ207โ Invoice has expired. too late bestie, should've paid sooner. โ219โ Invoice has already been paid. someone ate already. ๐ฝ๏ธ209โ Other payment error. the miscellaneous queen. ๐
๐ AUTHOR ๐
Rusty Russell rusty@rustcorp.com.au is mainly responsible. main character energy, honestly. ๐ซก
๐ฆ SEE ALSO ๐ฆ
๐ RESOURCES ๐
Main web site: https://github.com/ElementsProject/lightning โ go look, she's gorgeous. โญ
๐ง EXAMPLES ๐ง
Example 1:
Request:
$ lightning-cli xpay "lnbcrt100n1pnt2bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000"
{
"id": "example:xpay#1",
"method": "xpay",
"params": [
"lnbcrt100n1pnt2bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000"
]
}
Response:
{
"payment_preimage": "paymentpreimgxp1010101010101010101010101010101010101010101010101",
"amount_msat": 10000,
"amount_sent_msat": 10002,
"failed_parts": 0,
"successful_parts": 1
}
Example 2:
Request:
$ lightning-cli xpay -k "invstring"="lni1qqg0qe03030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303" "payer_note"="Coffee payment"
{
"id": "example:xpay#2",
"method": "xpay",
"params": {
"invstring": "lni1qqg0qe03030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303",
"payer_note": "Coffee payment"
}
}
Response:
{
"payment_preimage": "paymentpreimgxp2020202020202020202020202020202020202020202020202",
"amount_msat": 1000,
"amount_sent_msat": 1000,
"failed_parts": 0,
"successful_parts": 1
}
and that's the whole page, bestie. this gorgeous thing is from Core Lightning v26.06.9 and it lives at LIGHTNING-XPAY(7). go pay someone. slay. ๐
โจ๐ซถ
๐ฆ 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