Skip to main content
The Analytics API provides organization-level business intelligence — revenue trends, order volumes, top performers, and customer activity. All analytics endpoints require the Admin role. Your OrganizationId is automatically scoped from your JWT, so every response only ever contains data for your own organization.

Common query parameters

All analytics endpoints accept the following query parameters:
ParameterTypeRequiredDescription
startDateDateTimeOffsetYesStart of the reporting window (ISO 8601, e.g. 2024-01-01T00:00:00Z)
endDateDateTimeOffsetYesEnd of the reporting window (ISO 8601, e.g. 2024-01-31T23:59:59Z)
organizationIdstringAutomatically injected from your JWT OrganizationId claim. Do not pass this manually.
All dates are interpreted in UTC. Pass a timezone offset (e.g. -05:00) if you need to align windows to a local business day.

GET /api/analytics/revenue

Returns total revenue for your organization within the specified date range. Security: Admin policy

Query parameters

startDate
DateTimeOffset
required
Start of the reporting window.
endDate
DateTimeOffset
required
End of the reporting window.

Response

totalRevenue
decimal
Total revenue earned during the period.
currencyCode
string
ISO 4217 currency code (e.g. USD).
Example response
{
  "totalRevenue": 128450.75,
  "currencyCode": "USD"
}
curl example
curl -X GET \
  "https://api.achievemomentum.com/api/analytics/revenue?startDate=2024-01-01T00:00:00Z&endDate=2024-01-31T23:59:59Z" \
  -H "Authorization: Bearer <your_token>"

GET /api/analytics/revenue/trend

Returns monthly revenue trend data grouped by period within the specified date range. Security: Admin policy

Query parameters

startDate
DateTimeOffset
required
Start of the reporting window.
endDate
DateTimeOffset
required
End of the reporting window.

Response

Returns an array of monthly revenue data points.
date
string
Period start date (ISO 8601).
revenue
decimal
Total revenue for the period.
Example response
[
  { "date": "2024-01-01T00:00:00Z", "revenue": 42150.00 },
  { "date": "2024-02-01T00:00:00Z", "revenue": 38900.50 },
  { "date": "2024-03-01T00:00:00Z", "revenue": 47400.25 }
]
curl example
curl -X GET \
  "https://api.achievemomentum.com/api/analytics/revenue/trend?startDate=2024-01-01T00:00:00Z&endDate=2024-03-31T23:59:59Z" \
  -H "Authorization: Bearer <your_token>"

GET /api/analytics/orders/trend

Returns monthly order count trend data grouped by period within the specified date range. Security: Admin policy

Query parameters

startDate
DateTimeOffset
required
Start of the reporting window.
endDate
DateTimeOffset
required
End of the reporting window.

Response

Returns an array of monthly order count data points.
date
string
Period start date (ISO 8601).
orderCount
integer
Number of orders placed during the period.
Example response
[
  { "date": "2024-01-01T00:00:00Z", "orderCount": 312 },
  { "date": "2024-02-01T00:00:00Z", "orderCount": 289 },
  { "date": "2024-03-01T00:00:00Z", "orderCount": 347 }
]

GET /api/analytics/orders/mtd

Returns the number of orders placed month-to-date, along with a comparison to the previous month. Security: Admin policy

Query parameters

startDate
DateTimeOffset
required
Start of the reporting window (typically the first day of the current month).
endDate
DateTimeOffset
required
End of the reporting window (typically today).

Response

count
integer
Number of orders placed in the current month-to-date window.
previousMonthCount
integer
Number of orders placed in the equivalent window of the previous month.
percentChange
decimal
Percentage change compared to the previous month. Negative values indicate a decline.
Example response
{
  "count": 142,
  "previousMonthCount": 128,
  "percentChange": 10.94
}

GET /api/analytics/aov

Returns the average order value for your organization within the specified date range. Security: Admin policy

Query parameters

startDate
DateTimeOffset
required
Start of the reporting window.
endDate
DateTimeOffset
required
End of the reporting window.

Response

averageOrderValue
decimal
Average monetary value per order during the period.
currencyCode
string
ISO 4217 currency code (e.g. USD).
Example response
{
  "averageOrderValue": 412.50,
  "currencyCode": "USD"
}

GET /api/analytics/active-customers

Returns the count of customers who placed at least one order during the specified period, plus a percentage change compared to the previous equivalent period. Security: Admin policy

Query parameters

startDate
DateTimeOffset
required
Start of the reporting window.
endDate
DateTimeOffset
required
End of the reporting window.

Response

