V2_MembershipLevelsAPI

new V2_MembershipLevelsAPI(rest)

This class is used to interact with Memberships in TidyHQ.
Parameters:
NameTypeDescription
restRestThe rest instance to use for requests.

Methods

(async) createMembership(membership_level_id, subscription, optionsopt) → {Promise.<TidyAPI_V2_SubscriptionPost>}

Create a membership in TidyHQ.
Parameters:
NameTypeAttributesDefaultDescription
membership_level_idstringThe id of the membership level to subscribe to.
subscriptionTidy_V2_PostSubscriptionParamsThe subscription parameters.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- The subscription, membership, payment url and invoice id.
Type: 
Promise.<TidyAPI_V2_SubscriptionPost>

(async) getMembershipLevels(optionsopt) → {Promise.<TidyAPI_V2_MembershipLevels>}

Get a list of membership levels from TidyHQ.
Parameters:
NameTypeAttributesDefaultDescription
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
updated_beforestring<optional>
ISO8601 formatted timestamp, only returns results last updated before the given time.
updated_sincestring<optional>
ISO8601 formatted timestamp, only returns results last updated since the given time.
limitnumber<optional>
The maximum number of memberships per page to return.
offsetnumber<optional>
The number of memberships to skip.
allboolean<optional>
When given, returns all (including inactive) - defaults to only returning visible / active.
Returns:
- An array of membership levels.
Type: 
Promise.<TidyAPI_V2_MembershipLevels>