| Requires any of the roles: | Admin, TeamAdmin | Requires the permission: | ReadData |
| POST | /OrderOwnerCards/upgrade/quote | Side-effect-free price of an owner-card upgrade: the exact delta POST /OrderOwnerCards/upgrade will charge |
|---|
import 'package:servicestack/servicestack.dart';
class OwnerCardUpgradeResultBase implements IConvertible
{
int? statusCode;
String? message;
String? reason;
OwnerCardUpgradeResultBase({this.statusCode,this.message,this.reason});
OwnerCardUpgradeResultBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
statusCode = json['statusCode'];
message = json['message'];
reason = json['reason'];
return this;
}
Map<String, dynamic> toJson() => {
'statusCode': statusCode,
'message': message,
'reason': reason
};
getTypeName() => "OwnerCardUpgradeResultBase";
TypeContext? context = _ctx;
}
class OwnerCardsUpgradeQuoteResult extends OwnerCardUpgradeResultBase implements IConvertible
{
int? sourceOwnerCardId;
int? sourceOwnerCardTypeId;
String? sourceTypeName;
int? targetOwnerCardTypeId;
String? targetTypeName;
int? pricePaidOriginal;
int? targetPrice;
int? priceTotal;
int? discountAmount;
int? giftCardAmount;
int? donationAmount;
int? transactionFee;
int? chargedAmount;
int? chargedAmountMinor;
bool? fullyCovered;
DateTime? validFromUTC;
DateTime? validToUTC;
OwnerCardsUpgradeQuoteResult({this.sourceOwnerCardId,this.sourceOwnerCardTypeId,this.sourceTypeName,this.targetOwnerCardTypeId,this.targetTypeName,this.pricePaidOriginal,this.targetPrice,this.priceTotal,this.discountAmount,this.giftCardAmount,this.donationAmount,this.transactionFee,this.chargedAmount,this.chargedAmountMinor,this.fullyCovered,this.validFromUTC,this.validToUTC});
OwnerCardsUpgradeQuoteResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
sourceOwnerCardId = json['sourceOwnerCardId'];
sourceOwnerCardTypeId = json['sourceOwnerCardTypeId'];
sourceTypeName = json['sourceTypeName'];
targetOwnerCardTypeId = json['targetOwnerCardTypeId'];
targetTypeName = json['targetTypeName'];
pricePaidOriginal = json['pricePaidOriginal'];
targetPrice = json['targetPrice'];
priceTotal = json['priceTotal'];
discountAmount = json['discountAmount'];
giftCardAmount = json['giftCardAmount'];
donationAmount = json['donationAmount'];
transactionFee = json['transactionFee'];
chargedAmount = json['chargedAmount'];
chargedAmountMinor = json['chargedAmountMinor'];
fullyCovered = json['fullyCovered'];
validFromUTC = JsonConverters.fromJson(json['validFromUTC'],'DateTime',context!);
validToUTC = JsonConverters.fromJson(json['validToUTC'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'sourceOwnerCardId': sourceOwnerCardId,
'sourceOwnerCardTypeId': sourceOwnerCardTypeId,
'sourceTypeName': sourceTypeName,
'targetOwnerCardTypeId': targetOwnerCardTypeId,
'targetTypeName': targetTypeName,
'pricePaidOriginal': pricePaidOriginal,
'targetPrice': targetPrice,
'priceTotal': priceTotal,
'discountAmount': discountAmount,
'giftCardAmount': giftCardAmount,
'donationAmount': donationAmount,
'transactionFee': transactionFee,
'chargedAmount': chargedAmount,
'chargedAmountMinor': chargedAmountMinor,
'fullyCovered': fullyCovered,
'validFromUTC': JsonConverters.toJson(validFromUTC,'DateTime',context!),
'validToUTC': JsonConverters.toJson(validToUTC,'DateTime',context!)
});
getTypeName() => "OwnerCardsUpgradeQuoteResult";
TypeContext? context = _ctx;
}
class OrderTender implements IConvertible
{
String? kind;
String? code;
int? amountMinor;
String? idempotencyKey;
int? holdId;
int? appliedMinor;
OrderTender({this.kind,this.code,this.amountMinor,this.idempotencyKey,this.holdId,this.appliedMinor});
OrderTender.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
kind = json['kind'];
code = json['code'];
amountMinor = json['amountMinor'];
idempotencyKey = json['idempotencyKey'];
holdId = json['holdId'];
appliedMinor = json['appliedMinor'];
return this;
}
Map<String, dynamic> toJson() => {
'kind': kind,
'code': code,
'amountMinor': amountMinor,
'idempotencyKey': idempotencyKey,
'holdId': holdId,
'appliedMinor': appliedMinor
};
getTypeName() => "OrderTender";
TypeContext? context = _ctx;
}
class OwnerCardsUpgradeQuoteRequest implements IConvertible
{
String? buyerPhone;
int? sourceOwnerCardId;
int? targetOwnerCardTypeId;
List<OrderTender>? tenders;
OwnerCardsUpgradeQuoteRequest({this.buyerPhone,this.sourceOwnerCardId,this.targetOwnerCardTypeId,this.tenders});
OwnerCardsUpgradeQuoteRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
buyerPhone = json['buyerPhone'];
sourceOwnerCardId = json['sourceOwnerCardId'];
targetOwnerCardTypeId = json['targetOwnerCardTypeId'];
tenders = JsonConverters.fromJson(json['tenders'],'List<OrderTender>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'buyerPhone': buyerPhone,
'sourceOwnerCardId': sourceOwnerCardId,
'targetOwnerCardTypeId': targetOwnerCardTypeId,
'tenders': JsonConverters.toJson(tenders,'List<OrderTender>',context!)
};
getTypeName() => "OwnerCardsUpgradeQuoteRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
'OwnerCardUpgradeResultBase': TypeInfo(TypeOf.Class, create:() => OwnerCardUpgradeResultBase()),
'OwnerCardsUpgradeQuoteResult': TypeInfo(TypeOf.Class, create:() => OwnerCardsUpgradeQuoteResult()),
'OrderTender': TypeInfo(TypeOf.Class, create:() => OrderTender()),
'OwnerCardsUpgradeQuoteRequest': TypeInfo(TypeOf.Class, create:() => OwnerCardsUpgradeQuoteRequest()),
'List<OrderTender>': TypeInfo(TypeOf.Class, create:() => <OrderTender>[]),
});
Dart OwnerCardsUpgradeQuoteRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /OrderOwnerCards/upgrade/quote HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: application/json
Content-Type: application/json
Content-Length: length
{"buyerPhone":"String","sourceOwnerCardId":0,"targetOwnerCardTypeId":0,"tenders":[{"kind":"String","code":"String","amountMinor":0,"idempotencyKey":"String","holdId":0,"appliedMinor":0}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"sourceOwnerCardId":0,"sourceOwnerCardTypeId":0,"sourceTypeName":"String","targetOwnerCardTypeId":0,"targetTypeName":"String","pricePaidOriginal":0,"targetPrice":0,"priceTotal":0,"discountAmount":0,"giftCardAmount":0,"donationAmount":0,"transactionFee":0,"chargedAmount":0,"chargedAmountMinor":0,"fullyCovered":false,"validFromUTC":"0001-01-01T00:00:00.0000000","validToUTC":"0001-01-01T00:00:00.0000000","statusCode":0,"message":"String","reason":"String"}