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.
import 'package:servicestack/servicestack.dart';

enum RestrictedResourceType
{
    Store,
    Chain,
    User,
    Undefined,
}

// @ApiResponse(Description="", ResponseType=typeof(AddNewUserResponse), StatusCode=200)
class AddNewUserEndpoint implements IAddNewUserEndpoint, IRestrictedApiRequest, IConvertible
{
    /**
    * IP address of the end user
    */
    // @ApiMember(Description="IP address of the end user", IsRequired=true, Name="X-Forwarded-For", ParameterType="header")
    String? XForwardedFor;

    /**
    * Api Authentication Key
    */
    // @ApiMember(Description="Api Authentication Key", IsRequired=true, ParameterType="query")
    String? ApiKey;

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

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

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

    /**
    * 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.")
    int? InstallmentId;

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

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

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

    int? RestrictedId;
    RestrictedResourceType? RestrictedResourceType;
    /**
    * First Name
    */
    // @ApiMember(Description="First Name", IsRequired=true)
    String? FirstName;

    /**
    * Last Name
    */
    // @ApiMember(Description="Last Name", IsRequired=true)
    String? LastName;

    /**
    * Email Address
    */
    // @ApiMember(Description="Email Address", IsRequired=true)
    String? Email;

    /**
    * Gender
    */
    // @ApiMember(Description="Gender")
    String? Gender;

    /**
    * Address
    */
    // @ApiMember(Description="Address")
    String? Address;

    /**
    * City
    */
    // @ApiMember(Description="City")
    String? City;

    /**
    * State
    */
    // @ApiMember(Description="State")
    String? State;

    /**
    * Zip Code
    */
    // @ApiMember(Description="Zip Code")
    String? Zip;

    /**
    * Home phone
    */
    // @ApiMember(Description="Home phone")
    String? Phone;

    /**
    * Work phone
    */
    // @ApiMember(Description="Work phone")
    String? WorkPhone;

    /**
    * Date of Birth
    */
    // @ApiMember(Description="Date of Birth")
    DateTime? DateOfBirth;

    /**
    * Cell phone
    */
    // @ApiMember(Description="Cell phone")
    String? CellPhone;

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

    /**
    * 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")
    String? ExternalId;

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

    /**
    * ReferralTypeId
    */
    // @ApiMember(Description="ReferralTypeId")
    int? ReferralTypeId;

    /**
    * Emergency contact name
    */
    // @ApiMember(Description="Emergency contact name")
    String? EmergencyContactName;

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

    /**
    * Emergency contact relationship
    */
    // @ApiMember(Description="Emergency contact relationship")
    String? EmergencyContactType;

    AddNewUserEndpoint({this.XForwardedFor,this.ApiKey,this.MemberId,this.StoreId,this.ChainId,this.PackageId,this.InstallmentId,this.StartDate,this.PromoCode,this.StaffId,this.RestrictedId,this.RestrictedResourceType,this.FirstName,this.LastName,this.Email,this.Gender,this.Address,this.City,this.State,this.Zip,this.Phone,this.WorkPhone,this.DateOfBirth,this.CellPhone,this.Note,this.ExternalId,this.Username,this.ReferralTypeId,this.EmergencyContactName,this.EmergencyContactPhone,this.EmergencyContactType});
    AddNewUserEndpoint.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        XForwardedFor = json['XForwardedFor'];
        ApiKey = json['ApiKey'];
        MemberId = json['MemberId'];
        StoreId = json['StoreId'];
        ChainId = json['ChainId'];
        PackageId = json['PackageId'];
        InstallmentId = json['InstallmentId'];
        StartDate = JsonConverters.fromJson(json['StartDate'],'DateTime',context!);
        PromoCode = json['PromoCode'];
        StaffId = json['StaffId'];
        RestrictedId = json['RestrictedId'];
        RestrictedResourceType = JsonConverters.fromJson(json['RestrictedResourceType'],'RestrictedResourceType',context!);
        FirstName = json['FirstName'];
        LastName = json['LastName'];
        Email = json['Email'];
        Gender = json['Gender'];
        Address = json['Address'];
        City = json['City'];
        State = json['State'];
        Zip = json['Zip'];
        Phone = json['Phone'];
        WorkPhone = json['WorkPhone'];
        DateOfBirth = JsonConverters.fromJson(json['DateOfBirth'],'DateTime',context!);
        CellPhone = json['CellPhone'];
        Note = json['Note'];
        ExternalId = json['ExternalId'];
        Username = json['Username'];
        ReferralTypeId = json['ReferralTypeId'];
        EmergencyContactName = json['EmergencyContactName'];
        EmergencyContactPhone = json['EmergencyContactPhone'];
        EmergencyContactType = json['EmergencyContactType'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'XForwardedFor': XForwardedFor,
        'ApiKey': ApiKey,
        'MemberId': MemberId,
        'StoreId': StoreId,
        'ChainId': ChainId,
        'PackageId': PackageId,
        'InstallmentId': InstallmentId,
        'StartDate': JsonConverters.toJson(StartDate,'DateTime',context!),
        'PromoCode': PromoCode,
        'StaffId': StaffId,
        'RestrictedId': RestrictedId,
        'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!),
        'FirstName': FirstName,
        'LastName': LastName,
        'Email': Email,
        'Gender': Gender,
        'Address': Address,
        'City': City,
        'State': State,
        'Zip': Zip,
        'Phone': Phone,
        'WorkPhone': WorkPhone,
        'DateOfBirth': JsonConverters.toJson(DateOfBirth,'DateTime',context!),
        'CellPhone': CellPhone,
        'Note': Note,
        'ExternalId': ExternalId,
        'Username': Username,
        'ReferralTypeId': ReferralTypeId,
        'EmergencyContactName': EmergencyContactName,
        'EmergencyContactPhone': EmergencyContactPhone,
        'EmergencyContactType': EmergencyContactType
    };

    getTypeName() => "AddNewUserEndpoint";
    TypeContext? context = _ctx;
}

class ApiResponse2Base implements IConvertible
{
    bool? success;
    String? message;

    ApiResponse2Base({this.success,this.message});
    ApiResponse2Base.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        success = json['success'];
        message = json['message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'success': success,
        'message': message
    };

    getTypeName() => "ApiResponse2Base";
    TypeContext? context = _ctx;
}

class AddNewUserResponse extends ApiResponse2Base implements IConvertible
{
    String? incompleteAgreementToken;
    int? memberId;
    int? contractId;

    AddNewUserResponse({this.incompleteAgreementToken,this.memberId,this.contractId});
    AddNewUserResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        incompleteAgreementToken = json['incompleteAgreementToken'];
        memberId = json['memberId'];
        contractId = json['contractId'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'incompleteAgreementToken': incompleteAgreementToken,
        'memberId': memberId,
        'contractId': contractId
    });

    getTypeName() => "AddNewUserResponse";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'www.clubready.com', types: <String, TypeInfo> {
    'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
    'AddNewUserEndpoint': TypeInfo(TypeOf.Class, create:() => AddNewUserEndpoint()),
    'ApiResponse2Base': TypeInfo(TypeOf.Class, create:() => ApiResponse2Base()),
    'AddNewUserResponse': TypeInfo(TypeOf.Class, create:() => AddNewUserResponse()),
});

Dart AddNewUserEndpoint DTOs

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

HTTP + CSV

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: text/csv
Content-Type: text/csv
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: text/csv
Content-Length: length

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