ClubReady Api

<back to all web services

GetSalesPackageDiscountsRequest

The following routes are available for this service:
GET/sales/packages/{PackageId}/installmentsGet sales package installments
import 'package:servicestack/servicestack.dart';

class ApiDtoBase implements IConvertible
{
    String? ApiKey;
    int? StoreId;
    int? ChainId;

    ApiDtoBase({this.ApiKey,this.StoreId,this.ChainId});
    ApiDtoBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ApiKey = json['ApiKey'];
        StoreId = json['StoreId'];
        ChainId = json['ChainId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ApiKey': ApiKey,
        'StoreId': StoreId,
        'ChainId': ChainId
    };

    getTypeName() => "ApiDtoBase";
    TypeContext? context = _ctx;
}

class GetSalesPackageInstallmentsDto extends ApiDtoBase implements IConvertible
{
    int? PackageId;

    GetSalesPackageInstallmentsDto({this.PackageId});
    GetSalesPackageInstallmentsDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        PackageId = json['PackageId'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'PackageId': PackageId
    });

    getTypeName() => "GetSalesPackageInstallmentsDto";
    TypeContext? context = _ctx;
}

enum RestrictedResourceType
{
    Store,
    Chain,
    User,
    Undefined,
}

class GetSalesPackageDiscountsRequest extends GetSalesPackageInstallmentsDto implements IRestrictedApiRequest, IConvertible
{
    /**
    * Api Key - grants access to resources
    */
    // @ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query")
    String? ApiKey;

    /**
    * ID # of store to get package plans for
    */
    // @ApiMember(DataType="string", Description="ID # of store to get package plans for", IsRequired=true, Name="StoreId", ParameterType="query")
    int? StoreId;

    /**
    * ID # of package to get installment plans for
    */
    // @ApiMember(DataType="string", Description="ID # of package to get installment plans for", IsRequired=true, Name="PackageId", ParameterType="path")
    int? PackageId;

    int? RestrictedId;
    RestrictedResourceType? RestrictedResourceType;

    GetSalesPackageDiscountsRequest({this.ApiKey,this.StoreId,this.PackageId,this.RestrictedId,this.RestrictedResourceType});
    GetSalesPackageDiscountsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        ApiKey = json['ApiKey'];
        StoreId = json['StoreId'];
        PackageId = json['PackageId'];
        RestrictedId = json['RestrictedId'];
        RestrictedResourceType = JsonConverters.fromJson(json['RestrictedResourceType'],'RestrictedResourceType',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'ApiKey': ApiKey,
        'StoreId': StoreId,
        'PackageId': PackageId,
        'RestrictedId': RestrictedId,
        'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!)
    });

    getTypeName() => "GetSalesPackageDiscountsRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'clubready.com', types: <String, TypeInfo> {
    'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
    'GetSalesPackageInstallmentsDto': TypeInfo(TypeOf.Class, create:() => GetSalesPackageInstallmentsDto()),
    'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
    'GetSalesPackageDiscountsRequest': TypeInfo(TypeOf.Class, create:() => GetSalesPackageDiscountsRequest()),
});

Dart GetSalesPackageDiscountsRequest 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/packages/{PackageId}/installments HTTP/1.1 
Host: clubready.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ArrayOfSalesPackageInstallmentPlanResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">
  <SalesPackageInstallmentPlanResponse>
    <DuePerPayment>String</DuePerPayment>
    <Fees>
      <PackageFee>
        <Amount>String</Amount>
        <CanBeWaived>false</CanBeWaived>
        <CanDuplicate>false</CanDuplicate>
        <DueUpfront>false</DueUpfront>
        <Name>String</Name>
        <OneTime>false</OneTime>
        <PayFrequencyMonths>0</PayFrequencyMonths>
        <Taxable>false</Taxable>
      </PackageFee>
    </Fees>
    <ForOnlineSale>false</ForOnlineSale>
    <Id>0</Id>
    <PaymentCount>0</PaymentCount>
  </SalesPackageInstallmentPlanResponse>
</ArrayOfSalesPackageInstallmentPlanResponse>