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.
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports ClubReady.Web.Api.Sales.Agreement
Imports ClubReady.Web.Api

Namespace Global

    Namespace ClubReady.Web.Api

        Public Partial Class ApiResponse2Base
            Public Overridable Property success As Boolean
            Public Overridable Property message As String
        End Class

        Public Enum RestrictedResourceType
            Store
            Chain
            User
            Undefined
        End Enum
    End Namespace

    Namespace ClubReady.Web.Api.Sales.Agreement

        <ApiResponse(Description:="", ResponseType:=GetType(AddNewUserResponse), StatusCode:=200)>
        Public Partial Class AddNewUserEndpoint
            Implements IAddNewUserEndpoint
            Implements IRestrictedApiRequest
            '''<Summary>
            '''IP address of the end user
            '''</Summary>
            <ApiMember(Description:="IP address of the end user", IsRequired:=true, Name:="X-Forwarded-For", ParameterType:="header")>
            Public Overridable Property XForwardedFor As String

            '''<Summary>
            '''Api Authentication Key
            '''</Summary>
            <ApiMember(Description:="Api Authentication Key", IsRequired:=true, ParameterType:="query")>
            Public Overridable Property ApiKey As String

            '''<Summary>
            '''Member Id of the user buying the Package
            '''</Summary>
            <ApiMember(Description:="Member Id of the user buying the Package", IsRequired:=true, ParameterType:="query")>
            Public Overridable Property MemberId As Integer

            '''<Summary>
            '''Id of the store for the user
            '''</Summary>
            <ApiMember(Description:="Id of the store for the user", IsRequired:=true)>
            Public Overridable Property StoreId As Nullable(Of Integer)

            Public Overridable Property ChainId As Nullable(Of Integer)
            '''<Summary>
            '''Package Id number of the package being purchased
            '''</Summary>
            <ApiMember(Description:="Package Id number of the package being purchased", IsRequired:=true)>
            Public Overridable Property PackageId As Integer

            '''<Summary>
            '''Installment Plan Id being purchased. If empty, the default package will be selected.
            '''</Summary>
            <ApiMember(Description:="Installment Plan Id being purchased. If empty, the default package will be selected.")>
            Public Overridable Property InstallmentId As Nullable(Of Integer)

            '''<Summary>
            '''Date contract takes affect
            '''</Summary>
            <ApiMember(Description:="Date contract takes affect")>
            Public Overridable Property StartDate As Nullable(Of Date)

            '''<Summary>
            '''Promo code to apply a discount.
            '''</Summary>
            <ApiMember(Description:="Promo code to apply a discount.")>
            Public Overridable Property PromoCode As String

            '''<Summary>
            '''Staff Id of salesperson who sold the agreement.
            '''</Summary>
            <ApiMember(Description:="Staff Id of salesperson who sold the agreement.")>
            Public Overridable Property StaffId As Nullable(Of Integer)

            Public Overridable Property RestrictedId As Nullable(Of Integer)
            Public Overridable Property RestrictedResourceType As RestrictedResourceType
            '''<Summary>
            '''First Name
            '''</Summary>
            <ApiMember(Description:="First Name", IsRequired:=true)>
            Public Overridable Property FirstName As String

            '''<Summary>
            '''Last Name
            '''</Summary>
            <ApiMember(Description:="Last Name", IsRequired:=true)>
            Public Overridable Property LastName As String

            '''<Summary>
            '''Email Address
            '''</Summary>
            <ApiMember(Description:="Email Address", IsRequired:=true)>
            Public Overridable Property Email As String

            '''<Summary>
            '''Gender
            '''</Summary>
            <ApiMember(Description:="Gender")>
            Public Overridable Property Gender As String

            '''<Summary>
            '''Address
            '''</Summary>
            <ApiMember(Description:="Address")>
            Public Overridable Property Address As String

            '''<Summary>
            '''City
            '''</Summary>
            <ApiMember(Description:="City")>
            Public Overridable Property City As String

            '''<Summary>
            '''State
            '''</Summary>
            <ApiMember(Description:="State")>
            Public Overridable Property State As String

            '''<Summary>
            '''Zip Code
            '''</Summary>
            <ApiMember(Description:="Zip Code")>
            Public Overridable Property Zip As String

            '''<Summary>
            '''Home phone
            '''</Summary>
            <ApiMember(Description:="Home phone")>
            Public Overridable Property Phone As String

            '''<Summary>
            '''Work phone
            '''</Summary>
            <ApiMember(Description:="Work phone")>
            Public Overridable Property WorkPhone As String

            '''<Summary>
            '''Date of Birth
            '''</Summary>
            <ApiMember(Description:="Date of Birth")>
            Public Overridable Property DateOfBirth As Nullable(Of Date)

            '''<Summary>
            '''Cell phone
            '''</Summary>
            <ApiMember(Description:="Cell phone")>
            Public Overridable Property CellPhone As String

            '''<Summary>
            '''Add an internal note for the new prospect
            '''</Summary>
            <ApiMember(Description:="Add an internal note for the new prospect")>
            Public Overridable Property Note As String

            '''<Summary>
            '''Unique Id for the user from your system. We store internally as ExternalUserId
            '''</Summary>
            <ApiMember(Description:="Unique Id for the user from your system. We store internally as ExternalUserId")>
            Public Overridable Property ExternalId As String

            '''<Summary>
            '''Username should be between 4 and 255 characters long
            '''</Summary>
            <ApiMember(Description:="Username should be between 4 and 255 characters long")>
            Public Overridable Property Username As String

            '''<Summary>
            '''ReferralTypeId
            '''</Summary>
            <ApiMember(Description:="ReferralTypeId")>
            Public Overridable Property ReferralTypeId As Nullable(Of Integer)

            '''<Summary>
            '''Emergency contact name
            '''</Summary>
            <ApiMember(Description:="Emergency contact name")>
            Public Overridable Property EmergencyContactName As String

            '''<Summary>
            '''Emergency contact phone number
            '''</Summary>
            <ApiMember(Description:="Emergency contact phone number")>
            Public Overridable Property EmergencyContactPhone As String

            '''<Summary>
            '''Emergency contact relationship
            '''</Summary>
            <ApiMember(Description:="Emergency contact relationship")>
            Public Overridable Property EmergencyContactType As String
        End Class

        Public Partial Class AddNewUserResponse
            Inherits ApiResponse2Base
            Public Overridable Property incompleteAgreementToken As String
            Public Overridable Property memberId As Nullable(Of Integer)
            Public Overridable Property contractId As Nullable(Of Integer)
        End Class
    End Namespace
End Namespace

VB.NET AddNewUserEndpoint DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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/json
Content-Type: application/json
Content-Length: length

{"XForwardedFor":"String","ApiKey":"String","MemberId":0,"StoreId":0,"ChainId":0,"PackageId":0,"InstallmentId":0,"StartDate":"0001-01-01T00:00:00.0000000","PromoCode":"String","StaffId":0,"RestrictedId":0,"RestrictedResourceType":"Store","FirstName":"String","LastName":"String","Email":"String","Gender":"String","Address":"String","City":"String","State":"String","Zip":"String","Phone":"String","WorkPhone":"String","DateOfBirth":"0001-01-01T00:00:00.0000000","CellPhone":"String","Note":"String","ExternalId":"String","Username":"String","ReferralTypeId":0,"EmergencyContactName":"String","EmergencyContactPhone":"String","EmergencyContactType":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"incompleteAgreementToken":"String","memberId":0,"contractId":0,"success":false,"message":"String"}