GET /statistics/transactions/count

Get transaction counts by day

Statistics

Description

Retrieve daily transaction statistics for your merchant business.
Returns a time series of transaction counts grouped by day, with zero values filled in for days with no data.

Authentication Required: User must be authenticated and have the 'merchant' role.

Users can only query their own merchant_id.

Parameters

merchant_id integer query required
The merchant ID to get transaction statistics for
start_date string query
Start date for the statistics range (ISO 8601 format). Defaults to 30 days ago.
end_date string query
End date for the statistics range (ISO 8601 format). Defaults to current time.
reward_status string query
Filter transactions by reward status. When omitted, all reward statuses are included.

Responses

200 Successful response with daily transaction counts
application/json
statusstring
Example: success
dataarray
Array of daily transaction counts, including days with zero transactions
Example:
{
  "status": "success",
  "data": [
    {
      "date": "2024-01-01",
      "count": 12
    },
    {
      "date": "2024-01-02",
      "count": 0
    },
    {
      "date": "2024-01-03",
      "count": 18
    },
    {
      "date": "2024-01-04",
      "count": 9
    }
  ]
}
401 Authentication required
application/json
Example:
{
  "status": "error",
  "message": "Not authenticated or insufficient permissions"
}
500 Internal server error
application/json
statusstring
Example: error
messagestring
Example: Failed to fetch transaction statistics
errorstring
Example: Connection error