ClubManager.Api

<back to all web services

FindMembership

Requires Authentication
Required role:API
The following routes are available for this service:
All Verbs/api/Query/Membership
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using ClubManager.Api.Services.Query;

namespace ClubManager.Api.Services.Query
{
    [AutoQueryViewer(Description="", IconUrl="octicon:database", Title="Membership")]
    public partial class FindMembership
        : QueryDb<MembershipInstance>
    {
    }

    public partial class LossReasonInstance
    {
        public virtual int LossReasonId { get; set; }
        public virtual string Reason { get; set; }
        public virtual bool Deleted { get; set; }
        public virtual bool Demo { get; set; }
        public virtual bool Selectable { get; set; }
    }

    public partial class MemberInstance
    {
        public MemberInstance()
        {
            Photo = new byte[]{};
        }

        public virtual int MemberId { get; set; }
        public virtual int MemberType { get; set; }
        public virtual string MembershipNumber { get; set; }
        public virtual string CardNumber { get; set; }
        public virtual string CompanyName { get; set; }
        public virtual string Surname { get; set; }
        public virtual string Forenames { get; set; }
        public virtual string Title { get; set; }
        public virtual int Gender { get; set; }
        public virtual DateTime? DateOfBirth { get; set; }
        public virtual string Address1 { get; set; }
        public virtual string Address2 { get; set; }
        public virtual string City { get; set; }
        public virtual string County { get; set; }
        public virtual string Postcode { get; set; }
        public virtual string HomePhone { get; set; }
        public virtual string MobilePhone { get; set; }
        public virtual string EmailAddress { get; set; }
        public virtual bool EmailOptOut { get; set; }
        public virtual bool SmsOptOut { get; set; }
        public virtual bool PhoneOptOut { get; set; }
        public virtual bool LetterOptOut { get; set; }
        public virtual string DirectDebitAccountHolder { get; set; }
        public virtual string DirectDebitAccountNumber { get; set; }
        public virtual string DirectDebitSortCode { get; set; }
        public virtual DateTime? JoinedDate { get; set; }
        public virtual string DirectDebitBankAddress { get; set; }
        public virtual string FullName { get; set; }
        public virtual string ExternalReference { get; set; }
        public virtual byte[] Photo { get; set; }
        public virtual DateTime? PhotoModifiedDate { get; set; }
        public virtual string Notes { get; set; }
        public virtual bool Deleted { get; set; }
        public virtual bool Demo { get; set; }
        public virtual bool UseExternalStatus { get; set; }
        public virtual int ExternalStatus { get; set; }
        public virtual string FreeText { get; set; }
        public virtual Guid? MemberKey { get; set; }
        public virtual decimal Balance { get; set; }
        public virtual decimal CreditLimit { get; set; }
        public virtual DateTime CreatedDate { get; set; }
        public virtual DateTime? ModifiedDate { get; set; }
        public virtual DateTime? DeletedDate { get; set; }
        public virtual int ExternalSource { get; set; }
        public virtual decimal? RetentionMetric { get; set; }
        public virtual decimal? MonthlyAttendanceFrequency { get; set; }
        public virtual int? AssignedToUserId { get; set; }
        public virtual int? CreatedByUserId { get; set; }
        public virtual int? DeletedByUserId { get; set; }
        public virtual LossReasonInstance LossReason { get; set; }
        [References(typeof(ClubManager.Api.Services.Query.LossReasonInstance))]
        public virtual int? LossReasonId { get; set; }

        public virtual int? WonOrLost { get; set; }
        public virtual DateTime? WonOrLostDate { get; set; }
        public virtual bool GiftAidPermission { get; set; }
        public virtual bool? PhotoPermission { get; set; }
        public virtual bool? FirstAidPermission { get; set; }
        public virtual string EmergencyContact { get; set; }
        public virtual UserInstance WonOrLostByUser { get; set; }
        [References(typeof(ClubManager.Api.Services.Query.UserInstance))]
        public virtual int? WonOrLostByUserId { get; set; }

        public virtual DateTime? AgreedToTerms { get; set; }
        public virtual bool OnlineBookingBanned { get; set; }
        public virtual string Country { get; set; }
        public virtual DateTime? FingerprintEnrolled { get; set; }
        public virtual decimal? LastPaymentAmount { get; set; }
        public virtual string Pin { get; set; }
        public virtual int ProspectingPoints { get; set; }
        public virtual int AchievementPoints { get; set; }
        public virtual string ParentForenames { get; set; }
        public virtual string ParentSurname { get; set; }
    }

