| Requires any of the roles: | Admin, TeamAdmin, MobileApp | Required permission: | Tickets.Add |
| POST | /GiftCard/Hold |
|---|
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 GiftCardHoldResult implements IConvertible
{
bool? ok;
String? reason;
LocalizedMessage? message;
int? holdId;
int? heldAmountMinor;
int? remainingAvailableMinor;
DateTime? expiresAt;
int? statusCode;
GiftCardHoldResult({this.ok,this.reason,this.message,this.holdId,this.heldAmountMinor,this.remainingAvailableMinor,this.expiresAt,this.statusCode});
GiftCardHoldResult.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!);
holdId = json['holdId'];
heldAmountMinor = json['heldAmountMinor'];
remainingAvailableMinor = json['remainingAvailableMinor'];
expiresAt = JsonConverters.fromJson(json['expiresAt'],'DateTime',context!);
statusCode = json['statusCode'];
return this;
}
Map<String, dynamic> toJson() => {
'ok': ok,
'reason': reason,
'message': JsonConverters.toJson(message,'LocalizedMessage',context!),
'holdId': holdId,
'heldAmountMinor': heldAmountMinor,
'remainingAvailableMinor': remainingAvailableMinor,
'expiresAt': JsonConverters.toJson(expiresAt,'DateTime',context!),
'statusCode': statusCode
};
getTypeName() => "GiftCardHoldResult";
TypeContext? context = _ctx;
}
class GiftCardHoldRequest implements IConvertible
{
String? code;
int? amountMinor;
int? eventId;
int? targetOwnerId;
String? orderPaymentReference;
String? idempotencyKey;
GiftCardHoldRequest({this.code,this.amountMinor,this.eventId,this.targetOwnerId,this.orderPaymentReference,this.idempotencyKey});
GiftCardHoldRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
code = json['code'];
amountMinor = json['amountMinor'];
eventId = json['eventId'];
targetOwnerId = json['targetOwnerId'];
orderPaymentReference = json['orderPaymentReference'];
idempotencyKey = json['idempotencyKey'];
return this;
}
Map<String, dynamic> toJson() => {
'code': code,
'amountMinor': amountMinor,
'eventId': eventId,
'targetOwnerId': targetOwnerId,
'orderPaymentReference': orderPaymentReference,
'idempotencyKey': idempotencyKey
};
getTypeName() => "GiftCardHoldRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
'LocalizedMessage': TypeInfo(TypeOf.Class, create:() => LocalizedMessage()),
'GiftCardHoldResult': TypeInfo(TypeOf.Class, create:() => GiftCardHoldResult()),
'GiftCardHoldRequest': TypeInfo(TypeOf.Class, create:() => GiftCardHoldRequest()),
});
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/Hold HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GiftCardHoldRequest 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>
<IdempotencyKey>String</IdempotencyKey>
<OrderPaymentReference>String</OrderPaymentReference>
<TargetOwnerId>0</TargetOwnerId>
</GiftCardHoldRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GiftCardHoldResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<ExpiresAt>0001-01-01T00:00:00</ExpiresAt>
<HeldAmountMinor>0</HeldAmountMinor>
<HoldId>0</HoldId>
<Message>
<En>String</En>
<Is>String</Is>
</Message>
<Ok>false</Ok>
<Reason>String</Reason>
<RemainingAvailableMinor>0</RemainingAvailableMinor>
<StatusCode>0</StatusCode>
</GiftCardHoldResult>