---
title: "get sales channel performance"
method: GET
path: "/api/v1/sales/performance/channels"
tags: ["sales"]
---

# get sales channel performance

`GET /api/v1/sales/performance/channels`

## Request

- Base URL: `https://api.app.tightly.io`
- URL: `https://api.app.tightly.io/api/v1/sales/performance/channels`
- Auth: HTTP bearer

Revenue per sales channel over a window: each channel with its total revenue, the difference against the previous period of the same length, the change as a percentage, and a dated series at the requested granularity.

`start_date` and `end_date` are required and the window may not exceed one year. `sales_channel_ids` narrows the channels, and `granularity` sets the series' step.

A key issued to one account is refused with `account_mismatch`: this read covers every account on the book. That account's own sales are at `GET /sales/table`.

Scope: `sales:read`.

## Query parameters

- `start_date` string, date, required
- `end_date` string, date, required
- `sales_channel_ids` string
- `granularity` 'day' | 'week' | 'month'

## Headers

- `Tightly-Version` string

## Response `200`

Performance by sales channel

- object
  - `data` object
    - `channels` object[]
      - `change_percentage` number, float: Percentage change compared to previous period
      - `channel_name` string: Display name of the sales channel
      - `data` object[]: Time-series data points for the channel
        - `date` string, date: Date of the data point
        - `revenue` number, float: Revenue for this date
      - `period_difference` number, float: Revenue difference compared to previous period
      - `sales_channel_id` string: Unique identifier for the sales channel
      - `total_revenue` number, float: Total revenue for the current period
  - `message` object
    - `desc` string
    - `service` string
    - `severity` string

## Other responses

- `400`: Bad Request - Invalid parameters (e.g., date range exceeds 1 year, invalid date format)
- `401`: No usable key: malformed, unknown, revoked, expired or stopped. One refusal covers all five, telling a caller which is which maps the surface for them. A request with no Authorization header at all is refused 400 before any key is looked for.
- `403`: The key may not reach this operation. `scope_missing` when the key does not hold Sales; `organization_mismatch` when the path names an organisation that is not the key's; `ip_not_allowed` when the caller's address is outside the key's allowlist; `account_mismatch` when the key is issued to one account, because this operation covers every account.
- `429`: The key has spent its allowance for this minute. 600 reads and 120 writes a minute, counted per key, refused calls included. `Retry-After` says how long to wait.
- `500`: Internal Server Error - Database or processing errors
- `503`: The database is briefly out of reach, which is what a failover or a full connection pool looks like from outside. Wait the seconds `Retry-After` names and send the request again. A read is safe to repeat. A write is not, because the connection was lost in the middle of it, so read the object back before sending it a second time. Branch on the status rather than on `code`, which is `POSTGRES_UNAVAILABLE` from one of the two seams that raise this and `SERVICE_UNAVAILABLE` from the other.

---

[API](https://skmtc.dev/tightly/apis/tightly-api.md) · [All operations](https://skmtc.dev/tightly/apis/tightly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tightly/apis/tightly-api/revisions/199f7eb35afb?raw)
