Get Best Customers vs the Rest
Splits the customers who bought in the period into the best ones (best: the top fifth by revenue in the period, NTILE(5) over revenue per customer) and the others (rest), and compares the two: share of customers, share of revenue, orders per customer and average ticket. Aggregates only: no customer identifier or personal data is returned. Revenue is the official one (SUM(revenue) of analytics.fct_transactions, days in UTC). Sales without a customer identity (e.g. marketplace orders) are in no segment: unidentified says how much revenue and how many orders they are, and segment shares are over the identified base (identifiedCustomers, identifiedRevenue). With fewer than 5 identified customers the best group is 1 customer, so read customerShare instead of assuming 20%. Both dates are required; the period spans at most 366 days.
ClientIdAuthClientSecretAuthx-client-id<token>Client ID
x-client-secret<token>Client secret
organizationId*stringOrganization identifier (required)
startDate*stringFirst day of the period, inclusive (YYYY-MM-DD, UTC). Required.
dateendDate*stringLast day of the period, inclusive (YYYY-MM-DD, UTC). Required. At most 366 days from startDate.
dategtmMotionId?stringGTM motion of the organization (UUID), as listed by GET /v1/gtm-motions. Optional: without it, the response covers the organization's default GTM motion. This endpoint is not split by GTM motion yet: the default motion is answered with the organization's data, the same numbers as when the parameter is omitted, and any other GTM motion of the organization returns 422 GTM_MOTION_DATA_NOT_AVAILABLE. Not a UUID: 400. Not a live GTM motion of the organization: 403 GTM_MOTION_NOT_IN_ORGANIZATION.
uuidCustomer segments retrieved successfully
application/json- response
period*totalRevenue*numberRevenue of every sale of the period: identifiedRevenue + unidentified.revenue
identifiedCustomers*integerCustomers with an identity who bought in the period (the base of the segments)
identifiedRevenue*numberRevenue of the sales with a customer identity
segments*array<>Always two items, best then rest; zeros when the period has no identified sale
unidentified*Sales without a customer identity, left out of the segments
curl -X GET "https://example.com/v1/profitability/customer-segments?organizationId=c0ad4763-173e-4a05-9cff-5208c8ea5f6a&startDate=2025-11-01&endDate=2026-10-31>mMotionId=019a5b2e-7c4d-7abc-8def-0123456789ab"{ "period": { "startDate": "2025-11-01", "endDate": "2026-10-31" }, "totalRevenue": 43100000, "identifiedCustomers": 48200, "identifiedRevenue": 41047120, "segments": [ { "key": "best", "customers": 9640, "customerShare": 20, "revenue": 23807329.6, "revenueShare": 58, "orders": 27956, "ordersPerCustomer": 2.9, "averageTicket": 851.6 }, { "key": "rest", "customers": 38560, "customerShare": 80, "revenue": 17239790.4, "revenueShare": 42, "orders": 42416, "ordersPerCustomer": 1.1, "averageTicket": 406.45 } ], "unidentified": { "revenue": 2052880, "revenueShare": 4.76, "orders": 3310 }}