# Analytics

A store's sales, sales breakdowns and fulfillment for a period. Sales leave out
cancelled, unpaid and test orders. Traffic sources, referrers, product views and
carts aren't recorded. Needs a plan with analytics.

All paths are relative to the base URL https://api.store.link/v1. Every request
needs your API key; see Overview
[https://store.link/help/developer/article/1165].


ENDPOINTS

EndpointWhat it doesGET /stores/{storeId}/analytics/salesGet a sales summaryGET
/stores/{storeId}/analytics/sales/breakdownBreak down salesGET
/stores/{storeId}/analytics/fulfillmentGet a fulfillment summary


PERIODS

Every analytics endpoint takes the same period parameters:

NameTypeDescriptionperiodstringcustom takes start_date and end_date. One of:
today, last7days, lastweek, thismonth, last30days, lastmonth, last90days,
custom. Default: last90days.start_datestring (date)With period custom. Format:
YYYY-MM-DD.end_datestring (date)With period custom. Format:
YYYY-MM-DD.timezonestringThe IANA timezone the period is in, e.g.
America/New_York. Default: UTC.

Responses echo period and timezone, and give the period's start_date and
end_date (YYYY-MM-DD) in that timezone.


GET A SALES SUMMARY

GET /stores/{storeId}/analytics/sales

Orders, sales, average order value, visitors, conversion rate and searches for a
period, the 10 products sold most, and orders, sales and visitors over time.
With compare, the same for the period before or the same period a year earlier.

Your role in the store needs to read analytics.


PATH PARAMETERS

NameTypeDescriptionstoreIdstring
requiredA store id from GET /stores.


QUERY PARAMETERS

NameTypeDescriptionperiod, start_date, end_date, timezoneSee Periods
above.comparestringAlso return the period to compare with. One of:
previous_period, previous_year.


EXAMPLE REQUEST

curl 'https://api.store.link/v1/stores/665f1c2ab4e8a90012ab34cd/analytics/sales?period=thismonth&timezone=America/New_York&compare=previous_period' \
  -H 'Authorization: Bearer YOUR_API_KEY'


RESPONSE

FieldTypeDescriptionperiodstringThe period asked for.timezonestringThe IANA
timezone the period and its dates are in.currencystring, nullableISO 4217
code.currentobjectcurrent.start_datestring (date)current.end_datestring
(date)current.ordersintegercurrent.salesnumbercurrent.average_order_valuenumbercurrent.visitorsintegercurrent.conversion_ratenumber,
nullableOrders per 100 visitors; null without
visitors.current.searchesobjectcurrent.searches.totalintegercurrent.searches.top_termsarray
of objectAt most 10, most searched
first.current.searches.top_terms[].termstringcurrent.searches.top_terms[].searchesintegercurrent.searches.top_terms[].without_resultsintegercurrent.searches.terms_without_resultsarray
of objectAt most 10, most searched
first.current.searches.terms_without_results[].termstringcurrent.searches.terms_without_results[].searchesintegercurrent.top_productsarray
of objectAt most 10, by units sold. GET /analytics/sales/breakdown?by=product
has
more.current.top_products[].namestringcurrent.top_products[].quantitynumbercurrent.over_timeobjectcurrent.over_time.intervalstringhour
for periods of 2 days or less, month for periods over 3 months, else day. One
of: hour, day, month.current.over_time.rowsarray of objectOldest first, leaving
out intervals with no orders or visits.current.over_time.rows[].startstringThe
start of the interval in the timezone: 2026-10-12T14:00, 2026-10-12 or
2026-10.current.over_time.rows[].ordersintegercurrent.over_time.rows[].salesnumbercurrent.over_time.rows[].visitorsinteger,
nullablenull on hourly rows, as visits are counted per day.previousobject,
nullableThe period compared with, when compare is set, with the same fields as
current.


EXAMPLE RESPONSE

{
  "period": "thismonth",
  "timezone": "America/New_York",
  "currency": "USD",
  "current": {
    "start_date": "2026-11-01",
    "end_date": "2026-11-23",
    "orders": 48,
    "sales": 1250,
    "average_order_value": 26.04,
    "visitors": 1600,
    "conversion_rate": 3,
    "searches": {
      "total": 120,
      "top_terms": [
        { "term": "tee", "searches": 34, "without_results": 0 }
      ],
      "terms_without_results": [
        { "term": "hoodie", "searches": 9 }
      ]
    },
    "top_products": [
      { "name": "Classic Tee", "quantity": 31 }
    ],
    "over_time": {
      "interval": "day",
      "rows": [
        { "start": "2026-11-01", "orders": 3, "sales": 75, "visitors": 82 }
      ]
    }
  },
  "previous": {
    "start_date": "2026-10-09",
    "end_date": "2026-10-31",
    "orders": 41,
    "sales": 1080,
    "average_order_value": 26.34,
    "visitors": 1450,
    "conversion_rate": 2.83,
    "searches": { "total": 98, "top_terms": [], "terms_without_results": [] },
    "top_products": [],
    "over_time": { "interval": "day", "rows": [] }
  }
}


ERRORS

 * 403 plan_upgrade_required: The store's plan doesn't include this. The message
   names the plan it needs.

Plus the common errors: 400 invalid_request, 401 unauthorized, 403
insufficient_permission, 404 store_not_found, 429 rate_limited, 500
internal_error. See Errors in the Overview
[https://store.link/help/developer/article/1165].


BREAK DOWN SALES

GET /stores/{storeId}/analytics/sales/breakdown

A period's sales grouped by one dimension: orders, units, sales and share of the
period's sales per row, best first.

 * product: units and item sales per product
 * variant: per product variant, e.g. a size or colour
 * category: per product category; a product in two categories counts in both,
   so shares can add up past 100%
 * product_pair: products bought together, among the 50 products in the most
   orders, ranked by the orders that had both; units and sales are those two
   products' lines, so shares can add up past 100%
 * coupon: per coupon code, with the discount given
 * payment_method: per payment method
 * shipping_method: per shipping or pickup method
 * customer_type: customers whose first order fell in the period (new) vs those
   who ordered before (returning), and orders without a customer account;
   customers counts accounts
 * customer: top customers by what they spent; needs permission to read orders
 * weekday: per day of the week, Monday to Sunday
 * hour: per hour of the day, 00:00 to 23:00

weekday and hour return every row in calendar order, in the timezone, and ignore
limit and sort_by.

Your role in the store needs to read analytics.


PATH PARAMETERS

NameTypeDescriptionstoreIdstring
requiredA store id from GET /stores.


QUERY PARAMETERS

NameTypeDescriptionbystring
requiredOne of: product, variant, category, product_pair, coupon,
payment_method, shipping_method, customer_type, customer, weekday, hour.period,
start_date, end_date, timezoneSee Periods above.sort_bystringDefault sales, and
orders for product_pair. One of: sales, units, orders.limitintegerRows to
return. Default: 10. 1 to 50.


EXAMPLE REQUEST

curl 'https://api.store.link/v1/stores/665f1c2ab4e8a90012ab34cd/analytics/sales/breakdown?by=product&period=last30days' \
  -H 'Authorization: Bearer YOUR_API_KEY'


RESPONSE

FieldTypeDescriptionbystringThe dimension asked for.periodstringThe period asked
for.timezonestringThe IANA timezone the period and its dates are
in.start_datestring (date)end_datestring (date)currencystring, nullableISO 4217
code.basisstringitem: sales are item sales, before shipping and after item
discounts. order: sales are order totals. One of: item, order.sorted_bystringOne
of: sales, units, orders,
calendar.totalsobjecttotals.ordersintegertotals.unitsnumbertotals.salesnumbertotal_groupsintegerRows
there are, before limit.rowsarray of objectrows[].keystring or number or array
of string, nullableproduct: a product slug, or its name when the order has none.
variant: a cart item id. category, coupon, payment_method and shipping_method:
the name or code, null for none. product_pair: two product keys. customer_type:
new, returning or no_account. customer: a customer id, null for orders without
one. weekday: 1 (Monday) to 7. hour: 0 to 23.rows[].labelstring,
nullablerows[].ordersintegerrows[].unitsnumberrows[].salesnumberrows[].sharenumberPercent
of the period's sales. category and product_pair shares can add up past
100.rows[].average_order_valuenumber, nullableOn the order basis; null on the
item basis.rows[].discountnumber, nullableby coupon: the discount given. null
otherwise.rows[].customersinteger, nullableby customer_type: customer accounts.
null otherwise.


EXAMPLE RESPONSE

{
  "by": "product",
  "period": "last30days",
  "timezone": "UTC",
  "start_date": "2026-10-25",
  "end_date": "2026-11-23",
  "currency": "USD",
  "basis": "item",
  "sorted_by": "sales",
  "totals": {
    "orders": 48,
    "units": 96,
    "sales": 1250
  },
  "total_groups": 8,
  "rows": [
    {
      "key": "classic-tee",
      "label": "Classic Tee",
      "orders": 22,
      "units": 31,
      "sales": 620,
      "share": 49.6,
      "average_order_value": null,
      "discount": null,
      "customers": null
    }
  ]
}


ERRORS

 * 403 plan_upgrade_required: The store's plan doesn't include this. The message
   names the plan it needs.

Plus the common errors: 400 invalid_request, 401 unauthorized, 403
insufficient_permission, 404 store_not_found, 429 rate_limited, 500
internal_error. See Errors in the Overview
[https://store.link/help/developer/article/1165].


GET A FULFILLMENT SUMMARY

GET /stores/{storeId}/analytics/fulfillment

For orders placed in a period: how many were cancelled, the cancellation rate,
and the median and average hours from an order being placed to its first shipped
or completed status. Unpaid and test orders are not placed orders, and ship
times leave out cancelled orders.

Your role in the store needs to read analytics.


PATH PARAMETERS

NameTypeDescriptionstoreIdstring
requiredA store id from GET /stores.


QUERY PARAMETERS

NameTypeDescriptionperiod, start_date, end_date, timezoneSee Periods above.


EXAMPLE REQUEST

curl 'https://api.store.link/v1/stores/665f1c2ab4e8a90012ab34cd/analytics/fulfillment?period=custom&start_date=2026-11-01&end_date=2026-11-23' \
  -H 'Authorization: Bearer YOUR_API_KEY'


RESPONSE

FieldTypeDescriptionperiodstringThe period asked for.timezonestringThe IANA
timezone the period and its dates are in.start_datestring (date)end_datestring
(date)placed_ordersintegercancelled_ordersintegercancellation_ratenumber,
nullablePercent of placed orders; null without any.shipped_ordersintegerOrders
that reached shipped or completed, leaving out cancelled
ones.median_hours_to_shipnumber, nullableaverage_hours_to_shipnumber, nullable


EXAMPLE RESPONSE

{
  "period": "custom",
  "timezone": "UTC",
  "start_date": "2026-11-01",
  "end_date": "2026-11-23",
  "placed_orders": 50,
  "cancelled_orders": 1,
  "cancellation_rate": 2,
  "shipped_orders": 45,
  "median_hours_to_ship": 18,
  "average_hours_to_ship": 22.5
}


ERRORS

 * 403 plan_upgrade_required: The store's plan doesn't include this. The message
   names the plan it needs.

Plus the common errors: 400 invalid_request, 401 unauthorized, 403
insufficient_permission, 404 store_not_found, 429 rate_limited, 500
internal_error. See Errors in the Overview
[https://store.link/help/developer/article/1165].