ClubReady Api

<back to all web services

AgreementAddEndpoint

The following routes are available for this service:
POST/sales/agreement/addSet up a package that will be sold to an existing userSet 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.
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports ClubReady.Web.Api.Sales.Agreement
Imports ClubReady.Web.Api

Namespace Global

    Namespace ClubReady.Web.Api

        Public Partial Class ApiResponse2Base
            Public Overridable Property success As Boolean
            Public Overridable Property message As String
        End Class

        Public Enum RestrictedResourceType
            Store
            Chain
            User
            Undefined
        End Enum
    End Namespace

    Namespace ClubReady.Web.Api.Sales.Agreement

        Public Partial Class AddResponse
            Inherits ApiResponse2Base
            Public Overridable Property incompleteAgreementToken As String
            Public Overridable Property contractId As Nullable(Of Integer)
        End Class

        <ApiResponse(Description:="", ResponseType:=GetType(AddResponse), StatusCode:=200)>
        Public Partial Class AgreementAddEndpoint
            Implements IAddEndpoint
            Implements IRestrictedApiRequest
            '''<Summary>
            '''IP address of the end user
            '''</Summary>
            <ApiMember(Description:="IP address of the end user", IsRequired:=true, Name:="X-Forwarded-For", ParameterType:="header")>
            Public Overridable Property XForwardedFor As String

            '''<Summary>
            '''Api Authentication Key
            '''</Summary>
            <ApiMember(Description:="Api Authentication Key", IsRequired:=true, ParameterType:="query")>
            Public Overridable Property ApiKey As String

            '''<Summary>
            '''Member Id of the user buying the Package
            '''</Summary>
            <ApiMember(Description:="Member Id of the user buying the Package", IsRequired:=true, ParameterType:="query")>
            Public Overridable Property MemberId As Integer

            Public Overridable Property ChainId As Nullable(Of Integer)
            '''<Summary>
            '''Id of the store for the user
            '''</Summary>
            <ApiMember(Description:="Id of the store for the user", IsRequired:=true)>
            Public Overridable Property StoreId As Nullable(Of Integer)

            '''<Summary>
            '''Package Id number of the package being purchased
            '''</Summary>
            <ApiMember(Description:="Package Id number of the package being purchased", IsRequired:=true)>
            Public Overridable Property PackageId As Integer

            '''<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.")>
            Public Overridable Property InstallmentId As Nullable(Of Integer)

            '''<Summary>
            '''Date contract takes affect
            '''</Summary>
            <ApiMember(Description:="Date contract takes affect")>
            Public Overridable Property StartDate As Nullable(Of Date)

            '''<Summary>
            '''Promo code to apply a discount.
            '''</Summary>
            <ApiMember(Description:="Promo code to apply a discount.")>
            Public Overridable Property PromoCode As String

            '''<Summary>
            '''Staff Id of salesperson who sold the agreement.
            '''</Summary>
            <ApiMember(Description:="Staff Id of salesperson who sold the agreement.")>
            Public Overridable Property StaffId As Nullable(Of Integer)

            Public Overridable Property RestrictedId As Nullable(Of Integer)
            Public Overridable Property RestrictedResourceType As RestrictedResourceType
        End Class
    End Namespace
End Namespace

VB.NET AgreementAddEndpoint 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/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
}