The subscription to add.
The response body if response status OK, or response body of validation errors if response status 400.
Convert a trial into a subscription.
const client = new OutsetaApiClient({
subdomain: 'test-company',
apiKey: example_key,
secretKey: example_secret
});
const response = await client.billing.subscriptions.changeTrialToSubscribed(uid);
console.log(response);
The uid of the subscription to convert to a subscription.
Null if the response status OK, or response body of validation errors if response status 400.
Get a specific subscription from Outseta:
const client = new OutsetaApiClient({
subdomain: 'test-company',
apiKey: example_key,
secretKey: example_secret
});
const response = await client.billing.subscriptions.get(uid);
console.log(response);
The uid of the subscription to retrieve.
Not all fields on the model are returned by default - you can request specific fields with a that looks something like ',Plan.,Account.Uid'. Note: the shape of the returned object may not match the model in this library if this string does not start with '*' as shown.
The response body if response status OK.
Get all subscriptions from Outseta:
const client = new OutsetaApiClient({
subdomain: 'test-company',
apiKey: example_key,
secretKey: example_secret
});
const response = await client.billing.subscriptions.getAll();
console.log(response);
Get all subscriptions for a particular account from Outseta:
const client = new OutsetaApiClient({
subdomain: 'test-company',
apiKey: example_key,
secretKey: example_secret
});
const Account = {
Uid: 'jW7GJVWq'
};
const response = await client.billing.subscriptions.getAll({ Account });
console.log(response);
Get all subscriptions only for a particular account.
Not all fields on the model are returned by default - you can request specific fields with a that looks something like ',Plan.,Account.Uid'. Note: the shape of the returned object may not match the model in this library if this string does not start with '*' as shown.
The number of results returned by the API.
For pagination; returns (limit) results after this value.
The response body if response status OK.
Like add
, but returns an Invoice object without actually saving any changes. Used to show the user what they
would be charged.
const client = new OutsetaApiClient({
subdomain: 'test-company',
apiKey: example_key,
secretKey: example_secret
});
const response = await client.billing.subscriptions.previewAdd({
Account: {
Uid: accountUid
},
Plan: {
Uid: planUid
},
BillingRenewalTerm: 1 // Monthly, 2 for Annually
});
console.log(response);
The subscription to preview charges for.
The response body if response status OK, or response body of validation errors if response status 400.
Like update
, but returns an Invoice object without actually saving any changes. Used to show the user what they
would be charged.
const client = new OutsetaApiClient({
subdomain: 'test-company',
apiKey: example_key,
secretKey: example_secret
});
const response = await client.billing.subscriptions.previewUpdate({
Uid: uid,
Account: {
Uid: accountUid
},
Plan: {
Uid: planUid
},
SubscriptionAddOns: [],
BillingRenewalTerm: 1 // Monthly, 2 for Annually
});
console.log(response);
The subscription to update.
The response body if response status OK, or response body of validation errors if response status 400.
Set the "subscription upgrade required" flag on the subscription.
const client = new OutsetaApiClient({
subdomain: 'test-company',
apiKey: example_key,
secretKey: example_secret
});
const response = await client.billing.subscriptions.setSubscriptionUpgradeRequired({
IsPlanUpgradeRequired: true,
PlanUpgradeRequiredMessage: 'Usage too high',
Uid: 'LmJMEYWP'
});
console.log(response);
The subscription with 'IsPlanUpgradeRequired' and a 'PlanUpgradeRequiredMessage' if desired.
The response body if response status OK, or response body of validation errors if response status 400.
Update an existing subscription.
const client = new OutsetaApiClient({
subdomain: 'test-company',
apiKey: example_key,
secretKey: example_secret
});
const response = await client.billing.subscriptions.update({
Uid: uid,
Account: {
Uid: accountUid
},
Plan: {
Uid: planUid
},
SubscriptionAddOns: [],
BillingRenewalTerm: 1 // Monthly, 2 for Annually
});
console.log(response);
The subscription to update.
The response body if response status OK, or response body of validation errors if response status 400.
Generated using TypeDoc
Add a subscription to an account for the first time.
Response If the server returns a non-"OK" status, the whole response object will be thrown.