dambel

دمبل

shevron
ورود | ثبت نام

API Docs / payments / data / chart



GET /api/v1/payments/data/chart

Receive chart data of payments and transactions in the given date range and filters.


Permissions

PermissionDescription
payments.view_allView data of all payments in the system
payments.view_ownView only own payment data

Query Parameters

NameTypeRequiredDescriptionExample
typestringNoSee available types. Comma-separated"wallet,subscription"
payable_typestringNoFilter by payable type(s), comma-separated"gym,plan"
payable_idintNoFilter by payable ID(s), comma-separated"1,2,3"
user_idintNoFilter by user ID(s), comma-separated"10,20"
is_doneboolNoFilter by completion statustrue
start_datestringNoStart of date range (YYYY-MM-DD)"2024-01-01"
end_datestringNoEnd of date range (YYYY-MM-DD)"2024-01-31"
min_amountnumberNoMinimum amount100
max_amountnumberNoMaximum amount1000
descriptionstringNoSearch in description"membership"
group_bystringNoHow to group the chart data: "day", "week", "month""day"

Request Example

GET /api/v1/payments/data/chart?user_id=10
Authorization: Bearer {token}

Response

200 OK

Returns chart data for each type of payment record.

Example

{
  "labels": ["2025-01", "2025-02", "2025-03"],
  "data": {
    "deposit": [1200, 800, 1000],
    "income": [400, 600, 750],
    "purchase": [300, 500, 450],
    "commission": [50, 60, 80],
    "withdrawal": [200, 150, 300]
  }
}

Normal users can use this as a overall payment report for their own account, and admins can use it as the whole system cash flow report.


Error Responses

StatusDescriptionReference
401UnauthorizedAuthentication error
footer wave
logo

دمبل، دنیای هوشمند ورزش و تغذیه

LinkedinInstagramXYoutube