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

[
	{
		Id: 0,
		ForOnlineSale: False,
		PaymentCount: 0,
		DuePerPayment: String,
		Fees: 
		[
			{
				Name: String,
				Amount: String,
				Taxable: False,
				CanBeWaived: False,
				CanDuplicate: False,
				OneTime: False,
				DueUpfront: False,
				PayFrequencyMonths: 0
			}
		]
	}
]