    public partial class MembershipInstance
    {
        public virtual int MembershipId { get; set; }
        public virtual DateTime StartDate { get; set; }
        public virtual DateTime EndDate { get; set; }
        public virtual DateTime ContractEndDate { get; set; }
        public virtual string Name { get; set; }
        public virtual decimal EnrolmentFee { get; set; }
        public virtual decimal InductionFee { get; set; }
        public virtual decimal? MembershipFee { get; set; }
        public virtual decimal? DirectDebitPayment { get; set; }
        public virtual DateTime? DirectDebitDate { get; set; }
        public virtual MemberInstance Member { get; set; }
        [References(typeof(ClubManager.Api.Services.Query.MemberInstance))]
        public virtual int MemberId { get; set; }

        public virtual int? RefererMemberId { get; set; }
        public virtual int? PromotionId { get; set; }
        public virtual decimal? Payment1Fee { get; set; }
        public virtual DateTime? Payment1Date { get; set; }
        public virtual decimal? Payment2Fee { get; set; }
        public virtual DateTime? Payment2Date { get; set; }
        public virtual int Payment1Type { get; set; }
        public virtual int Payment1Method { get; set; }
        public virtual int Payment2Type { get; set; }
        public virtual int Payment2Method { get; set; }
        public virtual int Payment3Type { get; set; }
        public virtual int Payment3Method { get; set; }
        public virtual decimal? Payment3Fee { get; set; }
        public virtual DateTime? Payment3Date { get; set; }
        public virtual MembershipTypeInstance MembershipType { get; set; }
        [References(typeof(ClubManager.Api.Services.Query.MembershipTypeInstance))]
        public virtual int? MembershipTypeId { get; set; }

        public virtual int? ProviderId { get; set; }
        public virtual string Definition { get; set; }
        public virtual bool HasRecurringPayments { get; set; }
        public virtual bool Deleted { get; set; }
        public virtual bool Demo { get; set; }
        public virtual Guid? MembershipKey { get; set; }
        public virtual int? SessionsRemaining { get; set; }
        public virtual int? ClassesRemaining { get; set; }
        public virtual DateTime? Cancelled { get; set; }
        public virtual DateTime? APICreated { get; set; }
        public virtual DateTime? SuspensionStart { get; set; }
        public virtual DateTime? SuspensionEnd { get; set; }
        public virtual string IpAddress { get; set; }
    }

    public partial class MembershipTypeInstance
    {
        public virtual int MembershipTypeId { get; set; }
        public virtual string Name { get; set; }
        public virtual string Description { get; set; }
        public virtual string Definition { get; set; }
        public virtual ScheduleInstance Schedule { get; set; }
        [References(typeof(ClubManager.Api.Services.Query.ScheduleInstance))]
        public virtual int ScheduleId { get; set; }

        public virtual bool Deleted { get; set; }
        public virtual bool Demo { get; set; }
        public virtual bool Public { get; set; }
        public virtual int? SessionsRemaining { get; set; }
        public virtual int? ClassesRemaining { get; set; }
        public virtual int? SortOrder { get; set; }
        public virtual bool Special { get; set; }
        public virtual bool MultiSiteAccess { get; set; }
        public virtual int MemberLimit { get; set; }
        public virtual string PromotionCode { get; set; }
        public virtual DateTime? PromotionStart { get; set; }
        public virtual DateTime? PromotionEnd { get; set; }
        public virtual int? LicensesRemaining { get; set; }
        public virtual bool BookingAccessOnly { get; set; }
        public virtual int? SessionsPeriod { get; set; }
        public virtual int? SessionsFrequency { get; set; }
        public virtual DateTime? StartsOn { get; set; }
        public virtual bool AllowSelectionAfterStartsOn { get; set; }
    }

    public partial class ScheduleInstance
    {
        public virtual int ScheduleId { get; set; }
        public virtual string Name { get; set; }
        public virtual string Description { get; set; }
        public virtual TimeSpan? MondayFrom { get; set; }
        public virtual TimeSpan? MondayTo { get; set; }
        public virtual TimeSpan? TuesdayFrom { get; set; }
        public virtual TimeSpan? TuesdayTo { get; set; }
        public virtual TimeSpan? WednesdayFrom { get; set; }
        public virtual TimeSpan? WednesdayTo { get; set; }
        public virtual TimeSpan? ThursdayFrom { get; set; }
        public virtual TimeSpan? ThursdayTo { get; set; }
        public virtual TimeSpan? FridayFrom { get; set; }
        public virtual TimeSpan? FridayTo { get; set; }
        public virtual TimeSpan? SaturdayFrom { get; set; }
        public virtual TimeSpan? SaturdayTo { get; set; }
        public virtual TimeSpan? SundayFrom { get; set; }
        public virtual TimeSpan? SundayTo { get; set; }
        public virtual int ScheduleType { get; set; }
        public virtual bool Deleted { get; set; }
        public virtual bool Demo { get; set; }
    }

