ClubReady Api

<back to all web services

ContractSoldNewUserEndpoint

The following routes are available for this service:
POST/sales/contract/sold/new/userCreate a user and sell them a packageCreate a new user and sell them a package. The PaymentMethods property is an array of objects describing how you want ClubReady to take payment while selling the PackageId/InstallmentPlanId. **NOTE** This endpoint is not Click-to-Cancel compliant and should be transitioned to
namespace ClubReady.Core.Api.Models

open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<DataContract>]
    [<AllowNullLiteral>]
    type PaymentMethodDto() = 
        [<DataMember>]
        member val AcctToken:String = null with get,set

        [<DataMember>]
        member val ProfileToken:String = null with get,set

        [<DataMember>]
        member val PaymentProfileId:String = null with get,set

        [<DataMember>]
        member val PaymentAmount:Nullable<Decimal> = new Nullable<Decimal>() with get,set

        [<DataMember>]
        member val UsePreferred:Nullable<Boolean> = new Nullable<Boolean>() with get,set

        [<DataMember>]
        member val DoNotUpdatePaymentTypePreference:Nullable<Boolean> = new Nullable<Boolean>() with get,set

    type RestrictedResourceType =
        | Store = 0
        | Chain = 1
        | User = 2
        | Undefined = 3

    [<ApiResponse(Description="", ResponseType=typeof<ContractSoldNewUserResponse>, StatusCode=200)>]
    [<AllowNullLiteral>]
    type ContractSoldNewUserEndpoint() = 
        ///<summary>
        ///IP address of the end user
        ///</summary>
        [<ApiMember(Description="IP address of the end user", Name="X-Forwarded-For", ParameterType="header")>]
        member val XForwardedFor:String = null with get,set

        ///<summary>
        ///Api Authentication Key
        ///</summary>
        [<ApiMember(Description="Api Authentication Key", IsRequired=true, ParameterType="query")>]
        member val ApiKey:String = null with get,set

        ///<summary>
        ///Id for the chain of the Api Key
        ///</summary>
        [<ApiMember(Description="Id for the chain of the Api Key", ParameterType="query")>]
        member val ChainId:Nullable<Int32> = new Nullable<Int32>() with get,set

        ///<summary>
        ///Id of the store for the user
        ///</summary>
        [<ApiMember(Description="Id of the store for the user", IsRequired=true, ParameterType="query")>]
        member val StoreId:Nullable<Int32> = new Nullable<Int32>() with get,set

        ///<summary>
        ///Package Id being sold
        ///</summary>
        [<ApiMember(Description="Package Id being sold", IsRequired=true)>]
        member val PackageId:Int32 = new Int32() with get,set

        ///<summary>
        ///Installment Plan Id being sold
        ///</summary>
        [<ApiMember(Description="Installment Plan Id being sold", IsRequired=true)>]
        member val InstallmentPlanId:Int32 = new Int32() with get,set

        ///<summary>
        ///Amount being paid
        ///</summary>
        [<ApiMember(Description="Amount being paid", IsRequired=true)>]
        member val PaymentAmount:Decimal = new Decimal() with get,set

        ///<summary>
        ///Date contract takes affect
        ///</summary>
        [<ApiMember(Description="Date contract takes affect")>]
        member val StartDate:Nullable<DateTime> = new Nullable<DateTime>() with get,set

        ///<summary>
        ///First Name
        ///</summary>
        [<ApiMember(Description="First Name", IsRequired=true)>]
        member val FirstName:String = null with get,set

        ///<summary>
        ///Last Name
        ///</summary>
        [<ApiMember(Description="Last Name", IsRequired=true)>]
        member val LastName:String = null with get,set

        ///<summary>
        ///Email Address
        ///</summary>
        [<ApiMember(Description="Email Address", IsRequired=true)>]
        member val Email:String = null with get,set

        ///<summary>
        ///Gender
        ///</summary>
        [<ApiMember(Description="Gender")>]
        member val Gender:String = null with get,set

        ///<summary>
        ///Address
        ///</summary>
        [<ApiMember(Description="Address")>]
        member val Address:String = null with get,set

        ///<summary>
        ///City
        ///</summary>
        [<ApiMember(Description="City")>]
        member val City:String = null with get,set

        ///<summary>
        ///State
        ///</summary>
        [<ApiMember(Description="State")>]
        member val State:String = null with get,set

        ///<summary>
        ///Zip Code
        ///</summary>
        [<ApiMember(Description="Zip Code")>]
        member val Zip:String = null with get,set

        ///<summary>
        ///Home phone
        ///</summary>
        [<ApiMember(Description="Home phone")>]
        member val Phone:String = null with get,set

        ///<summary>
        ///Work phone
        ///</summary>
        [<ApiMember(Description="Work phone")>]
        member val WorkPhone:String = null with get,set

        ///<summary>
        ///Date of Birth
        ///</summary>
        [<ApiMember(Description="Date of Birth")>]
        member val DateOfBirth:Nullable<DateTime> = new Nullable<DateTime>() with get,set

        ///<summary>
        ///Cell phone
        ///</summary>
        [<ApiMember(Description="Cell phone")>]
        member val CellPhone:String = null with get,set

        ///<summary>
        ///Add an internal note for the new prospect
        ///</summary>
        [<ApiMember(Description="Add an internal note for the new prospect")>]
        member val Note:String = null with 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")>]
        member val ExternalId:String = null with get,set

        ///<summary>
        ///Promo code to apply a discount.
        ///</summary>
        [<ApiMember(Description="Promo code to apply a discount.")>]
        member val PromoCode:String = null with get,set

        ///<summary>
        ///Username should be between 4 and 255 characters long
        ///</summary>
        [<ApiMember(Description="Username should be between 4 and 255 characters long")>]
        member val Username:String = null with get,set

        ///<summary>
        ///ReferralTypeId
        ///</summary>
        [<ApiMember(Description="ReferralTypeId")>]
        member val ReferralTypeId:Nullable<Int32> = new Nullable<Int32>() with get,set

        ///<summary>
        ///Emergency contact name
        ///</summary>
        [<ApiMember(Description="Emergency contact name")>]
        member val EmergencyContactName:String = null with get,set

        ///<summary>
        ///Emergency contact phone number
        ///</summary>
        [<ApiMember(Description="Emergency contact phone number")>]
        member val EmergencyContactPhone:String = null with get,set

        ///<summary>
        ///Emergency contact relationship
        ///</summary>
        [<ApiMember(Description="Emergency contact relationship")>]
        member val EmergencyContactType:String = null with get,set

        ///<summary>
        ///An array of PaymentMethod objects to be used for this purchase. A null array (or omitted property) will use thePreferred method for the total amount.Each object of the array may contain properties:| Property | Description || --- | --- || PaymentAmount | The maximum amount to be attempted for this PaymentMethod. When null or omitted, the remaining PaymentAmount will be attempted. || **Use only one of the following three** | **UsePreferred** or **AcctToken** or **ProfileToken [DoNotUpdatePaymentTypePreference]** || UsePreferred | Set to `true` to use the Preferred method, otherwise omit the value or set to `null` or `false` || AcctToken | The AcctToken to attempt payment || ProfileToken | When provided, a PaymentMethod will be created (this will prevent the requirement to call `/sales/paymentprofile/import`) || DoNotUpdatePaymentTypePreference | [Optional] When creating a PaymentMethod (ProfileToken), it is set as the preferred method. To not create as preferred, set `DoNotUpdatePaymentTypePreference` to `true`. (for more information, see `/sales/paymentprofile/import`) || | |Only one of `UsePreferred`, `AcctToken`, `ProfileToken` or is needed. `DoNotUpdatePaymentTypePreference` is optionaland only valid with `ProfileToken`.* Scenario #1: Sell $3 contract using an existing PaymentMethod (i.e. AcctToken) for $1 and the Preferred method for $2.JSON:```json{    ...    "PaymentAmount": 3.00,    "PaymentMethods": [        {            "PaymentAmount": "1.00",            "AcctToken": "eyJ..."        },        {            "PaymentAmount": "2.00",            "UsePreferred": true        }    ]}```JSV:```...,PaymentAmount:3.00,PaymentMethods:[{PaymentAmount:1.00,AcctToken:eyJ...NdQ},{PaymentAmount:2.00,UsePreferred:true}]```* Scenario #2: Sell $3 contract using a new PaymentMethod (i.e. ProfileToken) for $1 and the Preferred method for the remaining.Note, the sum of the PaymentMethod's PaymentAmount ($4) is greater than the agreement amount ($3). PaymentAmount is the maximum amount.This allows the first PaymentMethod to decline or partially approve (common with gift cards). Therefore, if the first PaymentMethod approvesfor $0.75, the second will be attempted for $2.25.JSON:```json{     ...    "PaymentAmount": 3.00,    "PaymentMethods": [        {            "PaymentAmount": "1.00",            "ProfileToken": "eyJ..."        },        {            "PaymentAmount": "3.00",            "UsePreferred": true        }    ]}```JSV:```jsv...,PaymentAmount:3.00,PaymentMethods:[{PaymentAmount:1.00,ProfileToken:eyj...NdQ},{PaymentAmount:3.00,UsePreferred:true}]```Notes:  * AcctTokens should not be parsed or persisted in the client application. They are currently jsonbased, but can be updated without notice.* ProfileToken is used to create a PaymentMethod in the ClubReady system. For more information, see `/sales/paymentprofile/import`.* If `PaymentMethods` is missing or `null`, the Preferred method will be used.* If a `PaymentMethods` `PaymentAmount` is not specified, the remaining amount will be attempted.* If a PaymentMethod is partially approved (common for gift cards), the PaymentMethod with anunspecified PaymentAmount will be charged the remaining amount, including the unapproved amount not.* When testing with this website, the PaymentMethods textbox needs JSV and only the square brackets and contents(e.g. `[{PaymentAmount:1.00,UsePreferred:true}]`).
        ///</summary>
        [<ApiMember(Description="An array of PaymentMethod objects to be used for this purchase. A null array (or omitted property) will use the\r\nPreferred method for the total amount.\r\n\r\nEach object of the array may contain properties:\r\n\r\n| Property | Description |\r\n| --- | --- |\r\n| PaymentAmount | The maximum amount to be attempted for this PaymentMethod. When null or omitted, the remaining PaymentAmount will be attempted. |\r\n| **Use only one of the following three** | **UsePreferred** or **AcctToken** or **ProfileToken [DoNotUpdatePaymentTypePreference]** |\r\n| UsePreferred | Set to `true` to use the Preferred method, otherwise omit the value or set to `null` or `false` |\r\n| AcctToken | The AcctToken to attempt payment |\r\n| ProfileToken | When provided, a PaymentMethod will be created (this will prevent the requirement to call `/sales/paymentprofile/import`) |\r\n| DoNotUpdatePaymentTypePreference | [Optional] When creating a PaymentMethod (ProfileToken), it is set as the preferred method. To not create as preferred, set `DoNotUpdatePaymentTypePreference` to `true`. (for more information, see `/sales/paymentprofile/import`) |\r\n| | |\r\n\r\nOnly one of `UsePreferred`, `AcctToken`, `ProfileToken` or is needed. `DoNotUpdatePaymentTypePreference` is optional\r\nand only valid with `ProfileToken`.\r\n\r\n* Scenario #1: Sell $3 contract using an existing PaymentMethod (i.e. AcctToken) for $1 and the Preferred method for $2.\r\n\r\nJSON:\r\n```json\r\n{\r\n    ...\r\n    \"PaymentAmount\": 3.00,\r\n    \"PaymentMethods\": [\r\n        {\r\n            \"PaymentAmount\": \"1.00\",\r\n            \"AcctToken\": \"eyJ...\"\r\n        },\r\n        {\r\n            \"PaymentAmount\": \"2.00\",\r\n            \"UsePreferred\": true\r\n        }\r\n    ]\r\n}\r\n```\r\nJSV:\r\n```\r\n...,PaymentAmount:3.00,PaymentMethods:[{PaymentAmount:1.00,AcctToken:eyJ...NdQ},{PaymentAmount:2.00,UsePreferred:true}]\r\n```\r\n\r\n* Scenario #2: Sell $3 contract using a new PaymentMethod (i.e. ProfileToken) for $1 and the Preferred method for the remaining.\r\nNote, the sum of the PaymentMethod's PaymentAmount ($4) is greater than the agreement amount ($3). PaymentAmount is the maximum amount.\r\nThis allows the first PaymentMethod to decline or partially approve (common with gift cards). Therefore, if the first PaymentMethod approves\r\nfor $0.75, the second will be attempted for $2.25.\r\n\r\nJSON:\r\n```json\r\n{ \r\n    ...\r\n    \"PaymentAmount\": 3.00,\r\n    \"PaymentMethods\": [\r\n        {\r\n            \"PaymentAmount\": \"1.00\",\r\n            \"ProfileToken\": \"eyJ...\"\r\n        },\r\n        {\r\n            \"PaymentAmount\": \"3.00\",\r\n            \"UsePreferred\": true\r\n        }\r\n    ]\r\n}\r\n```\r\nJSV:\r\n```jsv\r\n...,PaymentAmount:3.00,PaymentMethods:[{PaymentAmount:1.00,ProfileToken:eyj...NdQ},{PaymentAmount:3.00,UsePreferred:true}]\r\n```\r\n\r\nNotes:  \r\n\r\n* AcctTokens should not be parsed or persisted in the client application. They are currently json\r\nbased, but can be updated without notice.\r\n\r\n* ProfileToken is used to create a PaymentMethod in the ClubReady system. For more information, \r\nsee `/sales/paymentprofile/import`.\r\n\r\n* If `PaymentMethods` is missing or `null`, the Preferred method will be used.\r\n\r\n* If a `PaymentMethods` `PaymentAmount` is not specified, the remaining amount will be attempted.\r\n\r\n* If a PaymentMethod is partially approved (common for gift cards), the PaymentMethod with an\r\nunspecified PaymentAmount will be charged the remaining amount, including the unapproved amount not.\r\n\r\n* When testing with this website, the PaymentMethods textbox needs JSV and only the square brackets and contents\r\n(e.g. `[{PaymentAmount:1.00,UsePreferred:true}]`).")>]
        member val PaymentMethods:ResizeArray<PaymentMethodDto> = new ResizeArray<PaymentMethodDto>() with get,set

        member val RestrictedId:Nullable<Int32> = new Nullable<Int32>() with get,set
        member val RestrictedResourceType:RestrictedResourceType = new RestrictedResourceType() with get,set

