Skip to content

0.12.0 - Optional webhooks

Choose a tag to compare

@modulout modulout released this 15 Oct 11:50
· 33 commits to main since this release

Added

  • Optional webhooks (live on the P2Flux API since 15 October 2026). Pass notifyUrl (a public
    https URL) to createPayment() or createPaymentLink() and P2Flux POSTs payment.paid,
    subscription.charged or subscription.updated there, retrying for about 18 hours. Without it
    nothing changes. notifyUrl comes back on the result only when the payment or link is watched.
    (https://p2flux.com/docs/webhooks.html)
  • handleNotification(body, expect) - confirms a notification with the API before you fulfil:
    { reference } for a payment, { linkId, manage } for a link. Returns confirmed, a dedupeKey
    built from the verified payment (never the event id), and throws when the answer is not final yet
    (answer 5xx; it is sent again).