POST | /sales/contract/sold/new/user | Create a user and sell them a package | Create a user and sell them a package. **New Operation** The PaymentMethods property is an array of objects describing how you want ClubReady to take payment while selling the PackageId/InstallmentPlanId. The deprecated fields (AcctToken, Last4, ExpMonth, ExpYear, AcctType, BnkRoute, and IsTemp) must be omitted or null. **Deprecated Operation** Provide the AcctToken, Last4, ExpMonth, ExpYear, AcctType, BnkRoute, and IsTemp used in the ClubReadyGateway API in order to create a Payment Profile to the user specified. PaymentMethods must be omitted or null. |
---|
namespace ClubReady.Core.Api.Models
open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
[<AllowNullLiteral>]
type ApiDtoBase() =
member val ApiKey:String = null with get,set
member val StoreId:Nullable<Int32> = new Nullable<Int32>() with get,set
member val ChainId:Nullable<Int32> = new Nullable<Int32>() with get,set
[<DataContract>]
type AcctType =
| Uninitialized = 0
| Visa = 1
| MC = 2
| Disc = 3
| Amex = 4
| Diners = 5
| JCB = 6
| enRoute = 7
| PayPal = 8
| BillMe = 9
| PC = 11
| PS = 12
| BC = 13
| BS = 14
| Becs = 15
| Bacs = 16
| Maestro = 20
| Solo = 21
| VisaElectron = 22
| CIBC = 23
| RoyalBankCa = 24
| TDCaTrust = 25
| Scotia = 26
| BMO = 27
| HSBCCa = 28
| UnionPay = 29
| InterPayment = 30
| Laser = 31
| UnknownCredit = 40
| TransArmor = 41
| Factor4 = 42
| XPass = 43
| ConnectedAccount = 44
| UnknownBank = 45
| Error = -1
type PaymentMethodType =
| Uninitialized = 0
| PaymentProfileId = 1
| PreferredOnFile = 2
| AcctToken = 3
| Error = -1
[<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 PaymentMethodType:Nullable<PaymentMethodType> = new Nullable<PaymentMethodType>() with get,set
[<DataMember>]
member val DoNotUpdatePaymentTypePreference:Nullable<Boolean> = new Nullable<Boolean>() with get,set
[<AllowNullLiteral>]
type SellContractAndSetupClientDto() =
inherit ApiDtoBase()
member val AcctToken:String = null with get,set
member val Last4:String = null with get,set
member val ExpMonth:Nullable<Int32> = new Nullable<Int32>() with get,set
member val ExpYear:Nullable<Int32> = new Nullable<Int32>() with get,set
member val AcctType:Nullable<AcctType> = new Nullable<AcctType>() with get,set
member val BnkRoute:Nullable<Int32> = new Nullable<Int32>() with get,set
member val IsTemp:Boolean = new Boolean() with get,set
member val PackageId:Int32 = new Int32() with get,set
member val InstallmentPlanId:Int32 = new Int32() with get,set
member val PaymentAmount:Decimal = new Decimal() with get,set
member val StartDate:Nullable<DateTime> = new Nullable<DateTime>() with get,set
member val FirstName:String = null with get,set
member val LastName:String = null with get,set
member val Address:String = null with get,set
member val City:String = null with get,set
member val State:String = null with get,set
member val Zip:String = null with get,set
member val Email:String = null with get,set
member val Gender:String = null with get,set
member val Phone:String = null with get,set
member val WorkPhone:String = null with get,set
member val DateOfBirth:Nullable<DateTime> = new Nullable<DateTime>() with get,set
member val CellPhone:String = null with get,set
member val Note:String = null with get,set
member val ExternalId:String = null with get,set
member val PromoCode:String = null with get,set
member val Username:String = null with get,set
member val ReferralTypeId:Nullable<Int32> = new Nullable<Int32>() with get,set
member val EmergencyContactName:String = null with get,set
member val EmergencyContactPhone:String = null with get,set
member val EmergencyContactType:String = null with get,set
member val PaymentMethods:ResizeArray<PaymentMethodDto> = new ResizeArray<PaymentMethodDto>() with get,set
type RestrictedResourceType =
| Store = 0
| Chain = 1
| User = 2
| Undefined = 3
[<ApiResponse(Description="", ResponseType=typeof<SellContractAndSetupClientResponse>, StatusCode=200)>]
[<AllowNullLiteral>]
type SellContractAndSetupClientRequest() =
inherit SellContractAndSetupClientDto()
///<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 Payment Methods to be used for this purchase. Any entry with PreferredOnFile is assumed if omitted or null. Each object of the array may contain properties:| Property | Description || --- | --- || PaymentMethodType | Usually "AcctToken" (Default or omitted/null) or "PreferredOnFile" || PaymentAmount | The amount to be attempted for this Payment Method. When omitted (or null), the Request's PaymentAmount will be attempted || AcctToken | The AcctToken to attempt payment (when using PaymentMethodType:AcctToken) || ProfileToken | When provided (with AcctToken), a Payment Profile will be created (this will prevent the requirement to call `/sales/paymentprofile/import` (when using PaymentMethodType:AcctToken) || DoNotUpdatePaymentTypePreference | When using ProfileToken, do not set the PaymentTypePreference (for more information, see `/sales/paymentprofile/import` (when using PaymentMethodType:AcctToken) || | |* Scenario #1: Use a Gift Card with PreferredOnFile to cover the amount not approved by the Gift Card. JSON:```json{ PaymentMethods: [ { "PaymentMethodType":"AcctToken", "PaymentAmount":"1.00", "AcctToken":"eyJ...GiftCard AcctToken...", "ProfileToken":"eyJ...Gift Card ProfileToken..." }, { "PaymentMethodType":"PreferredOnFile", "PaymentAmount":"1.00" } ]}```JSV:```[{PaymentMethodType:AcctToken,PaymentAmount:1.00,AcctToken:eyj...,ProfileToken:eyJ...},{PaymentMethodType:PreferredOnFile,PaymentAmount:1.00}]```* Scenario #2: Use a Gift Card with PreferredOnFile to cover the amount not approved by the Gift Card. JSON:```json{ PaymentMethods: [ { "PaymentMethodType":"AcctToken", "PaymentAmount":"1.00", "AcctToken":"eyJ...GiftCard AcctToken...", "ProfileToken":"eyJ...Gift Card ProfileToken..." }, { "PaymentMethodType":"PreferredOnFile", "PaymentAmount":"1.00" } ]}```JSV:```jsv[{PaymentMethodType:AcctToken,PaymentAmount:1.00,AcctToken:eyj...,ProfileToken:eyJ...},{PaymentMethodType:PreferredOnFile,PaymentAmount:1.00}]```Notes: * The example shows PaymentAmount of 1.00 for both "AcctToken" and "PreferredOnFile". This is for the examplewith a total of $1.00. The firstPaymentMethod (the Gift Card) will be attempted for $1.00. If it partially approvesfor less than 1.00 (example: $0.80), the second payment method (PreferredOnFile) will be attempted for the lesser ofit's PaymentAmount and the remaining amount (example: $0.20).* Because this endpoint creates a new user, the "PreferredOnFile" option is not applicable. Also, ProfileToken withthe OwnerType "TempstUser" is required because the Payment Profile owner will be converted to the newly created user.* When using Query String (or this web site), this value must be encoded with JSV [(JSON-like Separated Values)](https://docs.servicestack.net/jsv-format).Basic steps to convert JSON to JSV: 1) Remove properties that are null, 2) Remove white space including line feeds, 3) Remove quotes.
///</summary>
[<ApiMember(Description="\r\nAn array of Payment Methods to be used for this purchase. Any entry with PreferredOnFile is assumed if omitted or null. \r\n\r\nEach object of the array may contain properties:\r\n\r\n| Property | Description |\r\n| --- | --- |\r\n| PaymentMethodType | Usually \"AcctToken\" (Default or omitted/null) or \"PreferredOnFile\" |\r\n| PaymentAmount | The amount to be attempted for this Payment Method. When omitted (or null), the Request's PaymentAmount will be attempted |\r\n| AcctToken | The AcctToken to attempt payment (when using PaymentMethodType:AcctToken) |\r\n| ProfileToken | When provided (with AcctToken), a Payment Profile will be created (this will prevent the requirement to call `/sales/paymentprofile/import` (when using PaymentMethodType:AcctToken) |\r\n| DoNotUpdatePaymentTypePreference | When using ProfileToken, do not set the PaymentTypePreference (for more information, see `/sales/paymentprofile/import` (when using PaymentMethodType:AcctToken) |\r\n| | |\r\n\r\n* Scenario #1: Use a Gift Card with PreferredOnFile to cover the amount not approved by the Gift Card. \r\n\r\nJSON:\r\n```json\r\n{\r\n PaymentMethods: [\r\n {\r\n \"PaymentMethodType\":\"AcctToken\",\r\n \"PaymentAmount\":\"1.00\",\r\n \"AcctToken\":\"eyJ...GiftCard AcctToken...\",\r\n \"ProfileToken\":\"eyJ...Gift Card ProfileToken...\"\r\n },\r\n {\r\n \"PaymentMethodType\":\"PreferredOnFile\",\r\n \"PaymentAmount\":\"1.00\"\r\n }\r\n ]\r\n}\r\n```\r\nJSV:\r\n```\r\n[{PaymentMethodType:AcctToken,PaymentAmount:1.00,AcctToken:eyj...,ProfileToken:eyJ...},{PaymentMethodType:PreferredOnFile,PaymentAmount:1.00}]\r\n```\r\n\r\n* Scenario #2: Use a Gift Card with PreferredOnFile to cover the amount not approved by the Gift Card. \r\n\r\nJSON:\r\n```json\r\n{\r\n PaymentMethods: [\r\n {\r\n \"PaymentMethodType\":\"AcctToken\",\r\n \"PaymentAmount\":\"1.00\",\r\n \"AcctToken\":\"eyJ...GiftCard AcctToken...\",\r\n \"ProfileToken\":\"eyJ...Gift Card ProfileToken...\"\r\n },\r\n {\r\n \"PaymentMethodType\":\"PreferredOnFile\",\r\n \"PaymentAmount\":\"1.00\"\r\n }\r\n ]\r\n}\r\n```\r\nJSV:\r\n```jsv\r\n[{PaymentMethodType:AcctToken,PaymentAmount:1.00,AcctToken:eyj...,ProfileToken:eyJ...},{PaymentMethodType:PreferredOnFile,PaymentAmount:1.00}]\r\n```\r\n\r\nNotes: \r\n\r\n* The example shows PaymentAmount of 1.00 for both \"AcctToken\" and \"PreferredOnFile\". This is for the example\r\nwith a total of $1.00. The firstPaymentMethod (the Gift Card) will be attempted for $1.00. If it partially approves\r\nfor less than 1.00 (example: $0.80), the second payment method (PreferredOnFile) will be attempted for the lesser of\r\nit's PaymentAmount and the remaining amount (example: $0.20).\r\n\r\n* Because this endpoint creates a new user, the \"PreferredOnFile\" option is not applicable. Also, ProfileToken with\r\nthe OwnerType \"TempstUser\" is required because the Payment Profile owner will be converted to the newly created user.\r\n\r\n* When using Query String (or this web site), this value must be encoded with JSV [(JSON-like Separated Values)](https://docs.servicestack.net/jsv-format).\r\nBasic steps to convert JSON to JSV: 1) Remove properties that are null, 2) Remove white space including line feeds, 3) Remove quotes.\r\n")>]
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
///<summary>
///**Deprecated** (Use `PaymentMethods` with `ProfileToken`) AcctToken provided by creating a Payment Profile with the Vault Api. Required if Package requires purchase and PaymentMethods is empty.
///</summary>
[<ApiMember(Description="\r\n**Deprecated** (Use `PaymentMethods` with `ProfileToken`) \r\n\r\nAcctToken provided by creating a Payment Profile with the Vault Api. Required if Package requires purchase and PaymentMethods is empty.")>]
member val AcctToken:String = null with get,set
///<summary>
///**Deprecated** (Use `PaymentMethods` with `ProfileToken`) Last 4 digits of the Payment Profile. Required with AcctToken.
///</summary>
[<ApiMember(Description="\r\n**Deprecated** (Use `PaymentMethods` with `ProfileToken`) \r\n\r\nLast 4 digits of the Payment Profile. Required with AcctToken.")>]
member val Last4:String = null with get,set
///<summary>
///**Deprecated** (Use `PaymentMethods` with `ProfileToken`) 2 digit expiration month. **Required with AcctToken for Credit Card.**
///</summary>
[<ApiMember(Description="\r\n**Deprecated** (Use `PaymentMethods` with `ProfileToken`) \r\n\r\n2 digit expiration month. **Required with AcctToken for Credit Card.**")>]
member val ExpMonth:Nullable<Int32> = new Nullable<Int32>() with get,set
///<summary>
///**Deprecated** (Use `PaymentMethods` with `ProfileToken`) 2 digit expiration year. **Required with AcctToken for Credit Card.**
///</summary>
[<ApiMember(Description="\r\n**Deprecated** (Use `PaymentMethods` with `ProfileToken`) \r\n\r\n2 digit expiration year. **Required with AcctToken for Credit Card.**")>]
member val ExpYear:Nullable<Int32> = new Nullable<Int32>() with get,set
///<summary>
///**Deprecated** (Use `PaymentMethods` with `ProfileToken`) The Account Type the Payment Profile<details><summary>Common Values</summary><table> <thead> <tr><th>Text</th><th>Numerical</th><th>Account Type</th></tr> </thead> <tbody> <tr><td>VISA</td><td>1</td><td>Visa</td></tr> <tr><td>MC</td><td>2</td><td>MasterCard</td></tr> <tr><td>Disc</td><td>3</td><td>Discover</td></tr> <tr><td>Amex</td><td>4</td><td>American Express</td></tr> <tr><td>PC</td><td>11</td><td>Personal Checking</td></tr> <tr><td>PS</td><td>12</td><td>Personal Savings</td></tr> <tr><td>BC</td><td>13</td><td>Business Checking</td></tr> </tbody></table><p>You may use the Text or the Numerical value.</p></details>
///</summary>
[<ApiMember(Description="\r\n**Deprecated** (Use `PaymentMethods` with `ProfileToken`) \r\n\r\nThe Account Type the Payment Profile\r\n\r\n<details>\r\n<summary>Common Values</summary>\r\n<table>\r\n <thead>\r\n <tr><th>Text</th><th>Numerical</th><th>Account Type</th></tr>\r\n </thead>\r\n <tbody>\r\n <tr><td>VISA</td><td>1</td><td>Visa</td></tr>\r\n <tr><td>MC</td><td>2</td><td>MasterCard</td></tr>\r\n <tr><td>Disc</td><td>3</td><td>Discover</td></tr>\r\n <tr><td>Amex</td><td>4</td><td>American Express</td></tr>\r\n <tr><td>PC</td><td>11</td><td>Personal Checking</td></tr>\r\n <tr><td>PS</td><td>12</td><td>Personal Savings</td></tr>\r\n <tr><td>BC</td><td>13</td><td>Business Checking</td></tr>\r\n </tbody>\r\n</table>\r\n<p>You may use the Text or the Numerical value.</p>\r\n</details>")>]
member val AcctType:Nullable<AcctType> = new Nullable<AcctType>() with get,set
///<summary>
///**Deprecated** (Use `PaymentMethods` with `ProfileToken`) Bank Routing Number. **Required with AcctToken for Bank Accounts.**
///</summary>
[<ApiMember(Description="\r\n**Deprecated** (Use `PaymentMethods` with `ProfileToken`) \r\n\r\nBank Routing Number. **Required with AcctToken for Bank Accounts.**")>]
member val BnkRoute:Nullable<Int32> = new Nullable<Int32>() with get,set
///<summary>
///**Deprecated** (Use `PaymentMethods` with `ProfileToken`) Whether the Payment Profile is Temporary. (One time transactions and Gift Cards are IsTemp = True).
///</summary>
[<ApiMember(Description="\r\n**Deprecated** (Use `PaymentMethods` with `ProfileToken`) \r\n\r\nWhether the Payment Profile is Temporary. (One time transactions and Gift Cards are IsTemp = True).")>]
member val IsTemp:Boolean = new Boolean() with get,set
F# SellContractAndSetupClientRequest DTOs
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/contract/sold/new/user HTTP/1.1
Host: clubready.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"ApiKey":"String","ChainId":0,"StoreId":0,"PackageId":0,"InstallmentPlanId":0,"PaymentAmount":0,"StartDate":"0001-01-01T00:00:00.0000000","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","PromoCode":"String","Username":"String","ReferralTypeId":0,"EmergencyContactName":"String","EmergencyContactPhone":"String","EmergencyContactType":"String","PaymentMethods":[{"AcctToken":"String","ProfileToken":"String","PaymentProfileId":"String","PaymentAmount":0,"PaymentMethodType":"Uninitialized","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/csv Content-Length: length {}