Skip to content
Fluxer API

Premium

Premium is the paid tier of a Fluxer account. Use these routes to read an account's entitlement and to manage its Stripe subscription. To buy premium, use the Billing routes.

Every route except get price IDs needs a user token. On a self-hosted instance, get premium state and set premium perks disabled always work, and the other routes need Stripe billing to be set up.

ValueNameDescription
0NONENo premium entitlement
1SUBSCRIPTIONA subscription or a gift
2LIFETIMEPremium for life
ValueDescription
monthlyBilled every month
yearlyBilled every year

Currency fields are three-letter ISO 4217 codes. Each amount field is an integer in the minor unit of the currency field its description gives. ISK amounts also use two decimals, as in 59000 for ISK 590.

The recurring and gift checkout prices for one country.

FieldTypeDescription
monthly??stringThe Stripe price ID of the monthly plan
yearly??stringThe Stripe price ID of the yearly plan
gift_1_month??stringThe Stripe price ID of the one-month gift
gift_1_year??stringThe Stripe price ID of the one-year gift
monthly_amount_minor??integerThe monthly amount, in the minor unit of currency
yearly_amount_minor??integerThe yearly amount, in the minor unit of currency
gift_1_month_amount_minor??integerThe one-month gift amount, in the minor unit of gift_currency
gift_1_year_amount_minor??integerThe one-year gift amount, in the minor unit of gift_currency
currencystringDisplay currency of the recurring prices
gift_currency1?stringDisplay currency of the gift prices

1 Null when no currency has both gift prices set up, and gift checkout is unavailable then.

The price the account is billed against, and the current list price for the same billing cycle and currency.

FieldTypeDescription
price_idstringThe price the account is billed against
amount_minorintegerThe amount charged, in the minor unit of currency
currencystringDisplay currency of the charged amount
billing_cyclestringBilling cycle of the subscription
is_grandfatheredbooleanWhether the account is billed against a price other than the current list price
list_amount_minor?integerThe current list amount, in the minor unit of currency
list_price_id?stringThe current list price ID for the same billing cycle and currency

A billing cycle change scheduled for the end of the current period.

FieldTypeDescription
schedule_idstringThe Stripe subscription schedule ID
change_kindstringAlways billing_cycle
current_billing_cycle?stringThe current billing cycle
target_billing_cyclestringThe billing cycle that starts at effective_at
effective_atISO8601 timestampWhen the change takes effect
current_price_id?stringThe current price ID
target_price_id?stringThe price ID after the change
target_amount_minor?integerThe amount of the target price, in the minor unit of currency
currency?stringDisplay currency of the target price
initial_amount_minor?integerThe amount of the first invoice after the change, in the minor unit of currency
recurring_amount_minor?integerThe amount of each later invoice, in the minor unit of currency
credit_amount_minor?integerThe credit applied to the first invoice, in the minor unit of currency

Whether the subscription can move to the current list price. A self-hosted instance never offers this switch.

FieldTypeDescription
availablebooleanAlways false
reason?stringAlways feature_unavailable
pendingbooleanAlways false
current_price_id?stringThe price ID the subscription bills on today
current_amount_minor?integerThe amount billed today, in the minor unit of currency
list_price_id?stringThe current list price ID for the same billing cycle and currency
list_amount_minor?integerThe current list price amount, in the minor unit of currency
currency?stringDisplay currency of both amounts
billing_cycle?stringThe billing cycle of the subscription
effective_at?ISO8601 timestampThe end of the current billing period

The account's entitlement and the billing and pricing data behind it. Gate premium features on effective.is_premium.

FieldTypeDescription
actualactual premium state objectThe entitlement from billing alone
effectiveeffective premium state objectThe entitlement premium feature checks read
billingpremium billing state objectThe account's Stripe billing data
pricingpremium pricing state objectThe checkout prices for the request's country
storenullAlways null
subscription_provider?stringstripe when the account has an active Stripe subscription, or null

The entitlement the account has from billing, before disabled perks, operator overrides and the instance premium mode apply.

