LIGHTNING-HOOK-INVOICE_PAYMENT(7)
okay bestie, this is LIGHTNING-HOOK-INVOICE_PAYMENT(7) β the lightning-hook-invoice_payment(7) manual page β and it's lowkey serving βone hook, one job, zero clutter.β π
β¨
π NAME π
invoice_payment β Hook fired when a payment for an invoice is received π
π¦ DESCRIPTION π¦
The invoice_payment hook is called whenever a valid payment for an unpaid invoice has arrived. That's it, that's the vibe check: valid payment + unpaid invoice = hook time. β¨
The hook is deliberately sparse. Plugins can use listinvoices to retrieve additional information.
The plugin can:
- accept the payment by returning
{"result": "continue"} - reject the payment with a generic error using
{"result": "reject"} - reject the payment with a custom BOLT 4 failure message using the
failure_messagefield
If failure_message is provided, the payment will be failed with that message. If result is "reject" and no failure_message is provided, the payment fails with incorrect_or_unknown_payment_details. failure_message must NOT be provided when result is "continue". No cap, that's a hard rule. π«
Before version 23.11 themsatfield was encoded as a string with an'msat'suffix. Legacy era behavior, bestie β don't let it confuse you. π°οΈ
πΈ HOOK PAYLOAD πΈ
payment(object): Basic payment information. Additional TLV-derived fields may be included when running in developer mode.label(string): Unique label identifying the invoice.preimage(secret): The payment preimage.msat(msat): Amount paid in millisatoshis.
π HOOK RETURN π
result(string) (one of"continue","reject"): Controls whether the payment is accepted or rejected."continue"accepts the payment."reject"fails the payment.failure_message(hex, optional): Optional BOLT 4 failure message. Used to provide a specific failure reason when rejecting the payment.
If result is present, and result is "reject":
failure_message(hex, optional)
π SEE ALSO π
aaaand scene π¬ β footer vibes: Core Lightning v26.06.9 is the source/version, and the date slot is giving βnot printed in the original footerβ energy, so no invented date here. Stay iconic, bestie. π«Άπ
π¦ 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