Accounting API
POST /accounting
Description
This API endpoint retrieves various accounting metrics, including user statistics and purchase data.
Request Body
The request uses GraphQL to perform the accounting
query, which retrieves aggregate data related to user registrations and purchases.
Query:
query accounting {
accounting {
totalUsers
joinedByDay
joinedByMonth
joinedByYear
monthPurchaseCount
monthPurchase
dayPurchaseCount
dayPurchase
monthRenewPurchaseCount
monthRenewPurchase
dayRenewPurchaseCount
dayRenewPurchase
}
}
GraphQL Variables:
{}
Example Request:
curl --location '' \
--header 'Content-Type: application/json' \
--data '{"query":"query accounting {\n accounting {\n totalUsers\n joinedByDay\n joinedByMonth\n joinedByYear\n monthPurchaseCount\n monthPurchase\n dayPurchaseCount\n dayPurchase\n monthRenewPurchaseCount\n monthRenewPurchase\n dayRenewPurchaseCount\n dayRenewPurchase\n }\n}","variables":{}}'
Response:
-
Success (200 OK):
- The response includes various metrics related to user registrations and purchases.
{
"data": {
"accounting": {
"totalUsers": 1200,
"joinedByDay": {
"2024-08-10": 10,
"2024-08-11": 15
},
"joinedByMonth": {
"2024-08": 300,
"2024-07": 250
},
"joinedByYear": {
"2024": 1200
},
"monthPurchaseCount": 500,
"monthPurchase": 15000.00,
"dayPurchaseCount": 20,
"dayPurchase": 600.00,
"monthRenewPurchaseCount": 200,
"monthRenewPurchase": 8000.00,
"dayRenewPurchaseCount": 10,
"dayRenewPurchase": 400.00
}
}
}totalUsers
: Total number of users.joinedByDay
: Number of users joined per day.joinedByMonth
: Number of users joined per month.joinedByYear
: Number of users joined per year.monthPurchaseCount
: Total number of purchases made in the current month.monthPurchase
: Total purchase amount for the current month.dayPurchaseCount
: Total number of purchases made in the current day.dayPurchase
: Total purchase amount for the current day.monthRenewPurchaseCount
: Total number of renewals made in the current month.monthRenewPurchase
: Total renewal amount for the current month.dayRenewPurchaseCount
: Total number of renewals made in the current day.dayRenewPurchase
: Total renewal amount for the current day.
-
Error (4XX/5XX):
- If there is an issue with the request or if there is a server error, the response will include an error message and status code.
Note:
This endpoint provides a comprehensive overview of user registrations and purchase activities, helping with financial and user engagement analysis.