ClubReady Api

<back to all web services

PackageEligibilityRequest

The following routes are available for this service:
GET/sales/members/{MemberId}/package-eligibilityFind out is a user is eligible to purchase a certain package.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using ClubReady.Web.Api.Sales.Model;
using ClubReady.Core.Api.Models;
using ClubReady.Web.Api;
using ClubReady.Core.Sales.Models;

namespace ClubReady.Core.Api.Models
{
    public partial class ApiDtoBase
    {
        public virtual string ApiKey { get; set; }
        public virtual int? StoreId { get; set; }
        public virtual int? ChainId { get; set; }
    }

    public partial class ApiResponseBase
    {
        public virtual bool Success { get; set; }
        public virtual string Message { get; set; }
    }

    public partial class PackageEligibilityRequestDto
        : ApiDtoBase
    {
        public virtual int PackageId { get; set; }
        public virtual int MemberId { get; set; }
    }

    public partial class PackageEligibilityResponseDto
        : ApiResponseBase
    {
        public virtual PackageEligibility EligibilityInfo { get; set; }
    }

}

namespace ClubReady.Core.Sales.Models
{
    public partial class PackageEligibility
    {
        public PackageEligibility()
        {
            Eligibility = new List<PackageEligibilityItem>{};
        }

        public virtual bool IsEligible { get; set; }
        public virtual List<PackageEligibilityItem> Eligibility { get; set; }
    }

    public partial class PackageEligibilityItem
    {
        public virtual string Name { get; set; }
        public virtual string Value { get; set; }
        public virtual bool IsEligible { get; set; }
        public virtual string Message { get; set; }
    }

}

namespace ClubReady.Web.Api
{
    public enum RestrictedResourceType
    {
        Store,
        Chain,
        User,
        Undefined,
    }

}

namespace ClubReady.Web.Api.Sales.Model
{
    public partial class PackageEligibilityRequest
        : PackageEligibilityRequestDto, IRestrictedApiRequest
    {
        ///<summary>
        ///Api Key - grants access to resources
        ///</summary>
        [ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query")]
        public virtual string ApiKey { get; set; }

        ///<summary>
        ///Store ID # member belongs to
        ///</summary>
        [ApiMember(DataType="integer", Description="Store ID # member belongs to", IsRequired=true, Name="StoreId", ParameterType="query")]
        public virtual int? StoreId { get; set; }

        ///<summary>
        ///ID of the member to lookup
        ///</summary>
        [ApiMember(DataType="integer", Description="ID of the member to lookup", IsRequired=true, Name="MemberId", ParameterType="path")]
        public virtual int MemberId { get; set; }

        ///<summary>
        ///ID of the package to check
        ///</summary>
        [ApiMember(DataType="integer", Description="ID of the package to check", IsRequired=true, Name="PackageId", ParameterType="query")]
        public virtual int PackageId { get; set; }

        public virtual int? RestrictedId { get; set; }
        public virtual RestrictedResourceType RestrictedResourceType { get; set; }
    }

    public partial class PackageEligibilityResponse
        : PackageEligibilityResponseDto
    {
        public virtual PackageEligibility EligibilityInfo { get; set; }
    }

}

C# PackageEligibilityRequest DTOs

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

HTTP + XML

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

GET /sales/members/{MemberId}/package-eligibility HTTP/1.1 
Host: clubready.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<PackageEligibilityResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Sales.Model">
  <Message xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Message>
  <Success xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">false</Success>
  <EligibilityInfo xmlns:d2p1="http://schemas.datacontract.org/2004/07/ClubReady.Core.Sales.Models" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">
    <d2p1:Eligibility>
      <d2p1:PackageEligibilityItem>
        <d2p1:IsEligible>false</d2p1:IsEligible>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Name>String</d2p1:Name>
        <d2p1:Value>String</d2p1:Value>
      </d2p1:PackageEligibilityItem>
    </d2p1:Eligibility>
    <d2p1:IsEligible>false</d2p1:IsEligible>
  </EligibilityInfo>
</PackageEligibilityResponse>