Account Stats
Get a summary of the account's transaction activity over a given period.
Required scope: view-account
Parameters
| Parameter | Type | Description |
|---|---|---|
fromDate | string optional | Start date of the period, formatted as Y-m-d. |
toDate | string optional | End date of the period, formatted as Y-m-d. |
interval | enum optional | A shortcut interval instead of fromDate/toDate. Accepted values: today, yesterday, thisWeek. |
Returns
Returns an object summarizing revenue and transaction counts for the requested period.
Request
Endpoint: https://youcanpay.com/api/v2/account/statsMethod: GET
bash
$ curl --location -g --request GET 'https://youcanpay.com/api/v2/account/stats' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'Response
json
{
"object": "v2.account.stats",
"interval": "thisWeek",
"from_date": "2026-07-20 00:00:00",
"to_date": "2026-07-24 23:59:59",
"total_revenue": {
"amount": "1200.00",
"currency": "MAD",
"localized": "MAD 1,200.00"
},
"paid_transactions_by_dates": [
{
"date": "2026-07-20",
"totalAmount": 0
}
],
"transactions_by_status": [
{
"status": "paid",
"count": 12
},
{
"status": "failed",
"count": 2
}
],
"summary": {
"total_transactions": 14,
"acceptance_rate": "85.71"
}
}Attributes
| Parameter | Type | Description |
|---|---|---|
object | string | Always v2.account.stats. |
interval | string | The resolved interval for the report. |
from_date | string | Start of the reported period. |
to_date | string | End of the reported period. |
total_revenue | object | Total revenue over the period, always in MAD, as a money object. |
paid_transactions_by_dates | array | Paid transaction totals grouped by date. |
transactions_by_status | array | Transaction counts grouped by status. |
summary.total_transactions | integer | Total number of transactions across all statuses. |
summary.acceptance_rate | string|null | Percentage of transactions that were paid. null if there were none. |