View as Markdown

llms.txt

The API reference isn't available right now

This instance couldn't load its API specification. The reference returns as soon as the specification is readable again.

Back to the API reference

No such operation

This instance documents no operation under that identifier. It may have been renamed, or it may belong to a feature this installation hasn't enabled.

Back to the API reference

This reference may be out of date

This instance couldn't reach its API specification on the last attempt, so this page shows the copy fetched before that. Anything added or changed since then is missing here, and the reference updates itself as soon as the specification is readable again. Last fetched 2026-10-22 22:09 UTC.

API reference TransactionStatistics

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.

Signed in, you can send this request to your own sandbox merchant from the console and read the answer. Sign in to try it.

Example request

Each example below is one request, shown in every language. Choose an example and a language, then 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.

Code sample language
Request example

Aggregates one merchant's transactions created in September 2026. Both bounds are UTC: the minimum is inclusive and the maximum exclusive, the same convention the transaction list applies.

cURL

curl -X POST "{{BASE_URL}}/api/transactions/reports/statistics" \
  -H "api-key: {{API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{
  "merchantId": "00000000-0000-0000-0000-000000000001",
  "minCreationTime": "2026-09-01",
  "maxCreationTime": "2026-10-01"
}'

PowerShell

$headers = @{
    'api-key' = '{{API_KEY}}'
}

$body = @'
{
  "merchantId": "00000000-0000-0000-0000-000000000001",
  "minCreationTime": "2026-09-01",
  "maxCreationTime": "2026-10-01"
}
'@

$response = Invoke-RestMethod -Method POST -Uri '{{BASE_URL}}/api/transactions/reports/statistics' `
    -Headers $headers -ContentType 'application/json' -Body $body

npm install @winkpg/winkpg-api

TypeScript (SDK)

import { Configuration, TransactionStatisticsApi } from '@winkpg/winkpg-api';

const api = new TransactionStatisticsApi(new Configuration({
  basePath: '{{BASE_URL}}',
  apiKey: '{{API_KEY}}',
}));

const { data } = await api.transactionStatisticsGetStatistics({
  "merchantId": "00000000-0000-0000-0000-000000000001",
  "minCreationTime": "2026-09-01",
  "maxCreationTime": "2026-10-01"
});

TypeScript (raw HTTP)

const response = await fetch('{{BASE_URL}}/api/transactions/reports/statistics', {
  method: 'POST',
  headers: {
    "api-key": "{{API_KEY}}",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "merchantId": "00000000-0000-0000-0000-000000000001",
    "minCreationTime": "2026-09-01",
    "maxCreationTime": "2026-10-01"
  }),
});

const data = await response.json();

dotnet add package WinkPg.Api.Client

C# (SDK)

using WinkPg.Api.Client.Api;
using WinkPg.Api.Client.Client;
using System.Text.Json;

var config = new Configuration { BasePath = "{{BASE_URL}}" };
config.AddApiKey("api-key", "{{API_KEY}}");

var api = new TransactionStatisticsApi(config);
var body = JsonSerializer.Deserialize<TransactionStatisticsRequestDto>("""
    {
      "merchantId": "00000000-0000-0000-0000-000000000001",
      "minCreationTime": "2026-09-01",
      "maxCreationTime": "2026-10-01"
    }
    """);

var result = await api.TransactionStatisticsGetStatisticsAsync(body);

C# (raw HTTP)

using System.Text;

using var http = new HttpClient { BaseAddress = new Uri("{{BASE_URL}}") };

var request = new HttpRequestMessage(new HttpMethod("POST"), "/api/transactions/reports/statistics");
request.Headers.Add("api-key", "{{API_KEY}}");

request.Content = new StringContent("""
    {
      "merchantId": "00000000-0000-0000-0000-000000000001",
      "minCreationTime": "2026-09-01",
      "maxCreationTime": "2026-10-01"
    }
    """, Encoding.UTF8, "application/json");

var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();

pip install winkpg-api

Python (SDK)

import winkpg_api

configuration = winkpg_api.Configuration(host="{{BASE_URL}}")
configuration.api_key["ApiKey"] = "{{API_KEY}}"

with winkpg_api.ApiClient(configuration) as client:
    api = winkpg_api.TransactionStatisticsApi(client)
    body = winkpg_api.TransactionStatisticsRequestDto.from_dict({
      "merchantId": "00000000-0000-0000-0000-000000000001",
      "minCreationTime": "2026-09-01",
      "maxCreationTime": "2026-10-01"
    })
    result = api.transaction_statistics_get_statistics(body)

pip install requests

Python (raw HTTP)

import requests

headers = {
    "api-key": "{{API_KEY}}",
    "Content-Type": "application/json",
}

body = {
  "merchantId": "00000000-0000-0000-0000-000000000001",
  "minCreationTime": "2026-09-01",
  "maxCreationTime": "2026-10-01"
}

response = requests.request(
    "POST",
    "{{BASE_URL}}/api/transactions/reports/statistics",
    headers=headers,
    json=body,
)
response.raise_for_status()
data = response.json()

Aggregates only sales across every merchant the caller can see, for the same month. The filter uses the vocabulary the transaction list accepts, so a filter built for the list can be sent here unchanged and describes the same rows.

cURL

curl -X POST "{{BASE_URL}}/api/transactions/reports/statistics" \
  -H "api-key: {{API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{
  "minCreationTime": "2026-09-01",
  "maxCreationTime": "2026-10-01",
  "filter": {
    "logic": "And",
    "rules": [
      {
        "field": "TransactionType",
        "operator": "Equals",
        "value": "Sale"
      }
    ]
  }
}'

PowerShell

$headers = @{
    'api-key' = '{{API_KEY}}'
}

$body = @'
{
  "minCreationTime": "2026-09-01",
  "maxCreationTime": "2026-10-01",
  "filter": {
    "logic": "And",
    "rules": [
      {
        "field": "TransactionType",
        "operator": "Equals",
        "value": "Sale"
      }
    ]
  }
}
'@

$response = Invoke-RestMethod -Method POST -Uri '{{BASE_URL}}/api/transactions/reports/statistics' `
    -Headers $headers -ContentType 'application/json' -Body $body

