Skip to content

lightningd: include offer_id in invoice_creation notification#8981

Open
vincenzopalazzo wants to merge 1 commit intoElementsProject:masterfrom
vincenzopalazzo:fix/invoice-creation-offer-id
Open

lightningd: include offer_id in invoice_creation notification#8981
vincenzopalazzo wants to merge 1 commit intoElementsProject:masterfrom
vincenzopalazzo:fix/invoice-creation-offer-id

Conversation

@vincenzopalazzo
Copy link
Collaborator

Summary

  • The invoice_creation event notification now includes an offer_id field when the invoice is associated with a BOLT 12 offer
  • This enables plugins to implement "waitanyoffer"-like functionality by subscribing to invoice_creation and immediately identifying which offer triggered the invoice
  • For bolt11 invoices and bolt12 invoices not associated with a local offer, the field is omitted

Fixes #8191

Test plan

  • CI passes
  • Verify invoice_creation notification includes offer_id when a bolt12 invoice is created via createinvoice for a known local offer
  • Verify offer_id is absent for regular bolt11 invoices

@vincenzopalazzo vincenzopalazzo force-pushed the fix/invoice-creation-offer-id branch from d8b934a to d014248 Compare March 25, 2026 13:44
When a BOLT 12 invoice is created via createinvoice and is associated
with a local offer, include the offer_id in the invoice_creation event
notification. This allows plugins to determine which offer triggered
an invoice creation without having to call listinvoices for every
created invoice.

For bolt11 invoices and bolt12 invoices not associated with a local
offer, the field is omitted.

Fixes ElementsProject#8191

Changelog-Added: The `invoice_creation` notification now includes `offer_id` when the invoice is associated with a BOLT 12 offer.
@vincenzopalazzo vincenzopalazzo force-pushed the fix/invoice-creation-offer-id branch from d014248 to 7519749 Compare March 25, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

invoice_creation event notification should include offer_id when applicable

1 participant