---
title: "Plan performance"
method: GET
path: "/v1/analytics/plan-performance"
tags: ["Analytics"]
---

# Plan performance

`GET /v1/analytics/plan-performance`

## Request

- Base URL: `https://api.subscriby.net`
- URL: `https://api.subscriby.net/v1/analytics/plan-performance`
- Auth: HTTP bearer

A per-plan breakdown for one project: active subscribers, revenue in the window, payments in the window and the average ticket. `project_id` is **required**.

```bash
curl "https://api.subscriby.net/v1/analytics/plan-performance?project_id=$PROJECT_ID&period=30d" \
  -H "Authorization: Bearer $SUBSCRIBY_TOKEN"
```

Figures are in the plan's own currency. `meta.range` is the window the preset resolved to.

## Query parameters

- `project_id` string, uuid, required
- `period` string
- `from` string, date
- `to` string, date

## Response `200`

Per-plan activity in the plan's own currency.

- object
  - `data` object[], required: The items.
    - `plan_id` string, required: The plan.
    - `plan_name` string, required: The plan's name.
    - `active_subscribers` integer, required: Subscriptions on the plan that are active right now.
    - `payments_in_window` integer, required: Settled payments on the plan inside the window.
    - `revenue_in_window` string, required: Those payments summed, as a decimal string in the plan's own currency.
    - `avg_ticket` string, required: `revenue_in_window` divided by `payments_in_window`, as a decimal string.
  - `meta` object, required: The request's project and window, echoed back.
    - `project_id` string, required: The project, as requested.
    - `period` string, required: The preset the window resolved from, as requested.
    - `range` object, required: The window the preset resolved to.
      - `from` string, required: The first day of the window, `YYYY-MM-DD`.
      - `to` string, required: The last day of the window, `YYYY-MM-DD`.

## Other responses

- `401`: `AUTHENTICATION_REQUIRED`: the request carries no bearer token, or one that is revoked, malformed, or minted for another environment (an `sbt_test_` token on production).
- `403`: `TOKEN_MISSING_ABILITY`: the token is valid but does not carry the ability this endpoint requires; `error.context.required_ability` names the one to grant. An endpoint that also checks who owns a row or which tier the account is on answers `FORBIDDEN`, `TEAM_TIER_REQUIRED` or `CONNECTOR_TIER_REQUIRED` with the same status, and says so in its own description.
- `422`: `VALIDATION_FAILED`: when `project_id` is missing or not a UUID.
- `429`: `RATE_LIMITED`: the token has spent its 300 requests a minute or 10,000 an hour; `Retry-After` says when the next one is accepted.

---

[API](https://skmtc.dev/memberpass/apis/subscriby-rest-api.md) · [All operations](https://skmtc.dev/memberpass/apis/subscriby-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/memberpass/apis/subscriby-rest-api/revisions/59c4df91d764?raw)
