- GET /management/instances/$INSTANCE/statistics-amount/$SLUG#
- GET [/instances/$INSTANCE]/private/statistics-amount/$SLUG#
This request will return be used to statistics where the values are amounts. All available values for the given SLUG will be returned. Since protocol v25.
Required permission:
statistics-readRequest:
- Query Parameters:
by – Optional. If set to “BUCKET”, only statistics by bucket will be returned. If set to “INTERVAL”, only statistics kept by interval will be returned. If not set or set to “ANY”, both will be returned.
Response:
- 200 Ok:
The body will be a MerchantStatisticsAmountResponse
- 400 Bad Request:
The
byparameter is malformed. Returned withTALER_EC_GENERIC_PARAMETER_MALFORMED.- 401 Unauthorized:
The request is unauthorized.
- 404 Not found:
The instance is unknown to the backend.
- 500 Internal Server Error:
The server experienced an internal failure. Returned with
TALER_EC_GENERIC_DB_FETCH_FAILED.
Details:
interface MerchantStatisticsAmountResponse { // Statistics kept for a particular fixed time window. buckets: MerchantStatisticAmountByBucket[]; // Human-readable bucket statistic description. // Unset if no buckets returned buckets_description?: string; // Statistics kept for a particular sliding interval. intervals: MerchantStatisticAmountByInterval[]; // Human-readable interval statistic description. // Unset if no buckets returned intervals_description?: string; }
interface MerchantStatisticAmountByBucket { // Start time of the bucket (inclusive) start_time: Timestamp; // End time of the bucket (exclusive) end_time: Timestamp; // Range of the bucket range: StatisticBucketRange; // Sum of all amounts falling under the given // SLUG within this timeframe. cumulative_amounts: Amount[]; }