Dashboard Stats API product_id Filter Not Working

Status
Not open for further replies.

sven-bo

Member
The Dashboard Stats API endpoint /api/v2/getdashboardstats does not filter results by product_id. When passing a specific product ID, the API returns the same total_net_revenue as when passing "all".

This worked correctly in the past but appears to have stopped working recently (noticed on February 1, 2026).

import requests
from requests.auth import HTTPBasicAuth

# ====================================
# REPLACE WITH YOUR CREDENTIALS
# ====================================
API_KEY = "YOUR_API_KEY"
SECRET_KEY = "YOUR_SECRET_KEY"
PRODUCT_ID = "YOUR_PRODUCT_ID"

# ====================================
# API Configuration
# ====================================
stats_url = "https://payments.pabbly.com/api/v2/getdashboardstats"
headers = {"Content-Type": "application/json"}
auth = HTTPBasicAuth(API_KEY, SECRET_KEY)

# Test with specific product_id
payload_product = {
"product_id": PRODUCT_ID,
"interval": "previous_month",
}

# Test with "all"
payload_all = {
"product_id": "all",
"interval": "previous_month",
}

# Fetch stats for specific product
response_product = requests.post(stats_url, headers=headers, json=payload_product, auth=auth)
revenue_product = response_product.json().get("data", {}).get("total_net_revenue", 0)

# Fetch stats for all products
response_all = requests.post(stats_url, headers=headers, json=payload_all, auth=auth)
revenue_all = response_all.json().get("data", {}).get("total_net_revenue", 0)

# Compare results
print(f"Revenue for product '{PRODUCT_ID}': ${revenue_product}")
print(f"Revenue for 'all' products: ${revenue_all}")

if revenue_product == revenue_all:
print("\n❌ BUG: Both values are identical!")
print(" The product_id filter is being ignored.")
else:
print("\n✓ Filter working correctly - values are different.")
 

Preeti Paryani

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

Thank you for bringing this to our attention. We have escalated the issue to our team for further review. Please allow us some time, and we will get back to you as soon as we receive an update from their end.

We appreciate your patience.
 
Status
Not open for further replies.
Top