FieldTypeDescription
premium_type?integerPremium type
premium_since?ISO8601 timestampWhen premium access first started
premium_until?ISO8601 timestampWhen premium access ends, including gift extensions, or null for lifetime
premium_will_cancelbooleanWhether the subscription cancels at the end of the current period
premium_billing_cycle?stringBilling cycle
premium_lifetime_sequence?integerAlways null
premium_grace_ends_at?ISO8601 timestampThe end of grace access after a failed renewal or a subscription end
has_active_paid_premiumbooleanWhether paid premium access is active, including the grace period
is_visionarybooleanWhether the entitlement is lifetime
has_ever_purchasedbooleanWhether the account has ever bought premium

The state that decides whether premium features are available. is_premium is always true when the instance premium mode is everyone. Otherwise it is false when the account has disabled its perks, true when an operator override applies, and in every other case it matches actual.has_active_paid_premium.

FieldTypeDescription
is_premiumbooleanWhether premium features are available to the account
premium_type?integerThe premium type, or 0 while is_premium is false
premium_since?ISO8601 timestampWhen premium access started, or null while is_premium is false
premium_until?ISO8601 timestampSame as in the actual premium state
premium_will_cancelbooleanSame as in the actual premium state
premium_billing_cycle?stringSame as in the actual premium state
premium_lifetime_sequence?integerAlways null
premium_grace_ends_at?ISO8601 timestampSame as in the actual premium state
premium_enabled_overridebooleanWhether an operator premium flag grants premium
premium_purchase_disabledbooleanWhether purchases are disabled for the account, or billing isn't set up
premium_perks_disabledbooleanWhether the account has disabled its own perks
self_hostedbooleanWhether the instance is self-hosted
botbooleanAlways false

The account's Stripe customer, subscription, invoices and payment methods.

FieldTypeDescription
stripe_customer_id?stringThe Stripe customer ID
current_subscription_price?current subscription price objectThe price the account is billed against
pending_subscription_change?pending subscription change objectThe scheduled billing cycle change
list_price_switchlist price switch objectWhether the subscription can move to the list price
subscription?billing subscription objectThe current subscription
invoicesarray[billing invoice]Up to 12 recent invoices, newest first
invoices_has_morebooleanWhether there are older invoices, which the customer portal shows
payment_methodsarray[billing payment method]The stored payment methods, default first
refund_eligibilityrefund eligibility objectAlways ineligible, with reason set to feature_unavailable

A Stripe subscription, with status, plan_interval and plan_currency in Stripe's own values.

FieldTypeDescription
idstringThe Stripe subscription ID
status?stringThe subscription status
current_period_start?ISO8601 timestampThe start of the current billing period
current_period_end?ISO8601 timestampThe end of the current billing period
cancel_at_period_endbooleanWhether the subscription cancels at the period end
cancel_at?ISO8601 timestampThe scheduled cancellation time
canceled_at?ISO8601 timestampWhen the cancellation was requested
plan_interval?stringmonth or year
plan_amount_minor?integerThe price amount, in the minor unit of plan_currency
plan_currency?stringThe lowercase currency of the price
default_payment_method_id?stringThe payment method the subscription bills

A Stripe invoice.

FieldTypeDescription
idstringThe Stripe invoice ID
number?stringThe invoice number
amount_dueintegerThe amount due, in the minor unit of currency
amount_paidintegerThe amount paid, in the minor unit of currency
currencystringThe lowercase currency of the invoice
status?stringThe invoice status
created_at?ISO8601 timestampWhen the invoice was created
paid_at?ISO8601 timestampWhen the invoice was paid
billing_reason?stringWhy Stripe created the invoice
subscription_id?stringThe subscription that produced the invoice, or null for a one-off purchase
hosted_invoice_url?stringThe hosted invoice page
invoice_pdf?stringThe invoice PDF

A stored payment method, where the card fields are null for anything that isn't a card.

FieldTypeDescription
idstringThe Stripe payment method ID
type?stringThe payment method type
card_brand?stringThe card brand
card_last4?stringThe last four digits of the card
card_exp_month?integerThe card's expiry month
card_exp_year?integerThe card's expiry year
is_defaultbooleanWhether the method is the customer's default

The checkout prices for the request's country.

FieldTypeDescription
country_code?stringThe country used to pick the prices
localized?price IDs objectThe prices, or null when no currency for the country has both a monthly and a yearly price set up
GET/v1/premium/price-idsUnauthenticated

Returns the price IDs object for the request's country.

