MWS: Overview of Subscription API calls

Overview of Subscription API calls

AssignSubTypeToMember(int memberId, string subTypeId, DateTime startDate, string siteId)

Call this to assign a subscription to a member in the Plus2 database. An unpaid debt is left on the member’s account in Plus2. If payment has been received you can then call SetMemberSubPaid.

AssignSubTypeToMemberDate(int memberId, string subTypeId, DateTime startDate, string siteId, DateTime earliestEndDate)

This method behaves exactly as AssignSubTypeToMember, but allows the Plus2 Earliest End Date to be specified.

AssignSubTypeToMemberWithDetails(obj requestDetails)

This method allocates an unpaid Subscription to a member from the given start date. The earliest end date and renewal stop date can also be set. It returns the relevant Subscription and Invoice Details.

DecrementUsagesOnSub(int memberId, int subscriptionRef, int usageCount, string transactionId)

Call this method to decrement the number of usages for a given subscription and member by a certain amount, returning the number of usages remaining. You may use this method to increment the usages on a subscription if WSI configuration allows it. The transactionId must be a unique id which cannot be re-used. This is designed to prevent the webmethod being called repeatedly to represent a single transaction.

GetAllAvailableSubs(int memberId, string siteId, bool webBookableOnly)

Call this to retrieve an array of SubscriptionType objects available to be purchased. Set memberId as 0 to see the subscriptions which non-members can purchase. SiteId can be a single site or comma- separated list of site ids.

This method is due to be deprecated in favour of GetAvailableSubsByStartDate().

GetAvailableSubsByStartDate(obj request)

This method give the same results as GetAllAvailableSubs with additional price information and next collection date.

SetMemberSubPaid(int memberId, string subscriptionRef, bool payAll, int externalAuditId)

Call this to set a subscription to the paid status in the Plus2 database. If you set pay all to true it will pay off all the invoices assigned to this subscription. If this is false it will pay off only those that are due.

StopSubscriptionRenewal()

This method sets the renewalStopDate allowing start of day procedures to correctly stop the subscription. It is recommended that the StopSubscriptionRenewal request parameter

AdhereToEarliestEndDate is set to true.  It returns a SuccessFailureWithMessage