TicketUserServices

<back to all web services

GiftCardRefundCreditRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdminRequired permission:Tickets.Add
The following routes are available for this service:
POST/GiftCard/RefundCredit
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 GiftCardRefundCreditRequest implements IConvertible
{
    int? giftCardId;
    String? code;
    int? amountMinor;
    String? orderPaymentReference;
    String? idempotencyKey;
    String? note;

    GiftCardRefundCreditRequest({this.giftCardId,this.code,this.amountMinor,this.orderPaymentReference,this.idempotencyKey,this.note});
    GiftCardRefundCreditRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        giftCardId = json['giftCardId'];
        code = json['code'];
        amountMinor = json['amountMinor'];
        orderPaymentReference = json['orderPaymentReference'];
        idempotencyKey = json['idempotencyKey'];
        note = json['note'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'giftCardId': giftCardId,
        'code': code,
        'amountMinor': amountMinor,
        'orderPaymentReference': orderPaymentReference,
        'idempotencyKey': idempotencyKey,
        'note': note
    };

    getTypeName() => "GiftCardRefundCreditRequest";
    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()),
    'GiftCardRefundCreditRequest': TypeInfo(TypeOf.Class, create:() => GiftCardRefundCreditRequest()),
});

Dart GiftCardRefundCreditRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /GiftCard/RefundCredit HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	giftCardId: 0,
	code: String,
	amountMinor: 0,
	orderPaymentReference: String,
	idempotencyKey: String,
	note: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ok: False,
	reason: String,
	message: 
	{
		is: String,
		en: String
	},
	redeemedAmountMinor: 0,
	newBalanceMinor: 0,
	transactionId: 0,
	settlementTag: String,
	statusCode: 0
}