POST | /sales/agreement/add | 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 PaymentMethods property is an array of objects describing how you want ClubReady to take payment while selling the PackageId/InstallmentPlanId. If omitted (or null), the preferred on-file profile will be used. The header `X-Forwarded-For` is required and should be set to the IP address of the end user. |
---|
namespace ClubReady.Web.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
[<ApiResponse(Description="", ResponseType=typeof<AddResponse>, StatusCode=200)>]
[<AllowNullLiteral>]
type AgreementAddEndpoint() =
///<summary>
///IP address of the end user
///</summary>
[<ApiMember(Description="IP address of the end user", IsRequired=true, 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>
///Member Id of the user buying the Package
///</summary>
[<ApiMember(Description="Member Id of the user buying the Package", IsRequired=true, ParameterType="query")>]
member val MemberId:Int32 = new Int32() with get,set
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)>]
member val StoreId:Nullable<Int32> = new Nullable<Int32>() with get,set
///<summary>
///Package Id number of the package being purchased
///</summary>
[<ApiMember(Description="Package Id number of the package being purchased", IsRequired=true)>]
member val PackageId:Int32 = new Int32() with get,set
///<summary>
///Installment Plan Id being purchased. If empty, the default package will be selected.
///</summary>
[<ApiMember(Description="Installment Plan Id being purchased. If empty, the default package will be selected.")>]
member val InstallmentId:Nullable<Int32> = new Nullable<Int32>() 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>
///Promo code to apply a discount.
///</summary>
[<ApiMember(Description="Promo code to apply a discount.")>]
member val PromoCode:String = null with get,set
///<summary>
///Staff Id of salesperson who sold the agreement.
///</summary>
[<ApiMember(Description="Staff Id of salesperson who sold the agreement.")>]
member val StaffId:Nullable<Int32> = new Nullable<Int32>() with get,set
member val RestrictedId:Nullable<Int32> = new Nullable<Int32>() with get,set
member val RestrictedResourceType:RestrictedResourceType = new RestrictedResourceType() with get,set
[<AllowNullLiteral>]
type ApiResponse2Base() =
member val success:Boolean = new Boolean() with get,set
member val message:String = null with get,set
[<AllowNullLiteral>]
type AddResponse() =
inherit ApiResponse2Base()
member val incompleteAgreementToken:String = null with get,set
member val contractId:Nullable<Int32> = new Nullable<Int32>() with get,set
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /sales/agreement/add HTTP/1.1
Host: www.clubready.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
XForwardedFor: String,
ApiKey: String,
MemberId: 0,
ChainId: 0,
StoreId: 0,
PackageId: 0,
InstallmentId: 0,
StartDate: 0001-01-01,
PromoCode: String,
StaffId: 0,
RestrictedId: 0,
RestrictedResourceType: Store
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { incompleteAgreementToken: String, contractId: 0, success: False, message: String }