activeCustomers
integer
Number of unique customers who placed at least one order during the period.
percentChange
decimal
Percentage change in active customers compared to the previous equivalent period.
Example response
{
  "activeCustomers": 87,
  "percentChange": 5.48
}
curl example
curl -X GET \
  "https://api.achievemomentum.com/api/analytics/active-customers?startDate=2024-01-01T00:00:00Z&endDate=2024-01-31T23:59:59Z" \
  -H "Authorization: Bearer <your_token>"

GET /api/analytics/products/top-by-revenue

Returns the top N products ranked by revenue within the specified date range. Security: Admin policy

Query parameters

startDate
DateTimeOffset
required
Start of the reporting window.
endDate
DateTimeOffset
required
End of the reporting window.
limit
integer
default:"10"
Maximum number of products to return. Defaults to 10.

Response

Returns an array of product revenue rankings.
productId
string
Unique identifier of the product.
sku
string
Product SKU.
name
string
Product display name.
revenue
decimal
Total revenue generated by this product during the period.
unitsOrdered
integer
Total units ordered during the period.
Example response
[
  {
    "productId": "prod_abc123",
    "sku": "WDG-001",
    "name": "Premium Widget",
    "revenue": 18450.00,
    "unitsOrdered": 246
  },
  {
    "productId": "prod_def456",
    "sku": "GDG-002",
    "name": "Standard Gadget",
    "revenue": 12300.50,
    "unitsOrdered": 410
  }
]
curl example
curl -X GET \
  "https://api.achievemomentum.com/api/analytics/products/top-by-revenue?startDate=2024-01-01T00:00:00Z&endDate=2024-01-31T23:59:59Z&limit=5" \
  -H "Authorization: Bearer <your_token>"

GET /api/analytics/customers/top-by-revenue

Returns the top N customers ranked by revenue within the specified date range. Security: Admin policy

Query parameters

startDate
DateTimeOffset
required
Start of the reporting window.
endDate
DateTimeOffset
required
End of the reporting window.
limit
integer
default:"10"
Maximum number of customers to return. Defaults to 10.

Response

Returns an array of customer revenue rankings.
customerNumber
string
The customer’s account number.
companyName
string
The customer’s company name.
revenue
decimal
Total revenue from this customer during the period.
orderCount
integer
Number of orders placed by this customer during the period.
Example response
[
  {
    "customerNumber": "CUST-0042",
    "companyName": "Acme Corp",
    "revenue": 24800.00,
    "orderCount": 18
  },
  {
    "customerNumber": "CUST-0017",
    "companyName": "Globex Industries",
    "revenue": 19100.75,
    "orderCount": 12
  }
]

GET /api/analytics/categories/top-by-revenue

Returns the top N product categories ranked by revenue within the specified date range. Security: Admin policy

Query parameters

startDate
DateTimeOffset
required
Start of the reporting window.
endDate
DateTimeOffset
required
End of the reporting window.
limit
integer
default:"10"
Maximum number of categories to return. Defaults to 10.

Response

Returns an array of category revenue rankings.
categoryId
string
Unique identifier of the category.
name
string
Category display name.
revenue
decimal
Total revenue generated by products in this category during the period.
Example response
[
  { "categoryId": "cat_001", "name": "Widgets", "revenue": 52300.00 },
  { "categoryId": "cat_002", "name": "Gadgets", "revenue": 38700.50 }
]

GET /api/analytics/sales-reps/top-by-revenue

Returns the top N sales representatives ranked by revenue within the specified date range. Security: Admin policy

Query parameters

startDate
DateTimeOffset
required
Start of the reporting window.
endDate
DateTimeOffset
required
End of the reporting window.
limit
integer
default:"10"
Maximum number of sales reps to return. Defaults to 10.

Response

Returns an array of sales rep revenue rankings.
salesRepNumber
string
The sales rep’s representative number.
name
string
Full name of the sales representative.
revenue
decimal
Total revenue attributed to this sales rep during the period.
orderCount
integer
Number of orders attributed to this sales rep during the period.
Example response
[
  {
    "salesRepNumber": "REP-001",
    "name": "Jane Smith",
    "revenue": 31200.00,
    "orderCount": 54
  },
  {
    "salesRepNumber": "REP-002",
    "name": "Bob Johnson",
    "revenue": 27400.50,
    "orderCount": 41
  }
]
curl example
curl -X GET \
  "https://api.achievemomentum.com/api/analytics/sales-reps/top-by-revenue?startDate=2024-01-01T00:00:00Z&endDate=2024-01-31T23:59:59Z&limit=5" \
  -H "Authorization: Bearer <your_token>"