Counts and totals the transactions matching a filter, three ways.
POST
/api/transactions/reports/statistics
deprecated
Requires: Transactions.Reports, merchant scope.
Folds every transaction matching the filter into count and total amount, grouped by transaction type, by payment type and by result code. The three groupings partition the same rows, so each one sums to the overall figures.
Example request
Every block below sends the same request. Replace {{BASE_URL}} with the address of the API you are calling and {{API_KEY}} with your own key.
The request body is a TransactionStatisticsRequestDto. See the Request body section below for its fields.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
suppressNulls
required |
query | boolean | If true, omit properties with null values. |
Request body
application/json
, required
| Field | Type | Description |
|---|---|---|
merchantId
required |
string (uuid) | Optional merchant to restrict the aggregate to. When omitted, the result covers every merchant the caller is entitled to see. A merchant outside the caller's scope yields an empty result rather than an error, because the caller is not entitled to learn whether it exists. nullable |
minCreationTime
required |
string (date-time) | Inclusive lower bound on the transaction's creation time, in UTC. nullable |
maxCreationTime
required |
string (date-time) | Exclusive upper bound on the transaction's creation time, in UTC. nullable |
filter
required |
all of FilterGroup | The filter tree, in the same vocabulary the transaction continuation list accepts, including its virtual fields (`PaymentMethod`, `DisplayGuid`, `EntryMode`, `SettlementBatchId` and the rest), which are resolved server-side exactly as the list resolves them. |
This request body has no documented fields.
Responses
200 OK
Body: TransactionStatisticsDto
Each item has these fields.
| Field | Type | Description |
|---|---|---|
transactionCount
required |
integer (int64) | The number of matching transactions folded into the three groupings. |
totalAmount
required |
number (double) | The sum of the matching transactions' totals. |
truncated
required |
boolean | Whether the scan stopped at `MaxScannedTransactions` before the filtered set ran out, in which case every figure is over a prefix of that set. |
byTransactionType
required |
array of TransactionStatisticsBucketDto | Count and total per transaction type, keyed by the `TransactionType` member name (`Sale`, `Authorization`, `Return`, ...), ordered by descending count. nullable |
byPaymentType
required |
array of TransactionStatisticsBucketDto | Count and total per payment method, keyed by the `PaymentMethodsGranular` member name (`Visa`, `MasterCard`, `Check`, `AlternativePayment`, ...), resolved by the same rule every transaction read surface uses, ordered by descending count. nullable |
byResultCode
required |
array of TransactionStatisticsBucketDto | Count and total per gateway result, keyed by the `ResultCode` member name (`Ok`, `Declined`, ...), ordered by descending count. A transaction that recorded no response at all falls in the bucket keyed `NoResultKey`. nullable |
This response has no documented body fields.
403 Forbidden
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
401 Unauthorized
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
400 Bad Request
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
404 Not Found
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
501 Not Implemented
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
500 Internal Server Error
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
default The request failed. The body carries the standard error envelope: a machine-readable `error.code`, a human-readable `error.message`, and `error.validationErrors` when the failure was a validation rejection. See the error-code reference in this document's description for the values `error.code` can take.
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
429 The request was refused because a rate limit was exceeded. Wait at least the interval `Retry-After` names before retrying, then back off. Limits are tuned per deployment, so read the allowance from the response headers rather than assuming a fixed ceiling.
Body: RateLimitProblemDetails
Each item has these fields.
| Field | Type | Description |
|---|---|---|
type
required |
string | The problem type identifier. Always the same value: the failure is the status code itself, so there is no sub-type for a caller to branch on. nullable |
title
required |
string | A short, human-readable summary of the problem type. nullable |
status
required |
integer (int32) | The HTTP status code, repeated in the body as the problem-details format defines. |
detail
required |
string | A human-readable explanation of this occurrence of the problem. nullable |
retryAfterSeconds
required |
integer (int32) | How long to wait before retrying, in whole seconds, carrying the same figure as the `Retry-After` header. Always at least one: a value of zero would invite an immediate retry that is certain to be rejected again. |
This response has no documented body fields.
Errors
A failed request returns the platform error envelope. The
error reference lists every value
error.code can carry and shows the four response shapes.