Skip to content

Latest commit

 

History

History
755 lines (557 loc) · 23.8 KB

SubscriptionsApi.md

File metadata and controls

755 lines (557 loc) · 23.8 KB

SubscriptionsApi

All URIs are relative to https://{customerId}.billabear.cloud/api/v1

Method HTTP request Description
addSeatsSubscriptions POST /subscription/{subscriptionId}/seats/add Add Seats
cancelSubscription POST /subscription/{subscriptionId}/cancel Cancel Subscription
changeSubscriptionPrice POST /subscription/{subscriptionId}/price Change Price
createSubscription POST /customer/{customerId}/subscription/start Create Subscription
customerChangeSubscriptionPlan POST /subscription/{subscriptionId}/plan Change Subscription Plan
extendTrial POST /subscription/{subscriptionId}/extend Extend Trial Subscription
getActiveForCustomer GET /customer/{customerId}/subscription/active List Customer Active Subscriptions
getForCustomer GET /customer/{customerId}/subscription List Customer Subscriptions
listSubscriptionPlans GET /subscription/plans List Subscription Plans
listSubscriptions GET /subscription List
removeSeatsSubscriptions POST /subscription/{subscriptionId}/seats/remove Remove Seats
showSubscriptionById GET /subscription/{subscriptionId} Detail
startTrial POST /customer/{customerId}/subscription/trial Start Trial Subscription For Customer

addSeatsSubscriptions

InlineResponse20011 addSeatsSubscriptions(body, subscriptionId)

Add Seats

Adds seats to a per seat subscription<br><br><strong>Since 1.1.4</strong>

Example

// Import classes:
//import BillaBear.ApiClient;
//import BillaBear.ApiException;
//import BillaBear.Configuration;
//import BillaBear.auth.*;
//import io.swagger.client.api.SubscriptionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

