dambel

دمبل

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

API Docs / payments / data / stats



GET /api/v1/payments/data/stats

Receive total stats 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"

Request Example

GET /api/v1/payments/data/stats?type=income&user_id=10
Authorization: Bearer {token}

Response

200 OK

Returns stats for each type of payment record.

Example

{
  "total_income": 123,
  "total_commission": 123,
  "total_deposit": 123,
  "total_withdrawal": 123,
  "total_purchase": 123,
}

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 stats. For example the total amount of commissions, would be the total income of the application.


Error Responses

StatusDescriptionReference
401UnauthorizedAuthentication error
footer wave
logo

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

LinkedinInstagramXYoutube