npm install @winkpg/winkpg-api

TypeScript (SDK)

import { Configuration, TransactionStatisticsApi } from '@winkpg/winkpg-api';

const api = new TransactionStatisticsApi(new Configuration({
  basePath: '{{BASE_URL}}',
  apiKey: '{{API_KEY}}',
}));

const { data } = await api.transactionStatisticsGetStatistics({
  "minCreationTime": "2026-09-01",
  "maxCreationTime": "2026-10-01",
  "filter": {
    "logic": "And",
    "rules": [
      {
        "field": "TransactionType",
        "operator": "Equals",
        "value": "Sale"
      }
    ]
  }
});

TypeScript (raw HTTP)

const response = await fetch('{{BASE_URL}}/api/transactions/reports/statistics', {
  method: 'POST',
  headers: {
    "api-key": "{{API_KEY}}",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "minCreationTime": "2026-09-01",
    "maxCreationTime": "2026-10-01",
    "filter": {
      "logic": "And",
      "rules": [
        {
          "field": "TransactionType",
          "operator": "Equals",
          "value": "Sale"
        }
      ]
    }
  }),
});

const data = await response.json();

dotnet add package WinkPg.Api.Client

C# (SDK)

using WinkPg.Api.Client.Api;
using WinkPg.Api.Client.Client;
using System.Text.Json;

var config = new Configuration { BasePath = "{{BASE_URL}}" };
config.AddApiKey("api-key", "{{API_KEY}}");

var api = new TransactionStatisticsApi(config);
var body = JsonSerializer.Deserialize<TransactionStatisticsRequestDto>("""
    {
      "minCreationTime": "2026-09-01",
      "maxCreationTime": "2026-10-01",
      "filter": {
        "logic": "And",
        "rules": [
          {
            "field": "TransactionType",
            "operator": "Equals",
            "value": "Sale"
          }
        ]
      }
    }
    """);

var result = await api.TransactionStatisticsGetStatisticsAsync(body);

C# (raw HTTP)

using System.Text;

using var http = new HttpClient { BaseAddress = new Uri("{{BASE_URL}}") };

var request = new HttpRequestMessage(new HttpMethod("POST"), "/api/transactions/reports/statistics");
request.Headers.Add("api-key", "{{API_KEY}}");

request.Content = new StringContent("""
    {
      "minCreationTime": "2026-09-01",
      "maxCreationTime": "2026-10-01",
      "filter": {
        "logic": "And",
        "rules": [
          {
            "field": "TransactionType",
            "operator": "Equals",
            "value": "Sale"
          }
        ]
      }
    }
    """, Encoding.UTF8, "application/json");

var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();

pip install winkpg-api

Python (SDK)

import winkpg_api

configuration = winkpg_api.Configuration(host="{{BASE_URL}}")
configuration.api_key["ApiKey"] = "{{API_KEY}}"

with winkpg_api.ApiClient(configuration) as client:
    api = winkpg_api.TransactionStatisticsApi(client)
    body = winkpg_api.TransactionStatisticsRequestDto.from_dict({
      "minCreationTime": "2026-09-01",
      "maxCreationTime": "2026-10-01",
      "filter": {
        "logic": "And",
        "rules": [
          {
            "field": "TransactionType",
            "operator": "Equals",
            "value": "Sale"
          }
        ]
      }
    })
    result = api.transaction_statistics_get_statistics(body)

pip install requests

Python (raw HTTP)

import requests

headers = {
    "api-key": "{{API_KEY}}",
    "Content-Type": "application/json",
}

body = {
  "minCreationTime": "2026-09-01",
  "maxCreationTime": "2026-10-01",
  "filter": {
    "logic": "And",
    "rules": [
      {
        "field": "TransactionType",
        "operator": "Equals",
        "value": "Sale"
      }
    ]
  }
}

