Skip to main content

Subscription management

The “Subscription management” view is shown within the settings “Profile” view. It displays detailed information on the users VPN subscription. If they are authenticated and have all the necessary permissions they are presented with subscription information that is associated with their FxA Account. In case the user has to (re)authenticate they have to go through the Authentication flow.

Subscription details

The subscription information that is shown to the user.

Summary list

ItemDescription
Subscription planAmount and interval for billing.
StatusIndicates if the subscription is “active” or “inactive”.
Next billedDate on which the next payment will occur.
ActivatedDate on which the subscription was created.
ExpiresExpiration date of the subscription.

Payment list

ItemDescription
Payment methodCan be a credit card or an IAP platform. If a credit card is used for payment the last four digits of the credit card number are displayed.
ExpiresExpiration date of the payment method. Is only shown if a credit card is used for payment.

Manage subscription

If the users wishes to actually manage and change data that is related to their subscription they will be directed to the respective subscription platform they subscribed with for the VPN.

User flow

Data source

The subscription data is fetched from the Guardian endpoint /subscriptionDetails.

Responses

  • 200: Subscription and billing information returned successfully.
    {
    "created_at": 1641034800,
    "expires_on": 1643713200,
    "id": "sub_123",
    "is_cancelled": false,
    "payment": {
    "credit_card_brand": "visa",
    "credit_card_exp_month": 12,
    "credit_card_exp_year": 2022,
    "credit_card_last4": "0016",
    "provider": "stripe",
    "type": "credit"
    },
    "plan": {
    "amount": 499,
    "currency": "eur",
    "id": "price_123",
    "interval_count": 1,
    "interval": "month",
    "product_id": "prod_123"
    },
    "plan_id": "price_123",
    "product_id": "prod_123",
    "status": "active",
    "type": "web"
    }
  • 400: Requested scopes are not allowed.
    {
    code: 400,
    errno: 163,
    message: "FxA returned requested scopes are not allowed.",
    }
  • 401: Unauthorized for route.
    {
    "code": 401,
    "errno": 110,
    "error": "FxA returned unauthorized for route."
    }

JSON format

PropertyDescriptionTypeRequired
idSubscription expiration date.StringYes
created_atSubscription start date.NumberYes
expires_onSubscription expiration date.NumberYes
is_cancelledIs the subscription cancelled?BooleanYes
paymentPayment information associated with the subscription.Payment ObjectYes
planInformation on the selected subscription plan.Plan ObjectYes

Payment object

Detail info on the payment method.

PropertyDescriptionTypeRequired
plan_idID of the subscription plan. Matches id in Plan.StringYes
product_idID for the VPN product.StringYes
providerProvider that is used for payment.StringYes
statusStatus of the current VPN subscription.StringYes
typeType of the payment method. web, iap_google or iap_appleStringYes
credit_card_brandBrand of the credit card. Empty if no credit card is used for payment.StringNo
credit_card_exp_monthExpiration month of the credit card. Empty if no credit card is used for payment.NumberNo
credit_card_exp_yearExpiration year of the credit card. Empty if no credit card is used for payment.NumberNo
credit_card_last4The last four digits of the credit card number. Empty if no credit card is used for payment.StringNo

Plan object

Detail info on the subscription plan.

PropertyDescriptionTypeRequired
idID of the plan.StringYes
amountAmount in cents.NumberYes
currencyCode of the currency the plan is payed in.StringYes
interval_countInterval of the selected plan in month. The value can be 1 (monthly), 6 (half-yearly) or 12 (yearly).NumberYes
product_idID for the VPN product.StringYes