Contents

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-read

Request:

Query Parameters:
  • byOptional. 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

401 Unauthorized:

The request is unauthorized.

404 Not found:

The instance is unknown to the backend.

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[];

}
interface MerchantStatisticAmountByInterval {

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

   // Sum of all amounts falling under the given
   // SLUG within this timeframe.
   cumulative_amounts: Amount[];

}