Spaces:
Runtime error
Runtime error
A newer version of the Gradio SDK is available: 6.10.0
Aimastering.SubscriptionApi
All URIs are relative to https://api.bakuage.com:443
| Method | HTTP request | Description |
|---|---|---|
| cancelSubscription | PUT /subscriptions/{id}/cancel | Cancel a subscription by id. |
| cancelSubscriptionCancellation | PUT /subscriptions/{id}/cancel_cancellation | Cancel the subscription cancellation by id. |
| createSubscription | POST /subscriptions | Create a new subscription. |
| getSubscription | GET /subscriptions/{id} | Get a subscription by id. |
| listSubscriptions | GET /subscriptions | Get all accessable subscriptions. |
cancelSubscription
Subscription cancelSubscription(id)
Cancel a subscription by id.
Example
var Aimastering = require('aimastering');
var defaultClient = Aimastering.ApiClient.instance;
// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';
var apiInstance = new Aimastering.SubscriptionApi();
var id = 56; // Number | Subscription id
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.cancelSubscription(id, callback);
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | Number | Subscription id |
Return type
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json
cancelSubscriptionCancellation
Subscription cancelSubscriptionCancellation(id)
Cancel the subscription cancellation by id.
Example
var Aimastering = require('aimastering');
var defaultClient = Aimastering.ApiClient.instance;
// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';
var apiInstance = new Aimastering.SubscriptionApi();
var id = 56; // Number | Subscription id
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.cancelSubscriptionCancellation(id, callback);
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | Number | Subscription id |
Return type
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json
createSubscription
Subscription createSubscription(service, opts)
Create a new subscription.
Example
var Aimastering = require('aimastering');
var defaultClient = Aimastering.ApiClient.instance;
// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';
var apiInstance = new Aimastering.SubscriptionApi();
var service = "service_example"; // String | This parameter represents the payment message.
var opts = {
'stripePlanId': "stripePlanId_example", // String | The Stripe plan id. This parameter is effective only when the service is \"stripe\".
'token': "token_example", // String | This parameter represents the card token. This parameter is effective only when the service is \"stripe\".
'affiliateId': "affiliateId_example" // String | Affiliate id of inviter user.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.createSubscription(service, opts, callback);
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| service | String | This parameter represents the payment message. | |
| stripePlanId | String | The Stripe plan id. This parameter is effective only when the service is "stripe". | [optional] |
| token | String | This parameter represents the card token. This parameter is effective only when the service is "stripe". | [optional] |
| affiliateId | String | Affiliate id of inviter user. | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json
getSubscription
Subscription getSubscription(id)
Get a subscription by id.
Example
var Aimastering = require('aimastering');
var defaultClient = Aimastering.ApiClient.instance;
// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';
var apiInstance = new Aimastering.SubscriptionApi();
var id = 56; // Number | Subscription id
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getSubscription(id, callback);
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | Number | Subscription id |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
listSubscriptions
[Subscription] listSubscriptions()
Get all accessable subscriptions.
Example
var Aimastering = require('aimastering');
var defaultClient = Aimastering.ApiClient.instance;
// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';
var apiInstance = new Aimastering.SubscriptionApi();
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.listSubscriptions(callback);
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json