SubscriptionsApi apiInstance = new SubscriptionsApi();
SeatsAddBody body = new SeatsAddBody(); // SeatsAddBody | 
String subscriptionId = "subscriptionId_example"; // String | The id of the subscription to retrieve
try {
    InlineResponse20011 result = apiInstance.addSeatsSubscriptions(body, subscriptionId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SubscriptionsApi#addSeatsSubscriptions");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body SeatsAddBody
subscriptionId String The id of the subscription to retrieve

Return type

InlineResponse20011

Authorization

ApiKeyAuth

HTTP request headers

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

cancelSubscription

String cancelSubscription(body, subscriptionId)

Cancel Subscription

Info for a specific subscription

Example

// Import classes:
//import BillaBear.ApiClient;
//import BillaBear.ApiException;
//import BillaBear.Configuration;
//import BillaBear.auth.*;
//import io.swagger.client.api.SubscriptionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

SubscriptionsApi apiInstance = new SubscriptionsApi();
SubscriptionIdCancelBody body = new SubscriptionIdCancelBody(); // SubscriptionIdCancelBody | 
String subscriptionId = "subscriptionId_example"; // String | The id of the subscription to retrieve
try {
    String result = apiInstance.cancelSubscription(body, subscriptionId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SubscriptionsApi#cancelSubscription");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body SubscriptionIdCancelBody
subscriptionId String The id of the subscription to retrieve

Return type

String

Authorization

ApiKeyAuth

HTTP request headers

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

changeSubscriptionPrice

InlineResponse20011 changeSubscriptionPrice(body, subscriptionId)

Change Price

Changes the price being used for a price. Useful for changing pricing schedule or just price.

Example

// Import classes:
//import BillaBear.ApiClient;
//import BillaBear.ApiException;
//import BillaBear.Configuration;
//import BillaBear.auth.*;
//import io.swagger.client.api.SubscriptionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

SubscriptionsApi apiInstance = new SubscriptionsApi();
SubscriptionIdPriceBody body = new SubscriptionIdPriceBody(); // SubscriptionIdPriceBody | 
String subscriptionId = "subscriptionId_example"; // String | The id of the subscription to retrieve
try {
    InlineResponse20011 result = apiInstance.changeSubscriptionPrice(body, subscriptionId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SubscriptionsApi#changeSubscriptionPrice");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body SubscriptionIdPriceBody
subscriptionId String The id of the subscription to retrieve

Return type

InlineResponse20011

Authorization

ApiKeyAuth

HTTP request headers

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

createSubscription

Subscription createSubscription(body, customerId)

Create Subscription

Create subscription for a customer

Example

// Import classes:
//import BillaBear.ApiClient;
//import BillaBear.ApiException;
//import BillaBear.Configuration;
//import BillaBear.auth.*;
//import io.swagger.client.api.SubscriptionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

SubscriptionsApi apiInstance = new SubscriptionsApi();
SubscriptionStartBody body = new SubscriptionStartBody(); // SubscriptionStartBody | 
String customerId = "customerId_example"; // String | The id of the customer to retrieve
try {
    Subscription result = apiInstance.createSubscription(body, customerId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SubscriptionsApi#createSubscription");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body SubscriptionStartBody
customerId String The id of the customer to retrieve

Return type

Subscription

Authorization

ApiKeyAuth

HTTP request headers

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

customerChangeSubscriptionPlan

Subscription customerChangeSubscriptionPlan(body, subscriptionId)

Change Subscription Plan

Change the subscription plan for a customer

Example

// Import classes:
//import BillaBear.ApiClient;
//import BillaBear.ApiException;
//import BillaBear.Configuration;
//import BillaBear.auth.*;
//import io.swagger.client.api.SubscriptionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

SubscriptionsApi apiInstance = new SubscriptionsApi();
SubscriptionIdPlanBody body = new SubscriptionIdPlanBody(); // SubscriptionIdPlanBody | 
String subscriptionId = "subscriptionId_example"; // String | The id of the subscription to retrieve
try {
    Subscription result = apiInstance.customerChangeSubscriptionPlan(body, subscriptionId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SubscriptionsApi#customerChangeSubscriptionPlan");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body SubscriptionIdPlanBody
subscriptionId String The id of the subscription to retrieve

Return type

Subscription

Authorization

ApiKeyAuth

HTTP request headers

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

extendTrial

Subscription extendTrial(body, subscriptionId)

Extend Trial Subscription

Extend a trial subscription so it's converted from a trial to a normal subscription.

Example

// Import classes:
//import BillaBear.ApiClient;
//import BillaBear.ApiException;
//import BillaBear.Configuration;
//import BillaBear.auth.*;
//import io.swagger.client.api.SubscriptionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

SubscriptionsApi apiInstance = new SubscriptionsApi();
SubscriptionIdExtendBody body = new SubscriptionIdExtendBody(); // SubscriptionIdExtendBody | 
String subscriptionId = "subscriptionId_example"; // String | The id of the subscription to retrieve
try {
    Subscription result = apiInstance.extendTrial(body, subscriptionId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SubscriptionsApi#extendTrial");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body SubscriptionIdExtendBody
subscriptionId String The id of the subscription to retrieve

Return type

Subscription

Authorization

ApiKeyAuth

HTTP request headers

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

getActiveForCustomer

InlineResponse2006 getActiveForCustomer(customerId)

List Customer Active Subscriptions

List all Active customer subscriptions

Example

// Import classes:
//import BillaBear.ApiClient;
//import BillaBear.ApiException;
//import BillaBear.Configuration;
//import BillaBear.auth.*;
//import io.swagger.client.api.SubscriptionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

SubscriptionsApi apiInstance = new SubscriptionsApi();
String customerId = "customerId_example"; // String | The id of the customer to retrieve
try {
    InlineResponse2006 result = apiInstance.getActiveForCustomer(customerId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SubscriptionsApi#getActiveForCustomer");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
customerId String The id of the customer to retrieve

Return type

InlineResponse2006

Authorization

ApiKeyAuth

HTTP request headers

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

getForCustomer

InlineResponse2006 getForCustomer(customerId)

List Customer Subscriptions

List all customer subscriptions<br><br><strong>Since 1.1</strong>

Example

// Import classes:
//import BillaBear.ApiClient;
//import BillaBear.ApiException;
//import BillaBear.Configuration;
//import BillaBear.auth.*;
//import io.swagger.client.api.SubscriptionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

SubscriptionsApi apiInstance = new SubscriptionsApi();
String customerId = "customerId_example"; // String | The id of the customer to retrieve
try {
    InlineResponse2006 result = apiInstance.getForCustomer(customerId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SubscriptionsApi#getForCustomer");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
customerId String The id of the customer to retrieve

Return type

InlineResponse2006

Authorization

ApiKeyAuth

HTTP request headers

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

listSubscriptionPlans

InlineResponse20010 listSubscriptionPlans(limit, lastKey)

List Subscription Plans

List all subscriptions plans

Example

// Import classes:
//import BillaBear.ApiClient;
//import BillaBear.ApiException;
//import BillaBear.Configuration;
//import BillaBear.auth.*;
//import io.swagger.client.api.SubscriptionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

SubscriptionsApi apiInstance = new SubscriptionsApi();
Integer limit = 56; // Integer | How many items to return at one time (max 100)
String lastKey = "lastKey_example"; // String | The key to be used in pagination to say what the last key of the previous page was
try {
    InlineResponse20010 result = apiInstance.listSubscriptionPlans(limit, lastKey);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SubscriptionsApi#listSubscriptionPlans");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
limit Integer How many items to return at one time (max 100) [optional]
lastKey String The key to be used in pagination to say what the last key of the previous page was [optional]

Return type

InlineResponse20010

Authorization

ApiKeyAuth

HTTP request headers

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

listSubscriptions

InlineResponse2006 listSubscriptions(limit, lastKey)

List

List all subscriptions

Example

// Import classes:
//import BillaBear.ApiClient;
//import BillaBear.ApiException;
//import BillaBear.Configuration;
//import BillaBear.auth.*;
//import io.swagger.client.api.SubscriptionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

SubscriptionsApi apiInstance = new SubscriptionsApi();
Integer limit = 56; // Integer | How many items to return at one time (max 100)
String lastKey = "lastKey_example"; // String | The key to be used in pagination to say what the last key of the previous page was
try {
    InlineResponse2006 result = apiInstance.listSubscriptions(limit, lastKey);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SubscriptionsApi#listSubscriptions");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
limit Integer How many items to return at one time (max 100) [optional]
lastKey String The key to be used in pagination to say what the last key of the previous page was [optional]

Return type

InlineResponse2006

Authorization

ApiKeyAuth

HTTP request headers

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

removeSeatsSubscriptions

InlineResponse20011 removeSeatsSubscriptions(body, subscriptionId)

Remove Seats

Remove seats to a per seat subscription<br><br><strong>Since 1.1.4</strong>

Example

// Import classes:
//import BillaBear.ApiClient;
//import BillaBear.ApiException;
//import BillaBear.Configuration;
//import BillaBear.auth.*;
//import io.swagger.client.api.SubscriptionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

SubscriptionsApi apiInstance = new SubscriptionsApi();
SeatsRemoveBody body = new SeatsRemoveBody(); // SeatsRemoveBody | 
String subscriptionId = "subscriptionId_example"; // String | The id of the subscription to retrieve
try {
    InlineResponse20011 result = apiInstance.removeSeatsSubscriptions(body, subscriptionId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SubscriptionsApi#removeSeatsSubscriptions");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body SeatsRemoveBody
subscriptionId String The id of the subscription to retrieve

Return type

InlineResponse20011

Authorization

ApiKeyAuth

HTTP request headers

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

showSubscriptionById

Subscription showSubscriptionById(subscriptionId)

Detail

Info for a specific subscription

Example

// Import classes:
//import BillaBear.ApiClient;
//import BillaBear.ApiException;
//import BillaBear.Configuration;
//import BillaBear.auth.*;
//import io.swagger.client.api.SubscriptionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

SubscriptionsApi apiInstance = new SubscriptionsApi();
String subscriptionId = "subscriptionId_example"; // String | The id of the subscription to retrieve
try {
    Subscription result = apiInstance.showSubscriptionById(subscriptionId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SubscriptionsApi#showSubscriptionById");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
subscriptionId String The id of the subscription to retrieve

Return type

Subscription

Authorization

ApiKeyAuth

HTTP request headers

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

startTrial

Subscription startTrial(body, customerId)

Start Trial Subscription For Customer

Start subscription for a customer

Example

// Import classes:
//import BillaBear.ApiClient;
//import BillaBear.ApiException;
//import BillaBear.Configuration;
//import BillaBear.auth.*;
//import io.swagger.client.api.SubscriptionsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

SubscriptionsApi apiInstance = new SubscriptionsApi();
SubscriptionTrialBody body = new SubscriptionTrialBody(); // SubscriptionTrialBody | 
String customerId = "customerId_example"; // String | The id of the customer to retrieve
try {
    Subscription result = apiInstance.startTrial(body, customerId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SubscriptionsApi#startTrial");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body SubscriptionTrialBody
customerId String The id of the customer to retrieve

Return type

Subscription

Authorization

ApiKeyAuth

HTTP request headers

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