Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Account

Get the numbers of the company

The company of the key's workspace and the numbers of each of its workspaces in a period: the revenue, the refunds and the profit by currency, the MRR, the paying customers, the customers at risk, the open disputes, its plan at Troopy and its troop. The total is in the currency of the company. Days are UTC. Without from and to, the period is this month. A key reads only its own company. Needs an owner or admin.

get/api/v1/company/overview

Authorization

HeaderAuthorization: Bearer <API key>
Or the headerX-API-Key: <API key>
API keyMake one in Troopy under Settings > API keys. It acts as you, in its workspace.

Other ways to call it

CLItroopy company overview
MCP tooltroopy_get_company_overview
Rate limit30 calls in 60 seconds, for each key

Query parameters

fromstring

The first day of the period, UTC

date

tostring

The last day of the period, UTC. The period includes this day

date

Response

200 · application/json
data*object
8 properties
id*string

A 24-character id

name*string
legal*object
8 properties
legalName*string | null

The registered name of the company

entityType*string | null

The legal form, like BV, GmbH, Ltd or LLC

registrationNumber*string | null

The number in the register of companies

address*string | null

The registered address

country*string | null

The country of the company, ISO 3166-1 alpha-2, like NL

currency*string | null

The currency of the books of the company, ISO 4217, like EUR. Its totals are in it

taxIds*array<object>

The tax ids of the company, like VAT or EIN, 5 at most. Data of the business, not a secret

At most 5 items

2 properties
label*string

At least 1 characters · At most 40 characters

value*string

At least 1 characters · At most 60 characters

fiscalYearStart*integer

The month that the fiscal year starts in: 1 is January

At least 1 · At most 12

from*string

The start of the period, included

to*string

The end of the period, not included

workspaces*array<object>
14 properties
id*string

A 24-character id

name*string
revenue*array<object>

The payments of the period, by currency. The same sum as the revenue of Analytics for the same window

2 properties
currency*string

ISO 4217, upper case, like EUR

amount*integer

In minor units (cents)

refunds*array<object>

What went back to payers in the period, by currency. Revenue does not take it off

2 properties
currency*string

ISO 4217, upper case, like EUR

amount*integer

In minor units (cents)

profit*array<object>

The revenue less the refunds, by currency. Troopy knows no costs, so it takes off nothing else

2 properties
currency*string

ISO 4217, upper case, like EUR

amount*integer

In minor units (cents)

mrr*object | null

The MRR on the last day of the period that Troopy has, or null with no payment provider

2 properties
currency*string

ISO 4217, upper case, like EUR

amount*integer

In minor units (cents)

subscribers*integer

The subscribers on that day

payingCustomers*integer

The customers who pay now: active, past due or about to cancel

atRisk*integer

The customers at risk now

openDisputes*object

The disputes that wait for an answer now

2 properties
count*integer
amounts*array<object>
2 properties
currency*string

ISO 4217, upper case, like EUR

amount*integer

In minor units (cents)

plan*object

Its plan at Troopy

2 properties
state*enum<string>

trialactivepast_dueendednone

plan*enum<string> | null

promaxultra

teammates*integer
working*integer

The runs of teammates that go on now, or wait their turn

lastActiveAt*string | null

When a teammate of the workspace last worked

total*object | null

Every workspace in the currency of the company. Null when the company has no currency, or the ECB gives no rate for one of the currencies

7 properties
currency*string
revenue*integer
refunds*integer
profit*integer

The revenue less the refunds

mrr*integer
disputes*integer

The amount of the open disputes

converted*boolean

Some amounts came from another currency, at the rate of the ECB of rateDay

rateDay*string | null

The day of the rates of the ECB that converted the amounts (YYYY-MM-DD), or null when nothing converted

Errors

400 invalid_inputFix the field named in detail. Each operation's schema is in /api/v1/openapi.json.
401 unauthorizedSend an API key as `Authorization: Bearer tr_live_...`. Create one in Troopy under Settings.
403 forbiddenThe key lacks a scope this operation needs, or its owner lacks the role. detail says which; create a key with the scope, or ask a company owner or admin.
429 rate_limitedWait the number of seconds in Retry-After, then retry.