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 .xml suffix or ?format=xml

HTTP + XML

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/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GiftCardLedgerResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
  <Card>
    <ActivatedAt>0001-01-01T00:00:00</ActivatedAt>
    <BuyerEmail>String</BuyerEmail>
    <BuyerName>String</BuyerName>
    <BuyerPhone>String</BuyerPhone>
    <CodeLast4>String</CodeLast4>
    <CreatedAt>0001-01-01T00:00:00</CreatedAt>
    <Currency>String</Currency>
    <CurrentBalanceMinor>0</CurrentBalanceMinor>
    <ExpiresAt>0001-01-01T00:00:00</ExpiresAt>
    <GiftCardTypeId>0</GiftCardTypeId>
    <ID>0</ID>
    <InitialValueMinor>0</InitialValueMinor>
    <PaymentId>String</PaymentId>
    <PaymentMethodId>String</PaymentMethodId>
    <PurchasePaymentReference>String</PurchasePaymentReference>
    <Scope>String</Scope>
    <ScopeOwnerId>0</ScopeOwnerId>
    <Status>String</Status>
  </Card>
  <Message>String</Message>
  <StatusCode>0</StatusCode>
  <Transactions xmlns:d2p1="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel.Types">
    <d2p1:GiftCardTransaction>
      <d2p1:AmountMinor>0</d2p1:AmountMinor>
      <d2p1:CreatedAt>0001-01-01T00:00:00</d2p1:CreatedAt>
      <d2p1:EventId>0</d2p1:EventId>
      <d2p1:GiftCardId>0</d2p1:GiftCardId>
      <d2p1:HoldExpiresAt>0001-01-01T00:00:00</d2p1:HoldExpiresAt>
      <d2p1:ID>0</d2p1:ID>
      <d2p1:IdempotencyKey>String</d2p1:IdempotencyKey>
      <d2p1:Kind>String</d2p1:Kind>
      <d2p1:Note>String</d2p1:Note>
      <d2p1:OrderPaymentReference>String</d2p1:OrderPaymentReference>
      <d2p1:OwnerId>0</d2p1:OwnerId>
      <d2p1:RelatedHoldId>0</d2p1:RelatedHoldId>
      <d2p1:Status>String</d2p1:Status>
    </d2p1:GiftCardTransaction>
  </Transactions>
</GiftCardLedgerResult>