Troubleshooting

Fix duplicate payments

Why one sale can show up twice (a webhook and the Payment API, or two webhooks for one website) and how to keep each payment counted once.

Each payment is stored once per transaction, so a provider retrying a webhook never counts twice. A sale shows up twice when two different routes report it:

  • A webhook and the Payment API for the same sale. Pick one. If you need both, send the provider's own id as the API's transaction_id: Polar orders are polar_<order id>, Lemon Squeezy orders ls_order_<id>, Stripe uses the Checkout Session or invoice id.
  • Two websites with the same webhook. Each website has its own URL; a provider endpoint should only point at one.
  • Two webhook endpoints in your provider pointing at the same SuprAnalytics URL. Delete one.

Stripe subscriptions are already handled: the first invoice is merged with its Checkout Session.

AI agent or LLM? Read this page as Markdown