openapi: 3.2.0 info: title: Commerce Analytics API version: '2' description: Query analytics for a website servers: - url: https://api.squarespace.com description: Commerce API security: - Authorization: [] tags: - description: Query analytics for a website name: Analytics x-zudoku-collapsed: true paths: /v1/analytics/transaction-summaries: post: operationId: getTransactionsSummaries requestBody: content: application/json: schema: $ref: '#/components/schemas/RetrieveTransactionsSummariesRequest' required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/RetrieveTransactionsSummariesResponse' description: Transaction summaries retrieved '400': description: contactIds shouldn't be empty or too big, groupBy should have a valid value summary: Retrieve transaction summaries grouped by contact tags: - Analytics parameters: - in: header name: Authorization required: true description: API key or OAuth access token schema: type: string default: Bearer YOUR_API_KEY_OR_OAUTH_TOKEN - in: header name: User-Agent required: true description: User Agent schema: type: string default: YOUR_CUSTOM_APP_DESCRIPTION components: schemas: RetrieveTransactionsSummariesResponse: type: object properties: transactionsSummaryWrappers: type: array description: List of transaction summary wrappers items: $ref: '#/components/schemas/TransactionsSummaryWrapper' TransactionsSummary: type: object properties: donationCount: type: integer description: Count of donations submitted. format: int32 firstDonationSubmittedOn: type: string description: ISO 8601 UTC date and time string; represents when the profile's first donation was submitted. format: date-time firstOrderSubmittedOn: type: string description: ISO 8601 UTC date and time string; represents when the profile's first order was submitted. format: date-time lastDonationSubmittedOn: type: string description: ISO 8601 UTC date and time string; represents when the profile's latest donation was submitted. format: date-time lastOrderSubmittedOn: type: string description: ISO 8601 UTC date and time string; represents when the profile's latest order was submitted. format: date-time orderCount: type: integer description: Count of orders submitted. format: int32 totalDonationAmount: $ref: '#/components/schemas/MonetaryAmount' totalOrderAmount: $ref: '#/components/schemas/MonetaryAmount' totalRefundAmount: $ref: '#/components/schemas/MonetaryAmount' description: 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. RetrieveTransactionsSummariesRequest: required: - contactIds - groupBy type: object properties: contactIds: maxItems: 1000 minItems: 1 type: array items: type: string description: Unique contactId groupBy: minLength: 1 type: string description: Field to group results by, should be a contactId enum: - contactId examples: - contactId TransactionsSummaryWrapper: type: object properties: contactId: type: string description: Unique contact identifier examples: - a6e74e0c-2b4a-4b63-b4a3-9c5d1f3e8a7b transactionsSummary: $ref: '#/components/schemas/TransactionsSummary' description: List of transaction summary wrappers MonetaryAmount: type: object properties: currency: type: object description: ISO 4217 currency code. properties: currencyCode: type: string defaultFractionDigits: type: integer format: int32 displayName: type: string numericCode: type: integer format: int32 numericCodeAsString: type: string symbol: type: string examples: - USD value: type: number description: Decimal monetary value. examples: - 49.99 description: A monetary amount with currency code and decimal value. securitySchemes: Authorization: in: header scheme: bearer type: http