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

Private Comment
This field is visible only to staff members and is for their reference only.

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
 

ArshilAhmad

Well-known member
Staff member
Hi @sven-bo,

What appears to be happening here is that, for individual days when the sales amount is less than the refund amount, the revenue is being calculated as 0 instead of Sales − Refund (for that particular day).

For example, on February 2, the total sales = 66 and the refund = 69. The net revenue should have been -3, but instead, it is being shown as 0.

Please allow us some time to look into this concern. We will get back to you with an update soon.

Thanks & Regards,
Arshil Ahmad
Customer Support Associate
🌐 Pabbly.com
👉Rate your support
 

Preeti Paryani

Well-known member
Staff member
Hi @sven-bo,

Thank you for acknowledging the update.

As of now, it appears that the root cause of the discrepancy is identified. The current behavior is such that when the refund amount exceeds the sales amount for a particular day, the net revenue is considered as 0 instead of a negative value. This applies to both the API and the dashboard—if you check the stats for that specific date on the dashboard, it will also reflect 0 in such cases.

At present, this is the expected system behavior.

If you would like this behavior to be updated (i.e., to reflect negative revenue values), we recommend submitting this as a feature request on our roadmap here:
https://roadmap.pabbly.com/b/billing-new-feature-request-bug-reporting

This will help our team consider it for future improvements.
 

sven-bo

Member
Hi @Preeti Paryani ,

Thanks for the update. I'd argue this is a bug rather than a feature request though. The monthly dashboard stats clearly handle negative days correctly (that's why sales minus refunds matches the dashboard perfectly). It's only the daily API values that floor negatives to 0, which makes the field unreliable for anyone aggregating daily data.

I'll submit it on the roadmap either way, but wanted to flag the inconsistency.

Thanks,
Sven
 

Preeti Paryani

Well-known member
Staff member
Hi @sven-bo,

Thank you for your detailed feedback, we completely understand your point regarding the inconsistency.

Once you have submitted this on the roadmap, kindly share the link with us so that we can internally highlight and discuss this further with our team as well.

We appreciate you bringing this to our attention.
 
Top