TicketUserServices

<back to all web services

RefundRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdminRequires the permission:Tickets.Add
The following routes are available for this service:
POST/refund/process
import 'package:servicestack/servicestack.dart';

class RefundOrderOutcome implements IConvertible
{
    String? status;
    String? paymentReference;
    String? paymentId;
    int? eventId;
    String? eventName;
    String? holderName;
    String? holderEmail;
    double? amountRefunded;
    bool? partial;
    List<String>? ticketTokenIds;
    List<int>? freedSeatIds;
    String? borgunRefundTransactionId;
    String? message;

    RefundOrderOutcome({this.status,this.paymentReference,this.paymentId,this.eventId,this.eventName,this.holderName,this.holderEmail,this.amountRefunded,this.partial,this.ticketTokenIds,this.freedSeatIds,this.borgunRefundTransactionId,this.message});
    RefundOrderOutcome.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        status = json['status'];
        paymentReference = json['paymentReference'];
        paymentId = json['paymentId'];
        eventId = json['eventId'];
        eventName = json['eventName'];
        holderName = json['holderName'];
        holderEmail = json['holderEmail'];
        amountRefunded = JsonConverters.toDouble(json['amountRefunded']);
        partial = json['partial'];
        ticketTokenIds = JsonConverters.fromJson(json['ticketTokenIds'],'List<String>',context!);
        freedSeatIds = JsonConverters.fromJson(json['freedSeatIds'],'List<int>',context!);
        borgunRefundTransactionId = json['borgunRefundTransactionId'];
        message = json['message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'status': status,
        'paymentReference': paymentReference,
        'paymentId': paymentId,
        'eventId': eventId,
        'eventName': eventName,
        'holderName': holderName,
        'holderEmail': holderEmail,
        'amountRefunded': amountRefunded,
        'partial': partial,
        'ticketTokenIds': JsonConverters.toJson(ticketTokenIds,'List<String>',context!),
        'freedSeatIds': JsonConverters.toJson(freedSeatIds,'List<int>',context!),
        'borgunRefundTransactionId': borgunRefundTransactionId,
        'message': message
    };

    getTypeName() => "RefundOrderOutcome";
    TypeContext? context = _ctx;
}

class RefundResult implements IConvertible
{
    bool? success;
    int? statusCode;
    String? message;
    int? refundedCount;
    int? skippedCount;
    int? failedCount;
    double? totalRefunded;
    List<RefundOrderOutcome>? outcomes;

    RefundResult({this.success,this.statusCode,this.message,this.refundedCount,this.skippedCount,this.failedCount,this.totalRefunded,this.outcomes});
    RefundResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        success = json['success'];
        statusCode = json['statusCode'];
        message = json['message'];
        refundedCount = json['refundedCount'];
        skippedCount = json['skippedCount'];
        failedCount = json['failedCount'];
        totalRefunded = JsonConverters.toDouble(json['totalRefunded']);
        outcomes = JsonConverters.fromJson(json['outcomes'],'List<RefundOrderOutcome>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'success': success,
        'statusCode': statusCode,
        'message': message,
        'refundedCount': refundedCount,
        'skippedCount': skippedCount,
        'failedCount': failedCount,
        'totalRefunded': totalRefunded,
        'outcomes': JsonConverters.toJson(outcomes,'List<RefundOrderOutcome>',context!)
    };

    getTypeName() => "RefundResult";
    TypeContext? context = _ctx;
}

class RefundRequest implements IConvertible
{
    int? eventId;
    bool? refundAllForEvent;
    List<String>? ticketTokenIds;
    List<String>? paymentReferences;
    String? reason;
    int? userId;

    RefundRequest({this.eventId,this.refundAllForEvent,this.ticketTokenIds,this.paymentReferences,this.reason,this.userId});
    RefundRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        eventId = json['eventId'];
        refundAllForEvent = json['refundAllForEvent'];
        ticketTokenIds = JsonConverters.fromJson(json['ticketTokenIds'],'List<String>',context!);
        paymentReferences = JsonConverters.fromJson(json['paymentReferences'],'List<String>',context!);
        reason = json['reason'];
        userId = json['userId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'eventId': eventId,
        'refundAllForEvent': refundAllForEvent,
        'ticketTokenIds': JsonConverters.toJson(ticketTokenIds,'List<String>',context!),
        'paymentReferences': JsonConverters.toJson(paymentReferences,'List<String>',context!),
        'reason': reason,
        'userId': userId
    };

    getTypeName() => "RefundRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
    'RefundOrderOutcome': TypeInfo(TypeOf.Class, create:() => RefundOrderOutcome()),
    'RefundResult': TypeInfo(TypeOf.Class, create:() => RefundResult()),
    'List<RefundOrderOutcome>': TypeInfo(TypeOf.Class, create:() => <RefundOrderOutcome>[]),
    'RefundRequest': TypeInfo(TypeOf.Class, create:() => RefundRequest()),
});

Dart RefundRequest 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 /refund/process HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	eventId: 0,
	refundAllForEvent: False,
	ticketTokenIds: 
	[
		String
	],
	paymentReferences: 
	[
		String
	],
	reason: String,
	userId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	success: False,
	statusCode: 0,
	message: String,
	refundedCount: 0,
	skippedCount: 0,
	failedCount: 0,
	totalRefunded: 0,
	outcomes: 
	[
		{
			status: String,
			paymentReference: String,
			paymentId: String,
			eventId: 0,
			eventName: String,
			holderName: String,
			holderEmail: String,
			amountRefunded: 0,
			partial: False,
			ticketTokenIds: 
			[
				String
			],
			freedSeatIds: 
			[
				0
			],
			borgunRefundTransactionId: String,
			message: String
		}
	]
}