A thin route that hands the raw body and signature to the payments adapter for verification and interpretation, then records the payment. Verification tries every configured signing secret because the payload cannot be parsed for the account until after verification. Refunds and disputes are acknowledged and logged rather than acted on.
Also called: payment confirmation · invoice paid automatically · checkout webhook
- 1The raw body is read (never parsed first, because the signature is over the raw bytes).
- 2The adapter verifies against each candidate signing secret: environment first, then every account's stored secret.
- 3Completed sessions are gated on payment_status being paid, so bank-debit methods that complete before funds clear do not mark an invoice paid.
- 4The invoice, account and amount are read from the session metadata and recorded idempotently.
- 5A database failure returns 500 so the provider retries; the reconcile sweep is the ultimate backstop.
The route calls itself 'the SOURCE OF TRUTH for marking an invoice paid'. The paid gate is called out in the adapter: 'async methods (ACH) fire completed before funds clear; only paid should mark the invoice.' The multi-secret loop exists because 'the Stripe webhook payload can't be parsed for the org until AFTER signature verification.'
- Invoices had to be marked paid by hand.
- Bank-debit payments were marked paid before funds cleared.
- The account could not be identified before the signature was verified.
See it on your own jobs
Twenty minutes, your numbers, no slide deck. We’ll build one of your real buildings in front of you and send you the estimate link at the end — yours to keep either way.
or keep browsing features →