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 .xml suffix or ?format=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>