get
/premium/stateGet premium state
Returns the authenticated user actual premium entitlement, effective perk state, and mirrored billing data. When Stripe is enabled, missing payment-method mirror data may be repaired lazily.
get_premium_state
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| country_code | query | string | Two-letter country code for regional pricing. Only used when the server cannot geolocate the request; otherwise the request GeoIP country wins. |
Responses
200
Success
json
{
"type": "object",
"properties": {
"actual": {
"type": "object",
"properties": {
"premium_type": {
"anyOf": [
{
"$ref": "#/components/schemas/UserPremiumTypes"
},
{
"type": "null"
}
],
"description": "Actual subscription type before local perk disabling"
},
"premium_since": {
"description": "ISO timestamp when actual premium access first started",
"type": [
"string",
"null"
]
},
"premium_until": {
"description": "ISO timestamp when actual premium access ends, including stacked gift time",
"type": [
"string",
"null"
]
},
"premium_will_cancel": {
"type": "boolean",
"description": "Whether the subscription is set to cancel at period end"
},
"premium_billing_cycle": {
"anyOf": [
{
"type": "string",
"enum": [
"monthly",
"yearly"
]
},
{
"type": "null"
}
],
"description": "The actual recurring billing cycle, when known"
},
"premium_lifetime_sequence": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Visionary sequence number, when applicable"
},
"premium_grace_ends_at": {
"description": "ISO timestamp when grace access ends, when applicable",
"type": [
"string",
"null"
]
},
"has_active_paid_premium": {
"type": "boolean",
"description": "Whether paid premium access is currently active before local disabling"
},
"is_visionary": {
"type": "boolean",
"description": "Whether the actual premium entitlement is lifetime Visionary access"
},
"has_ever_purchased": {
"type": "boolean",
"description": "Whether the user has ever completed a premium purchase"
}
},
"required": [
"premium_type",
"premium_since",
"premium_until",
"premium_will_cancel",
"premium_billing_cycle",
"premium_lifetime_sequence",
"premium_grace_ends_at",
"has_active_paid_premium",
"is_visionary",
"has_ever_purchased"
],
"additionalProperties": false
},
"effective": {
"type": "object",
"properties": {
"is_premium": {
"type": "boolean",
"description": "Whether premium perks are currently effective for product gating"
},
"premium_type": {
"anyOf": [
{
"$ref": "#/components/schemas/UserPremiumTypes"
},
{
"type": "null"
}
],
"description": "Effective premium type used by product gates"
},
"premium_since": {
"description": "Effective premium start timestamp exposed to the client",
"type": [
"string",
"null"
]
},
"premium_until": {
"description": "Effective premium end timestamp exposed to the client, including stacked gift time",
"type": [
"string",
"null"
]
},
"premium_will_cancel": {
"type": "boolean",
"description": "Effective cancellation status exposed to the client"
},
"premium_billing_cycle": {
"anyOf": [
{
"type": "string",
"enum": [
"monthly",
"yearly"
]
},
{
"type": "null"
}
],
"description": "Effective recurring billing cycle, when known"
},
"premium_lifetime_sequence": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Effective Visionary sequence number, when applicable"
},
"premium_grace_ends_at": {
"description": "Effective grace timestamp exposed to the client",
"type": [
"string",
"null"
]
},
"premium_enabled_override": {
"type": "boolean",
"description": "Whether backend premium override is enabled"
},
"premium_purchase_disabled": {
"type": "boolean",
"description": "Whether premium purchase is disabled for this account"
},
"premium_perks_disabled": {
"type": "boolean",
"description": "Whether the user temporarily disabled premium perks"
},
"self_hosted": {
"type": "boolean",
"description": "Whether the instance treats all users as premium because it is self-hosted"
},
"bot": {
"type": "boolean",
"description": "Whether the account is a bot account with premium-equivalent service access"
}
},
"required": [
"is_premium",
"premium_type",
"premium_since",
"premium_until",
"premium_will_cancel",
"premium_billing_cycle",
"premium_lifetime_sequence",
"premium_grace_ends_at",
"premium_enabled_override",
"premium_purchase_disabled",
"premium_perks_disabled",
"self_hosted",
"bot"
],
"additionalProperties": false
},
"billing": {
"type": "object",
"properties": {
"stripe_customer_id": {
"type": [
"string",
"null"
]
},
"current_subscription_price": {
"$ref": "#/components/schemas/CurrentSubscriptionPriceResponse"
},
"pending_subscription_change": {
"$ref": "#/components/schemas/PendingSubscriptionChangeResponse"
},
"list_price_switch": {
"$ref": "#/components/schemas/ListPriceSwitchState"
},
"subscription": {
"anyOf": [
{
"$ref": "#/components/schemas/PremiumBillingSubscriptionResponse"
},
{
"type": "null"
}
]
},
"invoices": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PremiumBillingInvoiceResponse"
}
},
"invoices_has_more": {
"type": "boolean"
},
"payment_methods": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PremiumBillingPaymentMethodResponse"
}
},
"refund_eligibility": {
"$ref": "#/components/schemas/SelfServeRefundEligibilityResponse"
}
},
"required": [
"stripe_customer_id",
"current_subscription_price",
"pending_subscription_change",
"list_price_switch",
"subscription",
"invoices",
"invoices_has_more",
"payment_methods",
"refund_eligibility"
],
"additionalProperties": false
},
"pricing": {
"$ref": "#/components/schemas/PremiumPricingState"
},
"store": {
"description": "Active App Store or Google Play subscription, null when no store subscription is active",
"anyOf": [
{
"$ref": "#/components/schemas/PremiumStoreSubscriptionState"
},
{
"type": "null"
}
]
},
"subscription_provider": {
"anyOf": [
{
"$ref": "#/components/schemas/PremiumSubscriptionProvider"
},
{
"type": "null"
}
],
"description": "Billing platform that owns the current recurring subscription, null for gift, lifetime or no subscription. When a Stripe and a store subscription are both active, the one paid through later"
}
},
"required": [
"actual",
"effective",
"billing",
"pricing",
"subscription_provider"
],
"additionalProperties": false
}400
Bad Request - The request was malformed or contained invalid data
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine-readable error code"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"description": "Field-specific validation errors",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Field path that failed validation"
},
"code": {
"description": "Machine-readable validation error code",
"type": "string"
},
"message": {
"type": "string",
"description": "Human-readable validation error message"
}
},
"required": [
"path",
"message"
],
"additionalProperties": false
}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}401
Unauthorized - Authentication is required or the token is invalid
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine-readable error code"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"description": "Field-specific validation errors",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Field path that failed validation"
},
"code": {
"description": "Machine-readable validation error code",
"type": "string"
},
"message": {
"type": "string",
"description": "Human-readable validation error message"
}
},
"required": [
"path",
"message"
],
"additionalProperties": false
}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}403
Forbidden - You do not have permission to perform this action
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine-readable error code"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"description": "Field-specific validation errors",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Field path that failed validation"
},
"code": {
"description": "Machine-readable validation error code",
"type": "string"
},
"message": {
"type": "string",
"description": "Human-readable validation error message"
}
},
"required": [
"path",
"message"
],
"additionalProperties": false
}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}429
Too Many Requests - You are being rate limited
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine-readable error code"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"description": "Field-specific validation errors",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Field path that failed validation"
},
"code": {
"description": "Machine-readable validation error code",
"type": "string"
},
"message": {
"type": "string",
"description": "Human-readable validation error message"
}
},
"required": [
"path",
"message"
],
"additionalProperties": false
}
},
"retry_after": {
"type": "number",
"description": "Seconds to wait before retrying"
},
"global": {
"type": "boolean",
"description": "Whether this is a global rate limit"
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}500
Internal Server Error - An unexpected error occurred
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine-readable error code"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"description": "Field-specific validation errors",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Field path that failed validation"
},
"code": {
"description": "Machine-readable validation error code",
"type": "string"
},
"message": {
"type": "string",
"description": "Human-readable validation error message"
}
},
"required": [
"path",
"message"
],
"additionalProperties": false
}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}