Skip to content

Latest commit

 

History

History
946 lines (653 loc) · 28.9 KB

BillingApi.md

File metadata and controls

946 lines (653 loc) · 28.9 KB

forestvpn_api.api.BillingApi

Load the API package

import 'package:forestvpn_api/api.dart';

All URIs are relative to https://api.forestvpn.com/v2

Method HTTP request Description
cancelSubscription DELETE /billing/subscriptions/{subscriptionID}/ Cancel subscription
createPaymentMethodStripeSetupIntent POST /billing/payment-methods/stripe/setup-intents/ Create stripe's setup intent for add new payment method.
createSubscription POST /billing/subscriptions/ Create subscription
deletePaymentMethod DELETE /billing/payment-methods/{paymentMethodID}/ Delete payment method
getBillingAccount GET /billing/account/ Billing account info
getBillingBundle GET /billing/bundles/{bundleID}/ Bundle info
getBillingPaymentOption GET /billing/payment-options/{paymentOptionID}/ Payment option info
getBillingProduct GET /billing/products/{productID}/ Product info
getPaymentMethod GET /billing/payment-methods/{paymentMethodID}/ Payment method info
getSubscription GET /billing/subscriptions/{subscriptionID}/ Subscription info
getSubscriptionItem GET /billing/subscription-items/{subscriptionItemID}/ Subscription item info
listBillingBundles GET /billing/bundles/ Billing bundles list
listBillingFeatures GET /billing/features/ Billing feature list
listBillingPaymentOptions GET /billing/payment-options/ Billing payment option list
listBillingProducts GET /billing/products/ Billing products list
listPaymentMethods GET /billing/payment-methods/ Payment method list
listSubscriptionItems GET /billing/subscription-items/ Subscription items list
listSubscriptions GET /billing/subscriptions/ Billing subscriptions list
reactivateSubscription POST /billing/subscriptions/{subscriptionID}/reactivate/ Reactivate subscription
updateBillingAccount PATCH /billing/account/ Update billing account
updateSubscriptionItem PATCH /billing/subscription-items/{subscriptionItemID}/ Update subscription item

cancelSubscription

cancelSubscription(subscriptionID)

Cancel subscription

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();
final String subscriptionID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    api.cancelSubscription(subscriptionID);
} catch on DioError (e) {
    print('Exception when calling BillingApi->cancelSubscription: $e\n');
}

Parameters

Name Type Description Notes
subscriptionID String

Return type

void (empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createPaymentMethodStripeSetupIntent

StripeSetupIntent createPaymentMethodStripeSetupIntent(createStripeSetupIntentRequest)

Create stripe's setup intent for add new payment method.

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();
final CreateStripeSetupIntentRequest createStripeSetupIntentRequest = ; // CreateStripeSetupIntentRequest | 

try {
    final response = api.createPaymentMethodStripeSetupIntent(createStripeSetupIntentRequest);
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->createPaymentMethodStripeSetupIntent: $e\n');
}

Parameters

Name Type Description Notes
createStripeSetupIntentRequest CreateStripeSetupIntentRequest [optional]

Return type

StripeSetupIntent

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createSubscription

Subscription createSubscription(subscription)

Create subscription

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();
final Subscription subscription = ; // Subscription | 

try {
    final response = api.createSubscription(subscription);
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->createSubscription: $e\n');
}

Parameters

Name Type Description Notes
subscription Subscription [optional]

Return type

Subscription

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deletePaymentMethod

deletePaymentMethod(paymentMethodID)

Delete payment method

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();
final String paymentMethodID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    api.deletePaymentMethod(paymentMethodID);
} catch on DioError (e) {
    print('Exception when calling BillingApi->deletePaymentMethod: $e\n');
}

Parameters

Name Type Description Notes
paymentMethodID String

Return type

