POST | /sales/agreement/addNewUser | Set up a package that will be sold to an existing user | Set 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. |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using ClubReady.Web.Api.Sales.Agreement;
using ClubReady.Web.Api;
namespace ClubReady.Web.Api
{
public partial class ApiResponse2Base
{
public virtual bool success { get; set; }
public virtual string message { get; set; }
}
public enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
}
namespace ClubReady.Web.Api.Sales.Agreement
{
[ApiResponse(Description="", ResponseType=typeof(ClubReady.Web.Api.Sales.Agreement.AddNewUserResponse), StatusCode=200)]
public partial class AddNewUserEndpoint
: IAddNewUserEndpoint, 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 virtual string XForwardedFor { get; set; }
///<summary>
///Api Authentication Key
///</summary>
[ApiMember(Description="Api Authentication Key", IsRequired=true, ParameterType="query")]
public virtual string ApiKey { get; set; }
///<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 virtual int MemberId { get; set; }
///<summary>
///Id of the store for the user
///</summary>
[ApiMember(Description="Id of the store for the user", IsRequired=true)]
public virtual int? StoreId { get; set; }
public virtual int? ChainId { get; set; }
///<summary>
///Package Id number of the package being purchased
///</summary>
[ApiMember(Description="Package Id number of the package being purchased", IsRequired=true)]
public virtual int PackageId { get; set; }
///<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 virtual int? InstallmentId { get; set; }
///<summary>
///Date contract takes affect
///</summary>
[ApiMember(Description="Date contract takes affect")]
public virtual DateTime? StartDate { get; set; }
///<summary>
///Promo code to apply a discount.
///</summary>
[ApiMember(Description="Promo code to apply a discount.")]
public virtual string PromoCode { get; set; }
///<summary>
///Staff Id of salesperson who sold the agreement.
///</summary>
[ApiMember(Description="Staff Id of salesperson who sold the agreement.")]
public virtual int? StaffId { get; set; }
public virtual int? RestrictedId { get; set; }
public virtual RestrictedResourceType RestrictedResourceType { get; set; }
///<summary>
///First Name
///</summary>
[ApiMember(Description="First Name", IsRequired=true)]
public virtual string FirstName { get; set; }
///<summary>
///Last Name
///</summary>
[ApiMember(Description="Last Name", IsRequired=true)]
public virtual string LastName { get; set; }
///<summary>
///Email Address
///</summary>
[ApiMember(Description="Email Address", IsRequired=true)]
public virtual string Email { get; set; }
///<summary>
///Gender
///</summary>
[ApiMember(Description="Gender")]
public virtual string Gender { get; set; }
///<summary>
///Address
///</summary>
[ApiMember(Description="Address")]
public virtual string Address { get; set; }
///<summary>
///City
///</summary>
[ApiMember(Description="City")]
public virtual string City { get; set; }
///<summary>
///State
///</summary>
[ApiMember(Description="State")]
public virtual string State { get; set; }
///<summary>
///Zip Code
///</summary>
[ApiMember(Description="Zip Code")]
public virtual string Zip { get; set; }
///<summary>
///Home phone
///</summary>
[ApiMember(Description="Home phone")]
public virtual string Phone { get; set; }
///<summary>
///Work phone
///</summary>
[ApiMember(Description="Work phone")]
public virtual string WorkPhone { get; set; }
///<summary>
///Date of Birth
///</summary>
[ApiMember(Description="Date of Birth")]
public virtual DateTime? DateOfBirth { get; set; }
///<summary>
///Cell phone
///</summary>
[ApiMember(Description="Cell phone")]
public virtual string CellPhone { get; set; }
///<summary>
///Add an internal note for the new prospect
///</summary>
[ApiMember(Description="Add an internal note for the new prospect")]
public virtual string Note { get; set; }
///<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 virtual string ExternalId { get; set; }
///<summary>
///Username should be between 4 and 255 characters long
///</summary>
[ApiMember(Description="Username should be between 4 and 255 characters long")]
public virtual string Username { get; set; }
///<summary>
///ReferralTypeId
///</summary>
[ApiMember(Description="ReferralTypeId")]
public virtual int? ReferralTypeId { get; set; }
///<summary>
///Emergency contact name
///</summary>
[ApiMember(Description="Emergency contact name")]
public virtual string EmergencyContactName { get; set; }
///<summary>
///Emergency contact phone number
///</summary>
[ApiMember(Description="Emergency contact phone number")]
public virtual string EmergencyContactPhone { get; set; }
///<summary>
///Emergency contact relationship
///</summary>
[ApiMember(Description="Emergency contact relationship")]
public virtual string EmergencyContactType { get; set; }
}
public partial class AddNewUserResponse
: ApiResponse2Base
{
public virtual string incompleteAgreementToken { get; set; }
public virtual int? memberId { get; set; }
public virtual int? contractId { get; set; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=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"}