FieldTypeDescription
country_code?stringA two-letter country code, used when Fluxer can't locate the request
StatusBodyCondition
200price IDs objectThe prices were returned
400error responseSTRIPE_ERROR when no currency for the country has both a monthly and a yearly price set up

The rate limit is 40 requests per 10 seconds, on the stripe:price:ids bucket.

GET/v1/premium/state

Returns the premium state object for the current account. This request can also update the Stripe default payment method so that the customer and the subscription use the same one.

FieldTypeDescription
country_code?stringA two-letter country code for pricing, used when Fluxer can't locate the request
StatusBodyCondition
200premium state objectThe state was returned

The rate limit is 30 requests per 10 seconds, on the stripe:premium:state bucket.

GET/v1/premium/current-subscription-price

Returns the current subscription price object, or null when the account has no subscription or Fluxer can't look up its price.

StatusBodyCondition
200?current subscription price objectThe price was returned, or null

The rate limit is 20 requests per 10 seconds, on the stripe:subscription:current_price bucket.

PATCH/v1/premium/perks-disabled

Turns the account's premium perks off or on without changing billing, and returns the premium state object. Fluxer sends User Update when the value changes.

FieldTypeDescription
disabledbooleanWhether premium perks are disabled for the account
StatusBodyCondition
200premium state objectThe state was returned

The rate limit is 10 requests per minute, on the stripe:premium:perks_disabled bucket.

POST/v1/premium/customer-portal

Creates a Stripe billing portal session and returns a redirect URL object. Send the user to the URL to manage their payment methods, invoices and subscription.

StatusBodyCondition
200redirect URL objectThe portal session was created
400error responseSTRIPE_NO_PURCHASE_HISTORY when the account has no Stripe customer

The rate limit is 5 requests per minute, on the stripe:customer_portal bucket.

POST/v1/premium/grace/end

Ends the grace period after a failed renewal, and premium features stop at once. It does nothing when the account isn't in a grace period. Fluxer sends User Update when the grace period ends.

FieldTypeDescription
successbooleanAlways true
StatusBodyCondition
200response bodyThe grace period ended, or there was none

The rate limit is 3 requests per minute, on the stripe:premium:grace:end bucket.

POST/v1/premium/cancel-subscription

Sets the subscription to cancel at the end of the current period and discards any pending billing cycle change. Premium stays active until then. Fluxer sends User Update.

StatusBodyCondition
204emptyThe subscription will cancel at the period end
400error responseSTRIPE_NO_ACTIVE_SUBSCRIPTION or STRIPE_SUBSCRIPTION_ALREADY_CANCELING

The rate limit is 5 requests per minute, on the stripe:subscription:cancel bucket.

POST/v1/premium/reactivate-subscription

Undoes a pending cancellation and discards any pending billing cycle change. Fluxer sends User Update.

StatusBodyCondition
204emptyThe subscription was reactivated
400error responseSTRIPE_NO_SUBSCRIPTION or STRIPE_SUBSCRIPTION_NOT_CANCELING

The rate limit is 5 requests per minute, on the stripe:subscription:reactivate bucket.

POST/v1/premium/change-subscription

Moves the subscription between monthly and yearly and clears a pending cancellation. With effective_at set to now, Fluxer charges or credits the prorated difference at once, and a change at period_end shows up as billing.pending_subscription_change in get premium state. Requesting the current cycle does nothing. Fluxer sends User Update.

FieldTypeDescription
billing_cyclestringThe target billing cycle
effective_at?stringnow or period_end (default now)
StatusBodyCondition
204emptyThe change was applied or scheduled
400error responseSTRIPE_NO_ACTIVE_SUBSCRIPTION when the account has no subscription
400error responseSTRIPE_INVALID_PRODUCT_CONFIGURATION when the cycle has no price in the subscription's currency

The rate limit is 5 requests per minute, on the stripe:subscription:change bucket.

POST/v1/premium/cancel-pending-subscription-change

Cancels a scheduled billing cycle change. Fluxer sends User Update when it cancels one.

StatusBodyCondition
204emptyThe pending change was cancelled, or there was none
400error responseSTRIPE_NO_ACTIVE_SUBSCRIPTION when the account has no subscription

The rate limit is 5 requests per minute, on the stripe:subscription:change bucket.