new V2_MembershipAPI(rest)
This class is used to interact with Memberships in TidyHQ.
Parameters:
Name | Type | Description |
---|---|---|
rest | Rest | The rest instance to use for requests. |
- Source
Methods
(async) getMembership(membership_id, optionsopt) → {Promise.<TidyAPI_V2_Membership>}
Get a single membership from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
membership_id | string | The id of the membership to get. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The membership.
- Type:
- Promise.<TidyAPI_V2_Membership>
(async) getMemberships(optionsopt) → {Promise.<TidyAPI_V2_Memberships>}
Get a list of memberships from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An array of memberships.
- Type:
- Promise.<TidyAPI_V2_Memberships>
(async) getSubscriptions(optionsopt) → {Promise.<TidyAPI_V2_Subscriptions>}
Get a list of subscriptions from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An array of subscriptions.
- Type:
- Promise.<TidyAPI_V2_Subscriptions>
(async) renewSubscriptionForMembership(membership_id, subscription, optionsopt) → {Promise.<TidyAPI_V2_SubscriptionPost>}
Create/renew a subscription for a membership in TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
membership_id | string | The id of the membership to create a subscription for. | ||||||||||
subscription | Tidy_V2_PostSubscriptionParams | The subscription parameters. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The subscription, membership, payment url and invoice id.
- Type:
- Promise.<TidyAPI_V2_SubscriptionPost>