    public partial class UserInstance
    {
        public virtual int UserId { get; set; }
        public virtual string UserName { get; set; }
        public virtual string Name { get; set; }
        public virtual string Email { get; set; }
        public virtual string MobilePhone { get; set; }
        public virtual bool Enabled { get; set; }
        public virtual DateTime? LastLogin { get; set; }
        public virtual DateTime Created { get; set; }
        public virtual bool Training { get; set; }
        public virtual bool Deleted { get; set; }
        public virtual int CoursesCompleted { get; set; }
        public virtual bool? DisplayHomeNotification { get; set; }
        public virtual bool TwoFactorEnabled { get; set; }
        public virtual bool EmailConfirmed { get; set; }
        public virtual bool MobilePhoneConfirmed { get; set; }
        public virtual bool Notifications { get; set; }
        public virtual DateTime? ChangePassword { get; set; }
        public virtual DateTime? Activated { get; set; }
    }

}

namespace ServiceStack
{
    [DataContract]
    public partial class QueryBase
    {
        public QueryBase()
        {
            Meta = new Dictionary<string, string>{};
        }

        [DataMember(Order=1)]
        public virtual int? Skip { get; set; }

        [DataMember(Order=2)]
        public virtual int? Take { get; set; }

        [DataMember(Order=3)]
        public virtual string OrderBy { get; set; }

        [DataMember(Order=4)]
        public virtual string OrderByDesc { get; set; }

        [DataMember(Order=5)]
        public virtual string Include { get; set; }

        [DataMember(Order=6)]
        public virtual string Fields { get; set; }

        [DataMember(Order=7)]
        public virtual Dictionary<string, string> Meta { get; set; }
    }

    public partial class QueryDb<T>
        : QueryBase
    {
    }

    [DataContract]
    public partial class QueryResponse<T>
    {
        public QueryResponse()
        {
            Results = new List<T>{};
            Meta = new Dictionary<string, string>{};
        }

        [DataMember(Order=1)]
        public virtual int Offset { get; set; }

        [DataMember(Order=2)]
        public virtual int Total { get; set; }

        [DataMember(Order=3)]
        public virtual List<T> Results { get; set; }

        [DataMember(Order=4)]
        public virtual Dictionary<string, string> Meta { get; set; }

        [DataMember(Order=5)]
        public virtual ResponseStatus ResponseStatus { get; set; }
    }

}

