Source: https://usedataowl.com/docs/fix-duplicate-payments
Markdown source: https://usedataowl.com/docs/fix-duplicate-payments.md
Description: Fix revenue discrepancies caused by multiple webhooks, missing checkout session metadata, currency conversions, or duplicate payment redirects.

# How to Fix Missing or Duplicate Revenue Attribution Events

## Duplicate payments

A connected provider's payments arrive by webhook, and the script also reads success page URLs (`?session_id=`, `?checkout_id=`, `?payment_id=`, `?subscription_id=`). Both resolve to the provider's own payment ID, so the same payment is recorded once whichever way it comes in.

Payments still counted twice usually come from reporting them two ways with different IDs:

- **A connected provider plus your own Payments API calls.** The provider's webhook already records every payment. Remove the `/api/v1/payments` calls, or disconnect the provider and keep the API.
- **A random or per-request `transaction_id`.** DataOwl de-duplicates by it, so send your provider's payment ID. Sending the same ID again updates the payment.

If you pass metadata from a Checkout API and don't use payment links, you can turn URL detection off with `data-disable-payments="true"` on the script tag. `datasense("payment", { email })` keeps working.

## Missing payments

- **Not connected yet:** connect your provider in **Settings → Revenue**. Connecting imports the last 12 months.
- **Product filter:** if the site counts only some products, payments for others are skipped on purpose.
- **Webhook removed:** if someone deleted our webhook on the provider, reconnect the provider to add it again.
- **Another currency:** every payment is converted into your reporting currency (**Settings → Currency**) at the day's rate, so totals differ slightly from the provider's.

## Revenue without a source

Nothing tied the payment to a visit. Pass `datasense_session_id` (and `datasense_visitor_id`) as checkout metadata, redirect buyers to a success page on your site, or identify signed-in users with their email ([guide](/docs/revenue-attribution-guide)). Then click **Match again** in **Settings → Revenue**. Subscription renewals are credited to the visit that won the customer.

## Test charges

Remove them with [delete a payment](/docs/api/website/payments/delete).
