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.

export enum RestrictedResourceType
{
    Store = 'Store',
    Chain = 'Chain',
    User = 'User',
    Undefined = 'Undefined',
}

// @ApiResponse(Description="", ResponseType="typeof(ClubReady.Web.Api.Sales.Agreement.ContractTextResponse)", StatusCode=200)
export class ContractTextEndpoint implements IContractTextEndpoint, IRestrictedApiRequest
{
    /**
    * IP address of the end user
    */
    // @ApiMember(Description="IP address of the end user", Name="X-Forwarded-For", ParameterType="header")
    public XForwardedFor?: string;

    /**
    * Api Authentication Key
    */
    // @ApiMember(Description="Api Authentication Key", IsRequired=true, ParameterType="query")
    public ApiKey: string;

    /**
    * ID# of the store to get contract for.
    */
    // @ApiMember(DataType="int", Description="ID# of the store to get contract for.", IsRequired=true, Name="StoreId", ParameterType="query")
    public StoreId: number;

    public ChainId?: number;
    /**
    * Token for Incomplete Agreement to get details for
    */
    // @ApiMember(DataType="string", Description="Token for Incomplete Agreement to get details for", IsRequired=true, Name="IncompleteAgreementToken", ParameterType="query")
    public IncompleteAgreementToken: string;

    public RestrictedId?: number;
    public RestrictedResourceType: RestrictedResourceType;

    public constructor(init?: Partial<ContractTextEndpoint>) { (Object as any).assign(this, init); }
}

export class ApiResponse2Base
{
    public success: boolean;
    public message?: string;

    public constructor(init?: Partial<ApiResponse2Base>) { (Object as any).assign(this, init); }
}

export class ContractTextResponse extends ApiResponse2Base
{
    public contractHtml?: string;
    public incompleteAgreementToken?: string;

    public constructor(init?: Partial<ContractTextResponse>) { super(init); (Object as any).assign(this, init); }
}

TypeScript ContractTextEndpoint DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

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: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ContractTextResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Sales.Agreement">
  <message xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api">String</message>
  <success xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api">false</success>
  <contractHtml>String</contractHtml>
  <incompleteAgreementToken>String</incompleteAgreementToken>
</ContractTextResponse>