void (empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getBillingAccount

BillingAccount getBillingAccount()

Billing account info

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();

try {
    final response = api.getBillingAccount();
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->getBillingAccount: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

BillingAccount

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getBillingBundle

Bundle getBillingBundle(bundleID)

Bundle info

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();
final String bundleID = bundleID_example; // String | 

try {
    final response = api.getBillingBundle(bundleID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->getBillingBundle: $e\n');
}

Parameters

Name Type Description Notes
bundleID String

Return type

Bundle

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getBillingPaymentOption

PaymentOption getBillingPaymentOption(paymentOptionID)

Payment option info

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();
final String paymentOptionID = paymentOptionID_example; // String | 

try {
    final response = api.getBillingPaymentOption(paymentOptionID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->getBillingPaymentOption: $e\n');
}

Parameters

Name Type Description Notes
paymentOptionID String

Return type

PaymentOption

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getBillingProduct

Product getBillingProduct(productID)

Product info

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();
final String productID = productID_example; // String | 

try {
    final response = api.getBillingProduct(productID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->getBillingProduct: $e\n');
}

Parameters

Name Type Description Notes
productID String

Return type

Product

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getPaymentMethod

PaymentMethod getPaymentMethod(paymentMethodID)

Payment method info

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();
final String paymentMethodID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    final response = api.getPaymentMethod(paymentMethodID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->getPaymentMethod: $e\n');
}

Parameters

Name Type Description Notes
paymentMethodID String

Return type

PaymentMethod

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getSubscription

Subscription getSubscription(subscriptionID)

Subscription info

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();
final String subscriptionID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    final response = api.getSubscription(subscriptionID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->getSubscription: $e\n');
}

Parameters

Name Type Description Notes
subscriptionID String

Return type

Subscription

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getSubscriptionItem

SubscriptionItem getSubscriptionItem(subscriptionItemID)

Subscription item info

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();
final String subscriptionItemID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    final response = api.getSubscriptionItem(subscriptionItemID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->getSubscriptionItem: $e\n');
}

Parameters

Name Type Description Notes
subscriptionItemID String

Return type

SubscriptionItem

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listBillingBundles

BuiltList listBillingBundles()

Billing bundles list

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();

try {
    final response = api.listBillingBundles();
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->listBillingBundles: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

BuiltList<Bundle>

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listBillingFeatures

BuiltList listBillingFeatures()

Billing feature list

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure API key authorization: wireguardAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('wireguardAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('wireguardAuth').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();

try {
    final response = api.listBillingFeatures();
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->listBillingFeatures: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

BuiltList<BillingFeature>

Authorization

wireguardAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listBillingPaymentOptions

BuiltList listBillingPaymentOptions()

Billing payment option list

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();

try {
    final response = api.listBillingPaymentOptions();
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->listBillingPaymentOptions: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

BuiltList<PaymentOption>

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listBillingProducts

BuiltList listBillingProducts()

Billing products list

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();

try {
    final response = api.listBillingProducts();
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->listBillingProducts: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

BuiltList<Product>

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listPaymentMethods

BuiltList listPaymentMethods()

Payment method list

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();

try {
    final response = api.listPaymentMethods();
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->listPaymentMethods: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

BuiltList<PaymentMethod>

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listSubscriptionItems

BuiltList listSubscriptionItems(subscription, perPage, page)

Subscription items list

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();
final String subscription = subscription_example; // String | 
final int perPage = 56; // int | 
final int page = 56; // int | 

try {
    final response = api.listSubscriptionItems(subscription, perPage, page);
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->listSubscriptionItems: $e\n');
}

Parameters

Name Type Description Notes
subscription String [optional]
perPage int [optional]
page int [optional]

Return type

BuiltList<SubscriptionItem>

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listSubscriptions

BuiltList listSubscriptions(product, perPage, page)

Billing subscriptions list

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();
final String product = product_example; // String | 
final int perPage = 56; // int | 
final int page = 56; // int | 

try {
    final response = api.listSubscriptions(product, perPage, page);
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->listSubscriptions: $e\n');
}

Parameters

Name Type Description Notes
product String [optional]
perPage int [optional]
page int [optional]

Return type

BuiltList<Subscription>

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

reactivateSubscription

Subscription reactivateSubscription(subscriptionID)

Reactivate subscription

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();
final String subscriptionID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 

try {
    final response = api.reactivateSubscription(subscriptionID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->reactivateSubscription: $e\n');
}

Parameters

Name Type Description Notes
subscriptionID String

Return type

Subscription

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateBillingAccount

BillingAccount updateBillingAccount(billingAccount)

Update billing account

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();
final BillingAccount billingAccount = ; // BillingAccount | 

try {
    final response = api.updateBillingAccount(billingAccount);
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->updateBillingAccount: $e\n');
}

Parameters

Name Type Description Notes
billingAccount BillingAccount

Return type

BillingAccount

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateSubscriptionItem

SubscriptionItem updateSubscriptionItem(subscriptionItemID, subscriptionItem)

Update subscription item

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getBillingApi();
final String subscriptionItemID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | 
final SubscriptionItem subscriptionItem = ; // SubscriptionItem | 

try {
    final response = api.updateSubscriptionItem(subscriptionItemID, subscriptionItem);
    print(response);
} catch on DioError (e) {
    print('Exception when calling BillingApi->updateSubscriptionItem: $e\n');
}

Parameters

Name Type Description Notes
subscriptionItemID String
subscriptionItem SubscriptionItem

Return type

SubscriptionItem

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]