| 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 .csv suffix or ?format=csv
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: text/csv
Content-Type: text/csv
Content-Length: length
{"code":"String","amountMinor":0,"eventId":0,"targetOwnerId":0,"orderPaymentReference":"String","idempotencyKey":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"ok":false,"reason":"String","message":{"is":"String","en":"String"},"holdId":0,"heldAmountMinor":0,"remainingAvailableMinor":0,"expiresAt":"0001-01-01T00:00:00.0000000","statusCode":0}