Tearleads

GET/organizations/{organizationId}/billing

Get organization billing

Operation organizations.billing.get

Description

Returns the organization's billing state: plan status, billing period, seat counts, which members hold sync seats, and whether the subscription can be cancelled directly. Any organization member may call it.

Authentication

Requires a signed-in session: the client sends its session token as a bearer token in the Authorization header.

Parameters

NameInTypeDetails
organizationIdpathstringrequired
  • lowercase UUID v4

Responses

200 OK

application/jsonOrganizationBillingResponse

An organization's sync billing snapshot: whether it may sync, its plan period, and its seats.

16 fields
  • organizationIdstringrequired
  • activeMemberCountintegerrequired
    • at least 0

    Members reachable through the signed Members group, as the server counts them.

  • assignedSeatCountintegerrequired
    • at least 0

    Members who hold a sync seat; always the length of assignedUserIds.

  • assignedUserIdslist of stringrequired
    • each item: not empty

    Members who may sync within the licensed seat count.

  • currentUserHasSyncSeatbooleanrequired

    True when the caller holds one of the sync seats.

  • statusstringrequired
    • one of local, trialing, active, disabled, deleting, purged

    Billing state; it decides whether the organization may sync at all. A local organization is free and syncs nothing.

  • trialEndsAtstringrequirednullable
  • providerstringrequirednullable
    • always revenuecat
  • canCancelDirectlybooleanrequired

    True when a Stripe subscription can be cancelled from the app, even while a native store owns billing.

  • subscriptionSourcestringrequirednullable
    • one of native, stripe

    Store of record for the current or lapsed subscription, or null when nothing would conflict with a new purchase.

  • currentPeriodStartsAtstringrequirednullable
  • currentPeriodEndsAtstringrequirednullable
  • seatCountintegerrequired
    • at least 0

    Licensed seats in the current paid period.

  • pendingSeatCountintegerrequirednullable
    • at least 1

    Seat count of a native plan change the store scheduled but has not applied yet.

  • disabledAtstringrequirednullable

    When sync stopped because billing lapsed.

  • purgeAfterstringrequirednullable

    When a disabled organization's synced data becomes eligible for purge.

Other fields are allowed.

Other responses

StatusMeaningBody
400Bad Request

application/jsonErrorResponse

401Unauthorized

application/jsonSessionFailureResponse

403Forbidden

application/jsonErrorResponse

404Not Found

application/jsonErrorResponse

500Internal Server Error

application/jsonErrorResponse

503Service Unavailable

application/jsonErrorResponse

Additional rules

The server also enforces these rules, which the schema above cannot express.

  • assignedSeatCount equals the number of assignedUserIds in the response.