Contents

GET /management/instances/$INSTANCE/statistics-counter/$SLUG#
GET [/instances/$INSTANCE]/private/statistics-counter/$SLUG#

This request will return be used to statistics where the values are counters. All available values for the given SLUG will be returned. Since protocol v25.

Required permission: statistics-read

Request:

query 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 MerchantStatisticsCounterResponse

401 Unauthorized:

The request is unauthorized.

404 Not found:

The instance is unknown to the backend.

Details:

interface MerchantStatisticsCounterResponse {

  // Statistics kept for a particular fixed time window.
  buckets: MerchantStatisticCounterByBucket[];

  // Human-readable bucket statistic description.
  // Unset if no buckets returned
  buckets_description?: string;

  // Statistics kept for a particular sliding interval.
  intervals: MerchantStatisticCounterByInterval[];

  // Human-readable interval statistic description.
  // Unset if no intervals returned
  intervals_description?: string;

}
interface MerchantStatisticCounterByBucket {

  // 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 counters falling under the given
  // SLUG within this timeframe.
  cumulative_counter: Integer;

}
interface MerchantStatisticCounterByInterval {

  // Start time of the interval.
  // The interval always ends at the response
  // generation time.
  start_time: Timestamp;

  // Sum of all counters falling under the given
  // SLUG within this timeframe.
  cumulative_counter: Integer;

}