| Requires any of the roles: | Admin, TeamAdmin | Required permission: | Tickets.Add |
| POST | /GiftCard/Redeem |
|---|
import 'package:servicestack/servicestack.dart';
class LocalizedMessage implements IConvertible
{
String? Is;
String? en;
LocalizedMessage({this.Is,this.en});
LocalizedMessage.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Is = json['is'];
en = json['en'];
return this;
}
Map<String, dynamic> toJson() => {
'is': Is,
'en': en
};
getTypeName() => "LocalizedMessage";
TypeContext? context = _ctx;
}
class GiftCardRedeemResult implements IConvertible
{
bool? ok;
String? reason;
LocalizedMessage? message;
int? redeemedAmountMinor;
int? newBalanceMinor;
int? transactionId;
String? settlementTag;
int? statusCode;
GiftCardRedeemResult({this.ok,this.reason,this.message,this.redeemedAmountMinor,this.newBalanceMinor,this.transactionId,this.settlementTag,this.statusCode});
GiftCardRedeemResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ok = json['ok'];
reason = json['reason'];
message = JsonConverters.fromJson(json['message'],'LocalizedMessage',context!);
redeemedAmountMinor = json['redeemedAmountMinor'];
newBalanceMinor = json['newBalanceMinor'];
transactionId = json['transactionId'];
settlementTag = json['settlementTag'];
statusCode = json['statusCode'];
return this;
}
Map<String, dynamic> toJson() => {
'ok': ok,
'reason': reason,
'message': JsonConverters.toJson(message,'LocalizedMessage',context!),
'redeemedAmountMinor': redeemedAmountMinor,
'newBalanceMinor': newBalanceMinor,
'transactionId': transactionId,
'settlementTag': settlementTag,
'statusCode': statusCode
};
getTypeName() => "GiftCardRedeemResult";
TypeContext? context = _ctx;
}
class GiftCardRedeemRequest implements IConvertible
{
int? holdId;
String? code;
int? amountMinor;
int? eventId;
int? targetOwnerId;
String? orderPaymentReference;
String? idempotencyKey;
GiftCardRedeemRequest({this.holdId,this.code,this.amountMinor,this.eventId,this.targetOwnerId,this.orderPaymentReference,this.idempotencyKey});
GiftCardRedeemRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
holdId = json['holdId'];
code = json['code'];
amountMinor = json['amountMinor'];
eventId = json['eventId'];
targetOwnerId = json['targetOwnerId'];
orderPaymentReference = json['orderPaymentReference'];
idempotencyKey = json['idempotencyKey'];
return this;
}
Map<String, dynamic> toJson() => {
'holdId': holdId,
'code': code,
'amountMinor': amountMinor,
'eventId': eventId,
'targetOwnerId': targetOwnerId,
'orderPaymentReference': orderPaymentReference,
'idempotencyKey': idempotencyKey
};
getTypeName() => "GiftCardRedeemRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
'LocalizedMessage': TypeInfo(TypeOf.Class, create:() => LocalizedMessage()),
'GiftCardRedeemResult': TypeInfo(TypeOf.Class, create:() => GiftCardRedeemResult()),
'GiftCardRedeemRequest': TypeInfo(TypeOf.Class, create:() => GiftCardRedeemRequest()),
});
Dart GiftCardRedeemRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /GiftCard/Redeem HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GiftCardRedeemRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<AmountMinor>0</AmountMinor>
<Code>String</Code>
<EventId>0</EventId>
<HoldId>0</HoldId>
<IdempotencyKey>String</IdempotencyKey>
<OrderPaymentReference>String</OrderPaymentReference>
<TargetOwnerId>0</TargetOwnerId>
</GiftCardRedeemRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GiftCardRedeemResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<Message>
<En>String</En>
<Is>String</Is>
</Message>
<NewBalanceMinor>0</NewBalanceMinor>
<Ok>false</Ok>
<Reason>String</Reason>
<RedeemedAmountMinor>0</RedeemedAmountMinor>
<SettlementTag>String</SettlementTag>
<StatusCode>0</StatusCode>
<TransactionId>0</TransactionId>
</GiftCardRedeemResult>