---
title: "SubscriptionCalculation"
method: POST
path: "/workspaces/{workspace_id}/subscription/calculate"
tags: ["subscription"]
---

# SubscriptionCalculation

`POST /workspaces/{workspace_id}/subscription/calculate`

## Request

- Base URL: `https://localhost:8080/api/v9`
- URL: `https://localhost:8080/api/v9/workspaces/{workspace_id}/subscription/calculate`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/toggl/apis/toggl-api/docs/workspaces/:workspace_id/subscription/calculate/post.ts> (a function with typed inputs; its response is checked against the schema)

Returns calculation of the subscription price for given pricing plan, period count, user count, currency, taxes etc.

## Path parameters

- `workspace_id` integer, required

## Request body

- SubscriptionCalculateRequest
  - `period` integer, required: Can be only 1 or 12
  - `pricing_plan_id` integer, required
  - `user_count` integer, required

## Response `200`

Successful operation.

- SubscriptionCalculatedData
  - `calculation` string
  - `currency` string
  - `period` integer
  - `tax_percentage` integer
  - `total_amount` integer

## Other responses

- `400`: Possible error messages: * workspace has no subscription * Invalid subscription * user\_count must be greater than 0 * period can be 1 or 12 * pricing\_plan\_id is not valid
- `404`: Possible error messages: * workspace\_id is not valid * workspace has no customer * unknown currency
- `500`: Internal Server Error

---

[API](https://skmtc.dev/toggl/apis/toggl-api.md) - [All operations](https://skmtc.dev/toggl/apis/toggl-api/llms.txt) - [OpenAPI document](https://skmtc.dev/toggl/apis/toggl-api/revisions/3085aee16990?raw)
