ClubReady Api

<back to all web services

ContractTextEndpoint

The following routes are available for this service:
GET/sales/agreement/contractGet a contracts HTML verbiageGet the agreements contract in HTML. Uses the Incomplete Agreements Token to identify the contract verbiage, and converts it into HTML, and returns it to the requestor. The header `X-Forwarded-For` is NOT required. It can be set to the IP address of the end user, or left blank.
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


class RestrictedResourceType(str, Enum):
    STORE = 'Store'
    CHAIN = 'Chain'
    USER = 'User'
    UNDEFINED = 'Undefined'


# @ApiResponse(Description="", ResponseType=typeof(ContractTextResponse), StatusCode=200)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ContractTextEndpoint(IContractTextEndpoint, IRestrictedApiRequest):
    # @ApiMember(Description="IP address of the end user", Name="X-Forwarded-For", ParameterType="header")
    x_forwarded_for: Optional[str] = None
    """
    IP address of the end user
    """


    # @ApiMember(Description="Api Authentication Key", IsRequired=true, ParameterType="query")
    api_key: Optional[str] = None
    """
    Api Authentication Key
    """


    # @ApiMember(DataType="int", Description="ID# of the store to get contract for.", IsRequired=true, Name="StoreId", ParameterType="query")
    store_id: Optional[int] = None
    """
    ID# of the store to get contract for.
    """


    chain_id: Optional[int] = None
    # @ApiMember(DataType="string", Description="Token for Incomplete Agreement to get details for", IsRequired=true, Name="IncompleteAgreementToken", ParameterType="query")
    incomplete_agreement_token: Optional[str] = None
    """
    Token for Incomplete Agreement to get details for
    """


    restricted_id: Optional[int] = None
    restricted_resource_type: Optional[RestrictedResourceType] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApiResponse2Base:
    success: bool = False
    message: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ContractTextResponse(ApiResponse2Base):
    contract_html: Optional[str] = None
    incomplete_agreement_token: Optional[str] = None

Python ContractTextEndpoint 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.

GET /sales/agreement/contract HTTP/1.1 
Host: www.clubready.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	contractHtml: String,
	incompleteAgreementToken: String,
	success: False,
	message: String
}