response = requests.request(
    "POST",
    "{{BASE_URL}}/api/transactions/reports/statistics",
    headers=headers,
    json=body,
)
response.raise_for_status()
data = response.json()

Parameters

Name In Type Description
suppressNulls required query boolean If true, omit properties with null values.
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

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
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
minCreationTime required string (date-time) Inclusive lower bound on the transaction's creation time, in UTC. nullable
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
maxCreationTime required string (date-time) Exclusive upper bound on the transaction's creation time, in UTC. nullable
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
filter required FilterGroup 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.
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

Fields of FilterGroup:

Field Type Description
logic required FilterLogic FilterLogic
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
And
Or
rules required array of FilterRule array of FilterRule nullable
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
groups required array of FilterGroup array of FilterGroup nullable
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

This body has no documented fields.

This request body has no documented fields.

Responses

200 OK

Body: TransactionStatisticsDto TransactionStatisticsDto Each item has these fields.

Field Type Description
transactionCount required integer (int64) The number of matching transactions folded into the three groupings.
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
totalAmount required number (double) The sum of the matching transactions' totals.
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
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.
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
byTransactionType required array of TransactionStatisticsBucketDto array of TransactionStatisticsBucketDto Count and total per transaction type, keyed by the `TransactionType` member name (`Sale`, `Authorization`, `Return`, ...), ordered by descending count. nullable
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

Fields of each TransactionStatisticsBucketDto:

Field Type Description
key required string The bucket key: the enum member name of the grouping this bucket belongs to. nullable
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
count required integer (int64) The number of matching transactions in the bucket.
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
totalAmount required number (double) The sum of the bucket's transaction totals.
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

This body has no documented fields.

byPaymentType required array of TransactionStatisticsBucketDto 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
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

Fields of each TransactionStatisticsBucketDto:

Field Type Description
key required string The bucket key: the enum member name of the grouping this bucket belongs to. nullable
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
count required integer (int64) The number of matching transactions in the bucket.
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
totalAmount required number (double) The sum of the bucket's transaction totals.
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

This body has no documented fields.

byResultCode required array of TransactionStatisticsBucketDto 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
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

Fields of each TransactionStatisticsBucketDto:

Field Type Description
key required string The bucket key: the enum member name of the grouping this bucket belongs to. nullable
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
count required integer (int64) The number of matching transactions in the bucket.
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.
totalAmount required number (double) The sum of the bucket's transaction totals.
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

This body has no documented fields.

This response has no documented body fields.

403 Forbidden

Body: RemoteServiceErrorResponse RemoteServiceErrorResponse Each item has these fields.

Field Type Description
error required RemoteServiceErrorInfo RemoteServiceErrorInfo
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

This response has no documented body fields.

401 Unauthorized

Body: RemoteServiceErrorResponse RemoteServiceErrorResponse Each item has these fields.

Field Type Description
error required RemoteServiceErrorInfo RemoteServiceErrorInfo
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

This response has no documented body fields.

400 Bad Request

Body: RemoteServiceErrorResponse RemoteServiceErrorResponse Each item has these fields.

Field Type Description
error required RemoteServiceErrorInfo RemoteServiceErrorInfo
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

This response has no documented body fields.

404 Not Found

Body: RemoteServiceErrorResponse RemoteServiceErrorResponse Each item has these fields.

Field Type Description
error required RemoteServiceErrorInfo RemoteServiceErrorInfo
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

This response has no documented body fields.

501 Not Implemented

Body: RemoteServiceErrorResponse RemoteServiceErrorResponse Each item has these fields.

Field Type Description
error required RemoteServiceErrorInfo RemoteServiceErrorInfo
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

This response has no documented body fields.

500 Internal Server Error

Body: RemoteServiceErrorResponse RemoteServiceErrorResponse Each item has these fields.

Field Type Description
error required RemoteServiceErrorInfo RemoteServiceErrorInfo
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

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. The error reference lists the values `error.code` can take. 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. The error reference lists the values `error.code` can take.

Body: RemoteServiceErrorResponse RemoteServiceErrorResponse Each item has these fields.

Field Type Description
error required RemoteServiceErrorInfo RemoteServiceErrorInfo
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

This response has no documented body fields.

429 The request was refused because a rate limit was exceeded, or because something a later retry can clear stopped it. A rate limit refusal carries an `application/problem+json` body: 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. Any other refusal carries the standard error envelope as `application/json`, and its `error.code` names the cause.

Body: RemoteServiceErrorResponse RemoteServiceErrorResponse Each item has these fields.

Field Type Description
error required RemoteServiceErrorInfo RemoteServiceErrorInfo
Values: Values combine: send one or more member names separated by a comma and a space, or the integer sum of their values. Responses carry the names.

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.

Codes declared by

Authentication

    Reconnecting to the server

    Could not reconnect

    This session has ended

    Attempt 1

    Your work on this page is still here. Retrying keeps it; reloading starts the page again.

    The server no longer holds this page's state, so it has to be loaded again.