(* Options: Date: 2025-07-19 19:33:54 Version: 6.50 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://www.clubready.com/api/current //GlobalNamespace: //MakeDataContractsExtensible: False //AddReturnMarker: True //AddDescriptionAsComments: True //AddDataContractAttributes: False //AddIndexesToDataMembers: False //AddGeneratedCodeAttributes: False //AddResponseStatus: False //AddImplicitVersion: //ExportValueTypes: False IncludeTypes: SaleEndpoint.* //ExcludeTypes: //InitializeCollections: True //AddNamespaces: *) namespace ClubReady.Core.Api open System open System.Collections open System.Collections.Generic open System.Runtime.Serialization open ServiceStack open ServiceStack.DataAnnotations type RestrictedResourceType = | Store = 0 | Chain = 1 | User = 2 | Undefined = 3 [] type IApiDtoBase = abstract ApiKey:String with get,set abstract StoreId:Nullable with get,set abstract ChainId:Nullable with get,set [] type IRestrictedApiRequest = abstract RestrictedId:Nullable with get,set abstract RestrictedResourceType:RestrictedResourceType with get,set [] type IApiKeyEndpoint = abstract ApiKey:String with get,set [] [] type PaymentMethodDto() = [] member val AcctToken:String = null with get,set [] member val ProfileToken:String = null with get,set [] member val PaymentProfileId:String = null with get,set [] member val PaymentAmount:Nullable = new Nullable() with get,set [] member val UsePreferred:Nullable = new Nullable() with get,set [] member val DoNotUpdatePaymentTypePreference:Nullable = new Nullable() with get,set [] type IAgreementSaleEndpoint = abstract MemberId:Int32 with get,set abstract PaymentAmount:Nullable with get,set abstract PaymentMethods:ResizeArray with get,set abstract IncompleteAgreementToken:String with get,set [] type ApiResponse2Base() = member val success:Boolean = new Boolean() with get,set member val message:String = null with get,set [] type SaleResponse() = inherit ApiResponse2Base() [] [, StatusCode=200)>] [] type SaleEndpoint() = interface IReturn /// ///IP address of the end user /// [] member val XForwardedFor:String = null with get,set /// ///Api Authentication Key /// [] member val ApiKey:String = null with get,set /// ///Member Id of the user buying the Package /// [] member val MemberId:Int32 = new Int32() with get,set member val ChainId:Nullable = new Nullable() with get,set /// ///Id of the store for the user /// [] member val StoreId:Nullable = new Nullable() with get,set /// ///IncompleteAgreementToken from Agreement/ContractText endpoint. /// [] member val IncompleteAgreementToken:String = null with get,set /// ///Amount being paid down, including tax /// [] member val PaymentAmount:Nullable = new Nullable() with get,set /// ///Promo code to apply a discount. /// [] member val PromoCode:String = null with get,set /// ///Staff Id of salesperson who sold the agreement. /// [] member val StaffId:Nullable = new Nullable() with get,set /// ///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}]`). /// [] member val PaymentMethods:ResizeArray = new ResizeArray() with get,set member val RestrictedId:Nullable = new Nullable() with get,set member val RestrictedResourceType:RestrictedResourceType = new RestrictedResourceType() with get,set