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. |
---|
import java.math.*
import java.util.*
import net.servicestack.client.*
@ApiResponse(Description="", ResponseType=AddNewUserResponse.class, StatusCode=200)
open class AddNewUserEndpoint : IAddNewUserEndpoint, IRestrictedApiRequest
{
/**
* IP address of the end user
*/
@ApiMember(Description="IP address of the end user", IsRequired=true, Name="X-Forwarded-For", ParameterType="header")
var XForwardedFor:String? = null
/**
* Api Authentication Key
*/
@ApiMember(Description="Api Authentication Key", IsRequired=true, ParameterType="query")
var ApiKey:String? = null
/**
* Member Id of the user buying the Package
*/
@ApiMember(Description="Member Id of the user buying the Package", IsRequired=true, ParameterType="query")
var MemberId:Int? = null
/**
* Id of the store for the user
*/
@ApiMember(Description="Id of the store for the user", IsRequired=true)
var StoreId:Int? = null
var ChainId:Int? = null
/**
* Package Id number of the package being purchased
*/
@ApiMember(Description="Package Id number of the package being purchased", IsRequired=true)
var PackageId:Int? = null
/**
* 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.")
var InstallmentId:Int? = null
/**
* Date contract takes affect
*/
@ApiMember(Description="Date contract takes affect")
var StartDate:Date? = null
/**
* Promo code to apply a discount.
*/
@ApiMember(Description="Promo code to apply a discount.")
var PromoCode:String? = null
/**
* Staff Id of salesperson who sold the agreement.
*/
@ApiMember(Description="Staff Id of salesperson who sold the agreement.")
var StaffId:Int? = null
var RestrictedId:Int? = null
var RestrictedResourceType:RestrictedResourceType? = null
/**
* First Name
*/
@ApiMember(Description="First Name", IsRequired=true)
var FirstName:String? = null
/**
* Last Name
*/
@ApiMember(Description="Last Name", IsRequired=true)
var LastName:String? = null
/**
* Email Address
*/
@ApiMember(Description="Email Address", IsRequired=true)
var Email:String? = null
/**
* Gender
*/
@ApiMember(Description="Gender")
var Gender:String? = null
/**
* Address
*/
@ApiMember(Description="Address")
var Address:String? = null
/**
* City
*/
@ApiMember(Description="City")
var City:String? = null
/**
* State
*/
@ApiMember(Description="State")
var State:String? = null
/**
* Zip Code
*/
@ApiMember(Description="Zip Code")
var Zip:String? = null
/**
* Home phone
*/
@ApiMember(Description="Home phone")
var Phone:String? = null
/**
* Work phone
*/
@ApiMember(Description="Work phone")
var WorkPhone:String? = null
/**
* Date of Birth
*/
@ApiMember(Description="Date of Birth")
var DateOfBirth:Date? = null
/**
* Cell phone
*/
@ApiMember(Description="Cell phone")
var CellPhone:String? = null
/**
* Add an internal note for the new prospect
*/
@ApiMember(Description="Add an internal note for the new prospect")
var Note:String? = null
/**
* 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")
var ExternalId:String? = null
/**
* Username should be between 4 and 255 characters long
*/
@ApiMember(Description="Username should be between 4 and 255 characters long")
var Username:String? = null
/**
* ReferralTypeId
*/
@ApiMember(Description="ReferralTypeId")
var ReferralTypeId:Int? = null
/**
* Emergency contact name
*/
@ApiMember(Description="Emergency contact name")
var EmergencyContactName:String? = null
/**
* Emergency contact phone number
*/
@ApiMember(Description="Emergency contact phone number")
var EmergencyContactPhone:String? = null
/**
* Emergency contact relationship
*/
@ApiMember(Description="Emergency contact relationship")
var EmergencyContactType:String? = null
}
enum class RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
open class AddNewUserResponse : ApiResponse2Base()
{
var incompleteAgreementToken:String? = null
var memberId:Int? = null
var contractId:Int? = null
}
open class ApiResponse2Base
{
var success:Boolean? = null
var message:String? = null
}
Kotlin 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
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"}