Analytics API overview
Current version: 1.0
For versioning details, read the Versioning guide.
Use the Analytics API to retrieve aggregated commerce data for contacts on a Squarespace merchant site. The API currently returns transaction summaries — order and donation metrics — grouped by contact, making it useful for segmentation, reporting, and CRM enrichment workflows.
Note: In the old Profiles API, transaction summary data is embedded inline on each
Profileresource. The Analytics API provides the same information as a standalone, dedicated endpoint that accepts contact IDs from the Contacts API and returns summaries in bulk — up to 1,000 contacts per request.
API resources
Transaction summaries
TransactionsSummary provides an aggregated view of a contact's commerce activity on the site. Each summary includes:
firstOrderSubmittedOn— when the contact's first order was placedlastOrderSubmittedOn— when the contact's most recent order was placedorderCount— total number of orderstotalOrderAmount— grand total across all orderstotalRefundAmount— total value of all refundsfirstDonationSubmittedOn— when the contact's first donation was submittedlastDonationSubmittedOn— when the contact's most recent donation was submitteddonationCount— total number of donationstotalDonationAmount— grand total across all donations
Monetary amounts are returned as MonetaryAmount objects (value and currency).
Asynchronous computation
Transaction summary data is computed asynchronously. There may be a delay between when an order or donation is submitted and when it is reflected in the summary. Integrations with the endpoint should be built in a way that tolerates this eventual consistency.
How it works
The Analytics API exposes a single endpoint that accepts a list of contact IDs and returns a transaction summary for each:
- Retrieve contact IDs — either by listing contacts via the Contacts API, or by extracting
customerIdfrom orders. - Post up to 1,000 contact IDs to the transaction summaries endpoint, specifying
groupBy: "contactId". - Receive a
TransactionsSummaryWrapperfor each contact, containing thecontactIdand itsTransactionsSummary.
Contacts with no commerce activity will return a summary with zero counts and null date fields.
Cross-API relationships
| API | Field | Relationship |
|---|---|---|
| Contacts | id | Pass contact id values as contactIds in the request. |
| Profiles | id | A profile's id is the same identifier. The Profiles API includes a TransactionsSummary inline; the Analytics API provides the same data via a dedicated bulk endpoint. |
| Orders | customerId | The customerId on an Order corresponds to a contact id. Use it to look up transaction summaries after processing orders. |
Common workflows
CRM segmentation by spend
Query contacts using the Contacts API to identify a cohort (e.g. contacts who accept marketing), then pass their IDs to the Analytics API to retrieve order totals and donation counts for segmentation.
Lifetime value reporting
Periodically fetch transaction summaries for all active contacts to build lifetime value (LTV) reports, using totalOrderAmount and orderCount as the core metrics.
Post-order enrichment
After receiving an order webhook, use the customerId to fetch an updated transaction summary, then sync the contact's commerce metrics back to an external CRM or analytics platform.
Further reading
- Learn about the Contacts API, which provides the contact records referenced by this API
- Become familiar with common commerce terms and how they're related to the API
- Obtain an API key or use OAuth
- Read the FAQ guide for answers to common questions