C# FindMembership DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/Query/Membership HTTP/1.1 
Host: api.clubmanagercentral.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Skip: 0,
	Take: 0,
	OrderBy: String,
	OrderByDesc: String,
	Include: String,
	Fields: String,
	Meta: 
	{
		String: String
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Offset: 0,
	Total: 0,
	Results: 
	[
		{
			MembershipId: 0,
			StartDate: 0001-01-01,
			EndDate: 0001-01-01,
			ContractEndDate: 0001-01-01,
			Name: String,
			EnrolmentFee: 0,
			InductionFee: 0,
			MembershipFee: 0,
			DirectDebitPayment: 0,
			DirectDebitDate: 0001-01-01,
			Member: 
			{
				MemberId: 0,
				MemberType: 0,
				MembershipNumber: String,
				CardNumber: String,
				CompanyName: String,
				Surname: String,
				Forenames: String,
				Title: String,
				Gender: 0,
				DateOfBirth: 0001-01-01,
				Address1: String,
				Address2: String,
				City: String,
				County: String,
				Postcode: String,
				HomePhone: String,
				MobilePhone: String,
				EmailAddress: String,
				EmailOptOut: False,
				SmsOptOut: False,
				PhoneOptOut: False,
				LetterOptOut: False,
				DirectDebitAccountHolder: String,
				DirectDebitAccountNumber: String,
				DirectDebitSortCode: String,
				JoinedDate: 0001-01-01,
				DirectDebitBankAddress: String,
				FullName: String,
				ExternalReference: String,
				Photo: AA==,
				PhotoModifiedDate: 0001-01-01,
				Notes: String,
				Deleted: False,
				Demo: False,
				UseExternalStatus: False,
				ExternalStatus: 0,
				FreeText: String,
				MemberKey: 00000000000000000000000000000000,
				Balance: 0,
				CreditLimit: 0,
				CreatedDate: 0001-01-01,
				ModifiedDate: 0001-01-01,
				DeletedDate: 0001-01-01,
				ExternalSource: 0,
				RetentionMetric: 0,
				MonthlyAttendanceFrequency: 0,
				AssignedToUserId: 0,
				CreatedByUserId: 0,
				DeletedByUserId: 0,
				LossReason: 
				{
					LossReasonId: 0,
					Reason: String,
					Deleted: False,
					Demo: False,
					Selectable: False
				},
				LossReasonId: 0,
				WonOrLost: 0,
				WonOrLostDate: 0001-01-01,
				GiftAidPermission: False,
				PhotoPermission: False,
				FirstAidPermission: False,
				EmergencyContact: String,
				WonOrLostByUser: 
				{
					UserId: 0,
					UserName: String,
					Name: String,
					Email: String,
					MobilePhone: String,
					Enabled: False,
					LastLogin: 0001-01-01,
					Created: 0001-01-01,
					Training: False,
					Deleted: False,
					CoursesCompleted: 0,
					DisplayHomeNotification: False,
					TwoFactorEnabled: False,
					EmailConfirmed: False,
					MobilePhoneConfirmed: False,
					Notifications: False,
					ChangePassword: 0001-01-01,
					Activated: 0001-01-01
				},
				WonOrLostByUserId: 0,
				AgreedToTerms: 0001-01-01,
				OnlineBookingBanned: False,
				Country: String,
				FingerprintEnrolled: 0001-01-01,
				LastPaymentAmount: 0,
				Pin: String,
				ProspectingPoints: 0,
				AchievementPoints: 0,
				ParentForenames: String,
				ParentSurname: String
			},
			MemberId: 0,
			RefererMemberId: 0,
			PromotionId: 0,
			Payment1Fee: 0,
			Payment1Date: 0001-01-01,
			Payment2Fee: 0,
			Payment2Date: 0001-01-01,
			Payment1Type: 0,
			Payment1Method: 0,
			Payment2Type: 0,
			Payment2Method: 0,
			Payment3Type: 0,
			Payment3Method: 0,
			Payment3Fee: 0,
			Payment3Date: 0001-01-01,
			MembershipType: 
			{
				MembershipTypeId: 0,
				Name: String,
				Description: String,
				Definition: String,
				Schedule: 
				{
					ScheduleId: 0,
					Name: String,
					Description: String,
					MondayFrom: PT0S,
					MondayTo: PT0S,
					TuesdayFrom: PT0S,
					TuesdayTo: PT0S,
					WednesdayFrom: PT0S,
					WednesdayTo: PT0S,
					ThursdayFrom: PT0S,
					ThursdayTo: PT0S,
					FridayFrom: PT0S,
					FridayTo: PT0S,
					SaturdayFrom: PT0S,
					SaturdayTo: PT0S,
					SundayFrom: PT0S,
					SundayTo: PT0S,
					ScheduleType: 0,
					Deleted: False,
					Demo: False
				},
				ScheduleId: 0,
				Deleted: False,
				Demo: False,
				Public: False,
				SessionsRemaining: 0,
				ClassesRemaining: 0,
				SortOrder: 0,
				Special: False,
				MultiSiteAccess: False,
				MemberLimit: 0,
				PromotionCode: String,
				PromotionStart: 0001-01-01,
				PromotionEnd: 0001-01-01,
				LicensesRemaining: 0,
				BookingAccessOnly: False,
				SessionsPeriod: 0,
				SessionsFrequency: 0,
				StartsOn: 0001-01-01,
				AllowSelectionAfterStartsOn: False
			},
			MembershipTypeId: 0,
			ProviderId: 0,
			Definition: String,
			HasRecurringPayments: False,
			Deleted: False,
			Demo: False,
			MembershipKey: 00000000000000000000000000000000,
			SessionsRemaining: 0,
			ClassesRemaining: 0,
			Cancelled: 0001-01-01,
			APICreated: 0001-01-01,
			SuspensionStart: 0001-01-01,
			SuspensionEnd: 0001-01-01,
			IpAddress: String
		}
	],
	Meta: 
	{
		String: String
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}