GET | /sales/packages/{PackageId}/installments/calculate/{InstallmentPlanId} | Get customer's billing status |
---|
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 CalculatePaymentPlanRequestDto extends ApiDtoBase implements IConvertible
{
int? InstallmentPlanId;
int? PackageId;
DateTime? StartDate;
String? PromoCode;
CalculatePaymentPlanRequestDto({this.InstallmentPlanId,this.PackageId,this.StartDate,this.PromoCode});
CalculatePaymentPlanRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
InstallmentPlanId = json['InstallmentPlanId'];
PackageId = json['PackageId'];
StartDate = JsonConverters.fromJson(json['StartDate'],'DateTime',context!);
PromoCode = json['PromoCode'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'InstallmentPlanId': InstallmentPlanId,
'PackageId': PackageId,
'StartDate': JsonConverters.toJson(StartDate,'DateTime',context!),
'PromoCode': PromoCode
});
getTypeName() => "CalculatePaymentPlanRequestDto";
TypeContext? context = _ctx;
}
enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
class CalculatePaymentPlanRequest extends CalculatePaymentPlanRequestDto 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 calculate plan for
*/
// @ApiMember(DataType="integer", Description="ID # of store to calculate plan for", IsRequired=true, Name="StoreId", ParameterType="query")
int? StoreId;
/**
* Installment Plan to calculate a scheduel for
*/
// @ApiMember(DataType="integer", Description="Installment Plan to calculate a scheduel for", IsRequired=true, Name="InstallmentPlanId", ParameterType="path")
int? InstallmentPlanId;
/**
* The package to calculate for
*/
// @ApiMember(DataType="integer", Description="The package to calculate for", IsRequired=true, Name="PackageId", ParameterType="path")
int? PackageId;
/**
* Date to calculate schedule from. If not provided, will use today.
*/
// @ApiMember(DataType="datetime", Description="Date to calculate schedule from. If not provided, will use today.", Name="StartDate", ParameterType="query")
DateTime? StartDate;
/**
* Promo code to apply a discount.
*/
// @ApiMember(DataType="string", Description="Promo code to apply a discount.", Name="PromoCode", ParameterType="query")
String? PromoCode;
int? RestrictedId;
RestrictedResourceType? RestrictedResourceType;
CalculatePaymentPlanRequest({this.ApiKey,this.StoreId,this.InstallmentPlanId,this.PackageId,this.StartDate,this.PromoCode,this.RestrictedId,this.RestrictedResourceType});
CalculatePaymentPlanRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ApiKey = json['ApiKey'];
StoreId = json['StoreId'];
InstallmentPlanId = json['InstallmentPlanId'];
PackageId = json['PackageId'];
StartDate = JsonConverters.fromJson(json['StartDate'],'DateTime',context!);
PromoCode = json['PromoCode'];
RestrictedId = json['RestrictedId'];
RestrictedResourceType = JsonConverters.fromJson(json['RestrictedResourceType'],'RestrictedResourceType',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ApiKey': ApiKey,
'StoreId': StoreId,
'InstallmentPlanId': InstallmentPlanId,
'PackageId': PackageId,
'StartDate': JsonConverters.toJson(StartDate,'DateTime',context!),
'PromoCode': PromoCode,
'RestrictedId': RestrictedId,
'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!)
});
getTypeName() => "CalculatePaymentPlanRequest";
TypeContext? context = _ctx;
}
class PaymentPlanInstallment implements IConvertible
{
bool? PayToday;
double? Amount;
bool? Taxed;
double? TaxRate;
double? TaxAmount;
String? FeeName;
DateTime? DueDate;
String? Total;
int? SetupFeeId;
PaymentPlanInstallment({this.PayToday,this.Amount,this.Taxed,this.TaxRate,this.TaxAmount,this.FeeName,this.DueDate,this.Total,this.SetupFeeId});
PaymentPlanInstallment.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
PayToday = json['PayToday'];
Amount = JsonConverters.toDouble(json['Amount']);
Taxed = json['Taxed'];
TaxRate = JsonConverters.toDouble(json['TaxRate']);
TaxAmount = JsonConverters.toDouble(json['TaxAmount']);
FeeName = json['FeeName'];
DueDate = JsonConverters.fromJson(json['DueDate'],'DateTime',context!);
Total = json['Total'];
SetupFeeId = json['SetupFeeId'];
return this;
}
Map<String, dynamic> toJson() => {
'PayToday': PayToday,
'Amount': Amount,
'Taxed': Taxed,
'TaxRate': TaxRate,
'TaxAmount': TaxAmount,
'FeeName': FeeName,
'DueDate': JsonConverters.toJson(DueDate,'DateTime',context!),
'Total': Total,
'SetupFeeId': SetupFeeId
};
getTypeName() => "PaymentPlanInstallment";
TypeContext? context = _ctx;
}
class CalculatePaymentPlanResultDto implements IConvertible
{
String? PlanTotal;
String? SubTotal;
double? TaxRate;
String? EnhancementFee;
String? EnhancementFeeTaxAmount;
bool? TaxEnhFee;
String? Tax;
String? TotalDueToday;
List<PaymentPlanInstallment>? Payments;
List<PaymentPlanInstallment>? Fees;
bool? IsEvergreen;
bool? RequirePaymentProfile;
CalculatePaymentPlanResultDto({this.PlanTotal,this.SubTotal,this.TaxRate,this.EnhancementFee,this.EnhancementFeeTaxAmount,this.TaxEnhFee,this.Tax,this.TotalDueToday,this.Payments,this.Fees,this.IsEvergreen,this.RequirePaymentProfile});
CalculatePaymentPlanResultDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
PlanTotal = json['PlanTotal'];
SubTotal = json['SubTotal'];
TaxRate = JsonConverters.toDouble(json['TaxRate']);
EnhancementFee = json['EnhancementFee'];
EnhancementFeeTaxAmount = json['EnhancementFeeTaxAmount'];
TaxEnhFee = json['TaxEnhFee'];
Tax = json['Tax'];
TotalDueToday = json['TotalDueToday'];
Payments = JsonConverters.fromJson(json['Payments'],'List<PaymentPlanInstallment>',context!);
Fees = JsonConverters.fromJson(json['Fees'],'List<PaymentPlanInstallment>',context!);
IsEvergreen = json['IsEvergreen'];
RequirePaymentProfile = json['RequirePaymentProfile'];
return this;
}
Map<String, dynamic> toJson() => {
'PlanTotal': PlanTotal,
'SubTotal': SubTotal,
'TaxRate': TaxRate,
'EnhancementFee': EnhancementFee,
'EnhancementFeeTaxAmount': EnhancementFeeTaxAmount,
'TaxEnhFee': TaxEnhFee,
'Tax': Tax,
'TotalDueToday': TotalDueToday,
'Payments': JsonConverters.toJson(Payments,'List<PaymentPlanInstallment>',context!),
'Fees': JsonConverters.toJson(Fees,'List<PaymentPlanInstallment>',context!),
'IsEvergreen': IsEvergreen,
'RequirePaymentProfile': RequirePaymentProfile
};
getTypeName() => "CalculatePaymentPlanResultDto";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'clubready.com', types: <String, TypeInfo> {
'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
'CalculatePaymentPlanRequestDto': TypeInfo(TypeOf.Class, create:() => CalculatePaymentPlanRequestDto()),
'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
'CalculatePaymentPlanRequest': TypeInfo(TypeOf.Class, create:() => CalculatePaymentPlanRequest()),
'PaymentPlanInstallment': TypeInfo(TypeOf.Class, create:() => PaymentPlanInstallment()),
'CalculatePaymentPlanResultDto': TypeInfo(TypeOf.Class, create:() => CalculatePaymentPlanResultDto()),
'List<PaymentPlanInstallment>': TypeInfo(TypeOf.Class, create:() => <PaymentPlanInstallment>[]),
});
Dart CalculatePaymentPlanRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /sales/packages/{PackageId}/installments/calculate/{InstallmentPlanId} HTTP/1.1 Host: clubready.com Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {Unable to show example output for type 'CalculatePaymentPlanResultDto' using the custom 'csv' filter}One or more errors occurred.