POST | /sales/contract/sold/new/user | Create a user and sell them a package | Create 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 |
---|
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
XForwardedFor | header | string | No | IP address of the end user |
ApiKey | query | string | Yes | Api Authentication Key |
ChainId | query | int? | No | Id for the chain of the Api Key |
StoreId | query | int? | Yes | Id of the store for the user |
PackageId | body | int | Yes | Package Id being sold |
InstallmentPlanId | body | int | Yes | Installment Plan Id being sold |
PaymentAmount | body | decimal | Yes | Amount being paid |
StartDate | body | DateTime? | No | Date contract takes affect |
FirstName | body | string | Yes | First Name |
LastName | body | string | Yes | Last Name |
body | string | Yes | Email Address | |
Gender | body | string | No | Gender |
Address | body | string | No | Address |
City | body | string | No | City |
State | body | string | No | State |
Zip | body | string | No | Zip Code |
Phone | body | string | No | Home phone |
WorkPhone | body | string | No | Work phone |
DateOfBirth | body | DateTime? | No | Date of Birth |
CellPhone | body | string | No | Cell phone |
Note | body | string | No | Add an internal note for the new prospect |
ExternalId | body | string | No | Unique Id for the user from your system. We store internally as ExternalUserId |
PromoCode | body | string | No | Promo code to apply a discount. |
Username | body | string | No | Username should be between 4 and 255 characters long |
ReferralTypeId | body | int? | No | ReferralTypeId |
EmergencyContactName | body | string | No | Emergency contact name |
EmergencyContactPhone | body | string | No | Emergency contact phone number |
EmergencyContactType | body | string | No | Emergency contact relationship |
PaymentMethods | body | List<PaymentMethodDto> | No | An array of PaymentMethod objects to be used for this purchase. A null array (or omitted property) will use the Preferred 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 optional and 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 approves for $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 json based, 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 an unspecified 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}]`). |
RestrictedId | body | int? | No | |
RestrictedResourceType | body | RestrictedResourceType | No |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
AcctToken | form | string | No | |
ProfileToken | form | string | No | |
PaymentProfileId | form | string | No | |
PaymentAmount | form | decimal? | No | |
UsePreferred | form | bool? | No | |
DoNotUpdatePaymentTypePreference | form | bool? | No |
Store | |
Chain | |
User | |
Undefined |
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: www.clubready.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"XForwardedFor":"String","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,"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/csv Content-Length: length {}