ClubReady Api

<back to all web services

AddNewUserEndpoint

The following routes are available for this service:
POST/sales/agreement/addNewUserSet up a package that will be sold to an existing userSet up a package that will be sold to an existing user. The header `X-Forwarded-For` is required and should be set to the IP address of the end user.

export enum RestrictedResourceType
{
    Store = 'Store',
    Chain = 'Chain',
    User = 'User',
    Undefined = 'Undefined',
}

// @ApiResponse(Description="", ResponseType="typeof(ClubReady.Web.Api.Sales.Agreement.AddNewUserResponse)", StatusCode=200)
export class AddNewUserEndpoint implements IAddNewUserEndpoint, IRestrictedApiRequest
{
    /**
    * IP address of the end user
    */
    // @ApiMember(Description="IP address of the end user", IsRequired=true, Name="X-Forwarded-For", ParameterType="header")
    public XForwardedFor: string;

    /**
    * Api Authentication Key
    */
    // @ApiMember(Description="Api Authentication Key", IsRequired=true, ParameterType="query")
    public ApiKey: string;

    /**
    * Member Id of the user buying the Package
    */
    // @ApiMember(Description="Member Id of the user buying the Package", IsRequired=true, ParameterType="query")
    public MemberId: number;

    /**
    * Id of the store for the user
    */
    // @ApiMember(Description="Id of the store for the user", IsRequired=true)
    public StoreId: number;

    public ChainId?: number;
    /**
    * Package Id number of the package being purchased
    */
    // @ApiMember(Description="Package Id number of the package being purchased", IsRequired=true)
    public PackageId: number;

    /**
    * Installment Plan Id being purchased. If empty, the default package will be selected.
    */
    // @ApiMember(Description="Installment Plan Id being purchased. If empty, the default package will be selected.")
    public InstallmentId?: number;

    /**
    * Date contract takes affect
    */
    // @ApiMember(Description="Date contract takes affect")
    public StartDate?: string;

    /**
    * Promo code to apply a discount.
    */
    // @ApiMember(Description="Promo code to apply a discount.")
    public PromoCode?: string;

    /**
    * Staff Id of salesperson who sold the agreement.
    */
    // @ApiMember(Description="Staff Id of salesperson who sold the agreement.")
    public StaffId?: number;

    public RestrictedId?: number;
    public RestrictedResourceType: RestrictedResourceType;
    /**
    * First Name
    */
    // @ApiMember(Description="First Name", IsRequired=true)
    public FirstName: string;

    /**
    * Last Name
    */
    // @ApiMember(Description="Last Name", IsRequired=true)
    public LastName: string;

    /**
    * Email Address
    */
    // @ApiMember(Description="Email Address", IsRequired=true)
    public Email: string;

    /**
    * Gender
    */
    // @ApiMember(Description="Gender")
    public Gender?: string;

    /**
    * Address
    */
    // @ApiMember(Description="Address")
    public Address?: string;

    /**
    * City
    */
    // @ApiMember(Description="City")
    public City?: string;

    /**
    * State
    */
    // @ApiMember(Description="State")
    public State?: string;

    /**
    * Zip Code
    */
    // @ApiMember(Description="Zip Code")
    public Zip?: string;

    /**
    * Home phone
    */
    // @ApiMember(Description="Home phone")
    public Phone?: string;

    /**
    * Work phone
    */
    // @ApiMember(Description="Work phone")
    public WorkPhone?: string;

    /**
    * Date of Birth
    */
    // @ApiMember(Description="Date of Birth")
    public DateOfBirth?: string;

    /**
    * Cell phone
    */
    // @ApiMember(Description="Cell phone")
    public CellPhone?: string;

    /**
    * Add an internal note for the new prospect
    */
    // @ApiMember(Description="Add an internal note for the new prospect")
    public Note?: string;

    /**
    * Unique Id for the user from your system. We store internally as ExternalUserId
    */
    // @ApiMember(Description="Unique Id for the user from your system. We store internally as ExternalUserId")
    public ExternalId?: string;

    /**
    * Username should be between 4 and 255 characters long
    */
    // @ApiMember(Description="Username should be between 4 and 255 characters long")
    public Username?: string;

    /**
    * ReferralTypeId
    */
    // @ApiMember(Description="ReferralTypeId")
    public ReferralTypeId?: number;

    /**
    * Emergency contact name
    */
    // @ApiMember(Description="Emergency contact name")
    public EmergencyContactName?: string;

    /**
    * Emergency contact phone number
    */
    // @ApiMember(Description="Emergency contact phone number")
    public EmergencyContactPhone?: string;

    /**
    * Emergency contact relationship
    */
    // @ApiMember(Description="Emergency contact relationship")
    public EmergencyContactType?: string;

    public constructor(init?: Partial<AddNewUserEndpoint>) { (Object as any).assign(this, init); }
}

export class ApiResponse2Base
{
    public success: boolean;
    public message?: string;

    public constructor(init?: Partial<ApiResponse2Base>) { (Object as any).assign(this, init); }
}

export class AddNewUserResponse extends ApiResponse2Base
{
    public incompleteAgreementToken?: string;
    public memberId?: number;
    public contractId?: number;

    public constructor(init?: Partial<AddNewUserResponse>) { super(init); (Object as any).assign(this, init); }
}

TypeScript AddNewUserEndpoint 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.

POST /sales/agreement/addNewUser HTTP/1.1 
Host: www.clubready.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<AddNewUserEndpoint xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Sales.Agreement">
  <Address>String</Address>
  <ApiKey>String</ApiKey>
  <CellPhone>String</CellPhone>
  <ChainId>0</ChainId>
  <City>String</City>
  <DateOfBirth>0001-01-01T00:00:00</DateOfBirth>
  <Email>String</Email>
  <EmergencyContactName>String</EmergencyContactName>
  <EmergencyContactPhone>String</EmergencyContactPhone>
  <EmergencyContactType>String</EmergencyContactType>
  <ExternalId>String</ExternalId>
  <FirstName>String</FirstName>
  <Gender>String</Gender>
  <InstallmentId>0</InstallmentId>
  <LastName>String</LastName>
  <MemberId>0</MemberId>
  <Note>String</Note>
  <PackageId>0</PackageId>
  <Phone>String</Phone>
  <PromoCode>String</PromoCode>
  <ReferralTypeId>0</ReferralTypeId>
  <StaffId>0</StaffId>
  <StartDate>0001-01-01T00:00:00</StartDate>
  <State>String</State>
  <StoreId>0</StoreId>
  <Username>String</Username>
  <WorkPhone>String</WorkPhone>
  <XForwardedFor>String</XForwardedFor>
  <Zip>String</Zip>
</AddNewUserEndpoint>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AddNewUserResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Sales.Agreement">
  <message xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api">String</message>
  <success xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api">false</success>
  <contractId>0</contractId>
  <incompleteAgreementToken>String</incompleteAgreementToken>
  <memberId>0</memberId>
</AddNewUserResponse>