---
title: "Retrieve transaction summaries grouped by contact"
method: POST
path: "/v1/analytics/transaction-summaries"
tags: ["Analytics"]
---

# Retrieve transaction summaries grouped by contact

`POST /v1/analytics/transaction-summaries`

## Request

- Base URL: `https://api.squarespace.com`
- URL: `https://api.squarespace.com/v1/analytics/transaction-summaries`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/squarespace/apis/commerce-api/docs/v1/analytics/transaction-summaries/post.ts> (a function with typed inputs; its response is checked against the schema)

## Headers

- `Authorization` string, required
- `User-Agent` string, required

## Request body

- RetrieveTransactionsSummariesRequest
  - `contactIds` string[], required
  - `groupBy` 'contactId', required: Field to group results by, should be a contactId

## Response `200`

Transaction summaries retrieved

- RetrieveTransactionsSummariesResponse
  - `transactionsSummaryWrappers` TransactionsSummaryWrapper[]: List of transaction summary wrappers
    - `contactId` string: Unique contact identifier
    - `transactionsSummary` TransactionsSummary: Summary of profile's commerce transactions. If a profile has no commerce transactions, the object is still returned with null or 0 values. This information is calculated asynchronously; there may be a slight delay between when an order is created, and when it's reflected in the object.
      - `donationCount` integer: Count of donations submitted.
      - `firstDonationSubmittedOn` string, date-time: ISO 8601 UTC date and time string; represents when the profile's first donation was submitted.
      - `firstOrderSubmittedOn` string, date-time: ISO 8601 UTC date and time string; represents when the profile's first order was submitted.
      - `lastDonationSubmittedOn` string, date-time: ISO 8601 UTC date and time string; represents when the profile's latest donation was submitted.
      - `lastOrderSubmittedOn` string, date-time: ISO 8601 UTC date and time string; represents when the profile's latest order was submitted.
      - `orderCount` integer: Count of orders submitted.
      - `totalDonationAmount` MonetaryAmount: A monetary amount with currency code and decimal value.
        - `currency` object: ISO 4217 currency code.
          - `currencyCode` string
          - `defaultFractionDigits` integer
          - `displayName` string
          - `numericCode` integer
          - `numericCodeAsString` string
          - `symbol` string
        - `value` number: Decimal monetary value.
      - `totalOrderAmount` MonetaryAmount: A monetary amount with currency code and decimal value.
        - `currency` object: ISO 4217 currency code.
          - `currencyCode` string
          - `defaultFractionDigits` integer
          - `displayName` string
          - `numericCode` integer
          - `numericCodeAsString` string
          - `symbol` string
        - `value` number: Decimal monetary value.
      - `totalRefundAmount` MonetaryAmount: A monetary amount with currency code and decimal value.
        - `currency` object: ISO 4217 currency code.
          - `currencyCode` string
          - `defaultFractionDigits` integer
          - `displayName` string
          - `numericCode` integer
          - `numericCodeAsString` string
          - `symbol` string
        - `value` number: Decimal monetary value.

## Other responses

- `400`: contactIds shouldn't be empty or too big, groupBy should have a valid value

---

[API](https://skmtc.dev/squarespace/apis/commerce-api.md) - [All operations](https://skmtc.dev/squarespace/apis/commerce-api/llms.txt) - [OpenAPI document](https://skmtc.dev/squarespace/apis/commerce-api/revisions/5dd4b1b7cd38?raw)
