MELLEPRISE MELLEPRISE AI MP Blog
← All articles

stripe webhook endpoint missing after deploy β€” exact setup

Pastel comic of a public HTTPS mailbox plugged into a small production server while a disconnected localhost cable lies unused

Your stripe webhook endpoint is missing after deploy: checkout completes, the customer returns to the success page, and your database never changes.

The payment may be real. The success page may be real. The missing piece is the public HTTPS destination Stripe is supposed to call after the browser leaves.

What is actually broken

A Stripe webhook endpoint is not the success URL and not the Stripe CLI tunnel. It is a registered destination where Stripe sends event POSTs.

Stripe requires that registered endpoint to be a publicly accessible HTTPS URL. Stripe currently lets you register up to 16 event destinations. If the only working listener was stripe listen --forward-to localhost:3000/..., production never had a durable endpoint.

That is why the app can look correct in the editor and still do nothing for real customers.

Why AI-built apps miss the endpoint

AI builders usually produce the visible payment path first: checkout button, Checkout Session, success page. The server route is either generated late or tested only through the CLI.

The CLI proof is misleading. stripe listen creates a direct tunnel while your terminal is open. It prints a signing secret for that listener. It does not register the production destination your live site needs.

Launch then splits the setup into pieces that are easy to confuse: test mode versus live mode, CLI secret versus endpoint secret, preview URL versus production domain, snapshot events versus thin events.

stripe webhook endpoint setup: the exact click path

  1. Open the live Stripe account. Do not create anything in a sandbox unless you are deliberately testing there.
  2. Open Workbench β†’ Webhooks. Stripe now treats a webhook registration as an event destination.
  3. Create a new destination. Choose events from your own account unless you explicitly use Connect.
  4. Choose the payload format your handler understands. Existing Checkout handlers that process events such as checkout.session.completed with snapshot verification should stay on snapshot. Thin events are a separate model and need a separate thin-aware handler.
  5. Select only the events your code handles. For a typical Checkout launch that is often checkout.session.completed; subscriptions may also need invoice events. Extra events do not repair a missing handler.
  6. Choose Webhook endpoint as the destination type. Enter the exact public HTTPS URL, for example https://yourdomain.com/api/webhooks/stripe.
  7. Copy the signing secret shown for that endpoint. It starts with whsec_. Store it in the production server or serverless secret store.
  8. Deploy or restart after setting the secret. Some hosts inject env vars only during build or boot.
  9. Open Event deliveries. Send or wait for a real event and inspect the delivery result before editing business logic.

If you have not wired the basic live route and events yet, the broader stripe webhook guide covers the whole payment-notification chain. This article is the narrower endpoint setup and proof path.

Check the URL before blaming the handler

The endpoint URL must match the deployed route exactly. /api/webhook, /api/webhooks/stripe and /webhook are three different endpoints.

Do not register a URL that redirects. A redirected POST is a failed delivery for practical purposes, even if a browser would follow it. Use the final HTTPS URL directly.

Confirm that the route accepts POST without a browser login cookie. Authentication middleware that protects your dashboard must not protect the Stripe route. Stripe is a server client, not a logged-in user.

For serverless platforms, make sure the raw request body reaches signature verification. Body parsers that transform JSON before verification can make a correct endpoint look like a secret mismatch.

The signing secret belongs to the destination

Each endpoint has its own signing secret. The CLI listener secret is not interchangeable with the Workbench endpoint secret. A test endpoint secret is not interchangeable with a live one either.

When deliveries reach the server but fail with signature errors, copy the secret again from the exact endpoint and compare it with the production variable. The deeper mismatch cases are covered in stripe webhook secret.

If test mode works and live mode does not, use stripe webhook works in test mode but not live. Mode separation causes a different class of failure than a missing public URL.

Read Event deliveries like a decision table

Open the endpoint in Workbench and inspect Event deliveries. Stripe shows whether events are delivered, pending or failed, and the attempt history includes earlier HTTP statuses and future retry times.

  • No row for the payment event: wrong mode, wrong endpoint, event type not enabled, or the payment is not the object you think it is.
  • 3xx: the registered URL redirects. Replace it with the final URL.
  • 401, 403, 404 or 405: auth middleware, routing or HTTP method is wrong.
  • 400: often signature verification failed or the handler rejected the body.
  • 500: Stripe reached the route, but application code crashed.
  • TLS or connection error: the public host or certificate path is broken.
  • Timeout: acknowledge first and move slow fulfillment work to a background job.
  • 2xx but nothing unlocks: transport works; inspect event type handling, idempotency and database writes.

In live mode Stripe retries a specific event with exponential backoff for up to three days. In a sandbox, retries are much shorter. You can manually retry individual events from the endpoint’s Event deliveries after fixing the cause.

Endpoint checklist

  • Live mode is open, not only a sandbox or test view
  • Event destination exists in Workbench
  • Destination type is Webhook endpoint
  • Payload format matches the handler
  • Required event types are enabled
  • URL is public HTTPS, exact, final and POST-accessible
  • Endpoint signing secret is in production env vars
  • Application was deployed or restarted after the secret changed
  • Event deliveries show a real attempt before code changes

A successful checkout browser redirect is not fulfillment. The registered stripe webhook endpoint is the production door Stripe actually knocks on.

When the endpoint is correct and the next failure is the rest of production configuration, use the lovable deploy checklist to verify env vars, database settings and publish-time settings in order.

FAQ

Is stripe listen the same as a Stripe webhook endpoint?

No. stripe listen is a local testing tunnel. It prints a signing secret and forwards events while the command runs, but it does not create the public production endpoint that live payments need.

Should I choose thin or snapshot events for an existing Checkout integration?

Match the payload format to the handler. Existing checkout.session.completed handlers that verify snapshot events should stay on snapshot; thin events require a separate endpoint and a handler built for thin event notifications.

Why does Stripe show a payment but no webhook delivery?

Usually the live endpoint was never registered, the wrong mode is open, the event type is not enabled, or the payment belongs to another mode or account. Compare the live payment object with the endpoint’s Event deliveries before editing code.