total_net_revenue from /api/v2/getdashboardstats does not match Pabbly dashboard values

sven-bo

Member
When fetching daily stats via `POST /api/v2/getdashboardstats` with a custom date range (single day), the `total_net_revenue` field in the response does not match the "Revenue Monthly Stats" shown on the Pabbly Payments dashboard.

However, if I manually compute net revenue as `total_sales_amount - total_refund_amount` from the same API response, the numbers match the dashboard exactly.

Steps to reproduce:
1. Call `POST /api/v2/getdashboardstats` for each day of a given month (e.g. `start_date` = `end_date` = single day)
2. Sum up `total_net_revenue` across all days in that month
3. Compare to the "Revenue Monthly Stats" on the Pabbly Payments dashboard

Expected: The summed `total_net_revenue` should match the dashboard.
Actual: The API sum is consistently higher than the dashboard. The discrepancy varies by month, sometimes off by a few dollars, sometimes by hundreds.
Workaround: Compute net revenue as `total_sales_amount - total_refund_amount` instead of using `total_net_revenue`. This matches the dashboard values perfectly across all months tested.

I've verified this across multiple months going back over a year, the pattern is consistent.

The `total_sales_amount` and `total_refund_amount` fields are correct; only `total_net_revenue` is off.

Is this a known issue? Thanks!
 

sven-bo

Member
Example:

API_KEY="your_api_key"
SECRET_KEY="your_secret_key"

Example: fetch stats for a single day
cÜrl -s -X POST "https://payments.pabbly.com/api/v2/getdashboardstats" \
-u "$API_KEY:$SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"product_id": "all",
"interval": "custom_range",
"start_date": "2026-02-01",
"end_date": "2026-02-01"
}'

To reproduce the bug:
1. Run the above for each day of a month
2. Sum total_net_revenue across all days -> does NOT match Pabbly dashboard
3. Sum (total_sales_amount - total_refund_amount) across all days -> matches dashboard exactly
 
Top