TicketUserServices

<back to all web services

GiftCardLedgerRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdminRequires the permission:ReadData
The following routes are available for this service:
GET/GiftCard/Ledger/{GiftCardId}
import 'package:servicestack/servicestack.dart';

class GiftCardSummary implements IConvertible
{
    int? id;
    int? giftCardTypeId;
    String? codeLast4;
    String? scope;
    int? scopeOwnerId;
    String? currency;
    int? initialValueMinor;
    int? currentBalanceMinor;
    String? status;
    DateTime? activatedAt;
    DateTime? expiresAt;
    DateTime? createdAt;
    String? buyerName;
    String? buyerEmail;
    String? buyerPhone;
    String? paymentId;
    String? paymentMethodId;
    String? purchasePaymentReference;

    GiftCardSummary({this.id,this.giftCardTypeId,this.codeLast4,this.scope,this.scopeOwnerId,this.currency,this.initialValueMinor,this.currentBalanceMinor,this.status,this.activatedAt,this.expiresAt,this.createdAt,this.buyerName,this.buyerEmail,this.buyerPhone,this.paymentId,this.paymentMethodId,this.purchasePaymentReference});
    GiftCardSummary.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        giftCardTypeId = json['giftCardTypeId'];
        codeLast4 = json['codeLast4'];
        scope = json['scope'];
        scopeOwnerId = json['scopeOwnerId'];
        currency = json['currency'];
        initialValueMinor = json['initialValueMinor'];
        currentBalanceMinor = json['currentBalanceMinor'];
        status = json['status'];
        activatedAt = JsonConverters.fromJson(json['activatedAt'],'DateTime',context!);
        expiresAt = JsonConverters.fromJson(json['expiresAt'],'DateTime',context!);
        createdAt = JsonConverters.fromJson(json['createdAt'],'DateTime',context!);
        buyerName = json['buyerName'];
        buyerEmail = json['buyerEmail'];
        buyerPhone = json['buyerPhone'];
        paymentId = json['paymentId'];
        paymentMethodId = json['paymentMethodId'];
        purchasePaymentReference = json['purchasePaymentReference'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'giftCardTypeId': giftCardTypeId,
        'codeLast4': codeLast4,
        'scope': scope,
        'scopeOwnerId': scopeOwnerId,
        'currency': currency,
        'initialValueMinor': initialValueMinor,
        'currentBalanceMinor': currentBalanceMinor,
        'status': status,
        'activatedAt': JsonConverters.toJson(activatedAt,'DateTime',context!),
        'expiresAt': JsonConverters.toJson(expiresAt,'DateTime',context!),
        'createdAt': JsonConverters.toJson(createdAt,'DateTime',context!),
        'buyerName': buyerName,
        'buyerEmail': buyerEmail,
        'buyerPhone': buyerPhone,
        'paymentId': paymentId,
        'paymentMethodId': paymentMethodId,
        'purchasePaymentReference': purchasePaymentReference
    };

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

class GiftCardTransaction implements IConvertible
{
    int? id;
    int? giftCardId;
    String? kind;
    int? amountMinor;
    String? status;
    DateTime? holdExpiresAt;
    int? relatedHoldId;
    String? orderPaymentReference;
    int? eventId;
    int? ownerId;
    String? idempotencyKey;
    DateTime? createdAt;
    String? note;

    GiftCardTransaction({this.id,this.giftCardId,this.kind,this.amountMinor,this.status,this.holdExpiresAt,this.relatedHoldId,this.orderPaymentReference,this.eventId,this.ownerId,this.idempotencyKey,this.createdAt,this.note});
    GiftCardTransaction.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        giftCardId = json['giftCardId'];
        kind = json['kind'];
        amountMinor = json['amountMinor'];
        status = json['status'];
        holdExpiresAt = JsonConverters.fromJson(json['holdExpiresAt'],'DateTime',context!);
        relatedHoldId = json['relatedHoldId'];
        orderPaymentReference = json['orderPaymentReference'];
        eventId = json['eventId'];
        ownerId = json['ownerId'];
        idempotencyKey = json['idempotencyKey'];
        createdAt = JsonConverters.fromJson(json['createdAt'],'DateTime',context!);
        note = json['note'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'giftCardId': giftCardId,
        'kind': kind,
        'amountMinor': amountMinor,
        'status': status,
        'holdExpiresAt': JsonConverters.toJson(holdExpiresAt,'DateTime',context!),
        'relatedHoldId': relatedHoldId,
        'orderPaymentReference': orderPaymentReference,
        'eventId': eventId,
        'ownerId': ownerId,
        'idempotencyKey': idempotencyKey,
        'createdAt': JsonConverters.toJson(createdAt,'DateTime',context!),
        'note': note
    };

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

class GiftCardLedgerResult implements IConvertible
{
    GiftCardSummary? card;
    List<GiftCardTransaction>? transactions;
    int? statusCode;
    String? message;

    GiftCardLedgerResult({this.card,this.transactions,this.statusCode,this.message});
    GiftCardLedgerResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        card = JsonConverters.fromJson(json['card'],'GiftCardSummary',context!);
        transactions = JsonConverters.fromJson(json['transactions'],'List<GiftCardTransaction>',context!);
        statusCode = json['statusCode'];
        message = json['message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'card': JsonConverters.toJson(card,'GiftCardSummary',context!),
        'transactions': JsonConverters.toJson(transactions,'List<GiftCardTransaction>',context!),
        'statusCode': statusCode,
        'message': message
    };

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

class GiftCardLedgerRequest implements IConvertible
{
    int? giftCardId;

    GiftCardLedgerRequest({this.giftCardId});
    GiftCardLedgerRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'giftCardId': giftCardId
    };

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

TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
    'GiftCardSummary': TypeInfo(TypeOf.Class, create:() => GiftCardSummary()),
    'GiftCardTransaction': TypeInfo(TypeOf.Class, create:() => GiftCardTransaction()),
    'GiftCardLedgerResult': TypeInfo(TypeOf.Class, create:() => GiftCardLedgerResult()),
    'List<GiftCardTransaction>': TypeInfo(TypeOf.Class, create:() => <GiftCardTransaction>[]),
    'GiftCardLedgerRequest': TypeInfo(TypeOf.Class, create:() => GiftCardLedgerRequest()),
});

Dart GiftCardLedgerRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

GET /GiftCard/Ledger/{GiftCardId} HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"card":{"id":0,"giftCardTypeId":0,"codeLast4":"String","scope":"String","scopeOwnerId":0,"currency":"String","initialValueMinor":0,"currentBalanceMinor":0,"status":"String","activatedAt":"0001-01-01T00:00:00.0000000","expiresAt":"0001-01-01T00:00:00.0000000","createdAt":"0001-01-01T00:00:00.0000000","buyerName":"String","buyerEmail":"String","buyerPhone":"String","paymentId":"String","paymentMethodId":"String","purchasePaymentReference":"String"},"transactions":[{"id":0,"giftCardId":0,"kind":"String","amountMinor":0,"status":"String","holdExpiresAt":"0001-01-01T00:00:00.0000000","relatedHoldId":0,"orderPaymentReference":"String","eventId":0,"ownerId":0,"idempotencyKey":"String","createdAt":"0001-01-01T00:00:00.0000000","note":"String"}],"statusCode":0,"message":"String"}