F# ContractSoldNewUserEndpoint DTOs

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

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /sales/contract/sold/new/user HTTP/1.1 
Host: www.clubready.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	XForwardedFor: String,
	ApiKey: String,
	ChainId: 0,
	StoreId: 0,
	PackageId: 0,
	InstallmentPlanId: 0,
	PaymentAmount: 0,
	StartDate: 0001-01-01,
	FirstName: String,
	LastName: String,
	Email: String,
	Gender: String,
	Address: String,
	City: String,
	State: String,
	Zip: String,
	Phone: String,
	WorkPhone: String,
	DateOfBirth: 0001-01-01,
	CellPhone: String,
	Note: String,
	ExternalId: String,
	PromoCode: String,
	Username: String,
	ReferralTypeId: 0,
	EmergencyContactName: String,
	EmergencyContactPhone: String,
	EmergencyContactType: String,
	PaymentMethods: 
	[
		{
			AcctToken: String,
			ProfileToken: String,
			PaymentProfileId: String,
			PaymentAmount: 0,
			UsePreferred: False,
			DoNotUpdatePaymentTypePreference: False
		}
	],
	RestrictedId: 0,
	RestrictedResourceType: Chain,
	AuthToken: String,
	AcctToken: String,
	Last4: String,
	ExpMonth: 0,
	ExpYear: 0,
	AcctType: Uninitialized,
	CardType: 0,
	BnkRoute: 0,
	IsTemp: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	
}