CenResService

<back to all web services

TransactionPost

The following routes are available for this service:
POST/transaction/{SubscriptionId}/{CendynPropertyId}
import 'package:servicestack/servicestack.dart';

class Response implements IConvertible
{
    String? statusCode;
    int? recordCount;
    int? errorCount;

    Response({this.statusCode,this.recordCount,this.errorCount});
    Response.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'statusCode': statusCode,
        'recordCount': recordCount,
        'errorCount': errorCount
    };

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

class TransactionHeader implements IConvertible
{
    String? cendynPropertyID;
    String? sourcePropertyID;
    String? externalResID1;
    String? externalProfileID;
    String? externalRefType;
    String? externalRefID;
    String? transactionHeaderSource;
    String? externalID1;
    String? externalID2;
    DateTime? openedDate;
    DateTime? closedDate;
    DateTime? postedDate;
    String? userID;
    String? userName;
    String? salesRep;
    String? shippingCode;
    String? referenceNum;
    String? customCode1;
    String? customCode2;
    int? customCode3;
    String? taxCode;
    bool? isTaxExempt;
    double? taxAmount;
    double? feeAmount;
    double? discountAmount;
    double? netAmount;
    double? totalAmount;
    String? currencyCode;
    String? importSource;
    String? importSourceID;

    TransactionHeader({this.cendynPropertyID,this.sourcePropertyID,this.externalResID1,this.externalProfileID,this.externalRefType,this.externalRefID,this.transactionHeaderSource,this.externalID1,this.externalID2,this.openedDate,this.closedDate,this.postedDate,this.userID,this.userName,this.salesRep,this.shippingCode,this.referenceNum,this.customCode1,this.customCode2,this.customCode3,this.taxCode,this.isTaxExempt,this.taxAmount,this.feeAmount,this.discountAmount,this.netAmount,this.totalAmount,this.currencyCode,this.importSource,this.importSourceID});
    TransactionHeader.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        cendynPropertyID = json['cendynPropertyID'];
        sourcePropertyID = json['sourcePropertyID'];
        externalResID1 = json['externalResID1'];
        externalProfileID = json['externalProfileID'];
        externalRefType = json['externalRefType'];
        externalRefID = json['externalRefID'];
        transactionHeaderSource = json['transactionHeaderSource'];
        externalID1 = json['externalID1'];
        externalID2 = json['externalID2'];
        openedDate = JsonConverters.fromJson(json['openedDate'],'DateTime',context!);
        closedDate = JsonConverters.fromJson(json['closedDate'],'DateTime',context!);
        postedDate = JsonConverters.fromJson(json['postedDate'],'DateTime',context!);
        userID = json['userID'];
        userName = json['userName'];
        salesRep = json['salesRep'];
        shippingCode = json['shippingCode'];
        referenceNum = json['referenceNum'];
        customCode1 = json['customCode1'];
        customCode2 = json['customCode2'];
        customCode3 = json['customCode3'];
        taxCode = json['taxCode'];
        isTaxExempt = json['isTaxExempt'];
        taxAmount = JsonConverters.toDouble(json['taxAmount']);
        feeAmount = JsonConverters.toDouble(json['feeAmount']);
        discountAmount = JsonConverters.toDouble(json['discountAmount']);
        netAmount = JsonConverters.toDouble(json['netAmount']);
        totalAmount = JsonConverters.toDouble(json['totalAmount']);
        currencyCode = json['currencyCode'];
        importSource = json['importSource'];
        importSourceID = json['importSourceID'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'cendynPropertyID': cendynPropertyID,
        'sourcePropertyID': sourcePropertyID,
        'externalResID1': externalResID1,
        'externalProfileID': externalProfileID,
        'externalRefType': externalRefType,
        'externalRefID': externalRefID,
        'transactionHeaderSource': transactionHeaderSource,
        'externalID1': externalID1,
        'externalID2': externalID2,
        'openedDate': JsonConverters.toJson(openedDate,'DateTime',context!),
        'closedDate': JsonConverters.toJson(closedDate,'DateTime',context!),
        'postedDate': JsonConverters.toJson(postedDate,'DateTime',context!),
        'userID': userID,
        'userName': userName,
        'salesRep': salesRep,
        'shippingCode': shippingCode,
        'referenceNum': referenceNum,
        'customCode1': customCode1,
        'customCode2': customCode2,
        'customCode3': customCode3,
        'taxCode': taxCode,
        'isTaxExempt': isTaxExempt,
        'taxAmount': taxAmount,
        'feeAmount': feeAmount,
        'discountAmount': discountAmount,
        'netAmount': netAmount,
        'totalAmount': totalAmount,
        'currencyCode': currencyCode,
        'importSource': importSource,
        'importSourceID': importSourceID
    };

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

class Transaction implements IConvertible
{
    String? cendynPropertyID;
    String? sourcePropertyID;
    String? externalResID1;
    String? externalProfileID;
    String? externalRefType;
    String? externalRefID;
    String? transactionSource;
    String? transactionID;
    String? transactionGroup;
    DateTime? transactionDate;
    String? folioID;
    String? folioGroupingID;
    String? transactionCode;
    String? description;
    double? creditAmount;
    double? debitAmount;
    double? netAmount;
    bool? displayOnInvoice;
    String? ledgerAccountNum;
    String? ccTransactionType;
    String? roomNumber;
    String? transferType;
    String? transferredResID;
    String? referenceNum;
    int? postedNights;
    int? itemQty;
    String? userID;
    String? currencyCode;
    int? decimals;
    double? customValue1;
    double? customValue2;

    Transaction({this.cendynPropertyID,this.sourcePropertyID,this.externalResID1,this.externalProfileID,this.externalRefType,this.externalRefID,this.transactionSource,this.transactionID,this.transactionGroup,this.transactionDate,this.folioID,this.folioGroupingID,this.transactionCode,this.description,this.creditAmount,this.debitAmount,this.netAmount,this.displayOnInvoice,this.ledgerAccountNum,this.ccTransactionType,this.roomNumber,this.transferType,this.transferredResID,this.referenceNum,this.postedNights,this.itemQty,this.userID,this.currencyCode,this.decimals,this.customValue1,this.customValue2});
    Transaction.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        cendynPropertyID = json['cendynPropertyID'];
        sourcePropertyID = json['sourcePropertyID'];
        externalResID1 = json['externalResID1'];
        externalProfileID = json['externalProfileID'];
        externalRefType = json['externalRefType'];
        externalRefID = json['externalRefID'];
        transactionSource = json['transactionSource'];
        transactionID = json['transactionID'];
        transactionGroup = json['transactionGroup'];
        transactionDate = JsonConverters.fromJson(json['transactionDate'],'DateTime',context!);
        folioID = json['folioID'];
        folioGroupingID = json['folioGroupingID'];
        transactionCode = json['transactionCode'];
        description = json['description'];
        creditAmount = JsonConverters.toDouble(json['creditAmount']);
        debitAmount = JsonConverters.toDouble(json['debitAmount']);
        netAmount = JsonConverters.toDouble(json['netAmount']);
        displayOnInvoice = json['displayOnInvoice'];
        ledgerAccountNum = json['ledgerAccountNum'];
        ccTransactionType = json['ccTransactionType'];
        roomNumber = json['roomNumber'];
        transferType = json['transferType'];
        transferredResID = json['transferredResID'];
        referenceNum = json['referenceNum'];
        postedNights = json['postedNights'];
        itemQty = json['itemQty'];
        userID = json['userID'];
        currencyCode = json['currencyCode'];
        decimals = json['decimals'];
        customValue1 = JsonConverters.toDouble(json['customValue1']);
        customValue2 = JsonConverters.toDouble(json['customValue2']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'cendynPropertyID': cendynPropertyID,
        'sourcePropertyID': sourcePropertyID,
        'externalResID1': externalResID1,
        'externalProfileID': externalProfileID,
        'externalRefType': externalRefType,
        'externalRefID': externalRefID,
        'transactionSource': transactionSource,
        'transactionID': transactionID,
        'transactionGroup': transactionGroup,
        'transactionDate': JsonConverters.toJson(transactionDate,'DateTime',context!),
        'folioID': folioID,
        'folioGroupingID': folioGroupingID,
        'transactionCode': transactionCode,
        'description': description,
        'creditAmount': creditAmount,
        'debitAmount': debitAmount,
        'netAmount': netAmount,
        'displayOnInvoice': displayOnInvoice,
        'ledgerAccountNum': ledgerAccountNum,
        'ccTransactionType': ccTransactionType,
        'roomNumber': roomNumber,
        'transferType': transferType,
        'transferredResID': transferredResID,
        'referenceNum': referenceNum,
        'postedNights': postedNights,
        'itemQty': itemQty,
        'userID': userID,
        'currencyCode': currencyCode,
        'decimals': decimals,
        'customValue1': customValue1,
        'customValue2': customValue2
    };

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

class TransactionContainer implements IConvertible
{
    String? echoToken;
    TransactionHeader? transactionHeader;
    List<Transaction>? transactions;

    TransactionContainer({this.echoToken,this.transactionHeader,this.transactions});
    TransactionContainer.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        echoToken = json['echoToken'];
        transactionHeader = JsonConverters.fromJson(json['transactionHeader'],'TransactionHeader',context!);
        transactions = JsonConverters.fromJson(json['transactions'],'List<Transaction>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'echoToken': echoToken,
        'transactionHeader': JsonConverters.toJson(transactionHeader,'TransactionHeader',context!),
        'transactions': JsonConverters.toJson(transactions,'List<Transaction>',context!)
    };

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

class TransactionPost implements IConvertible
{
    TransactionContainer? transactionContainer;
    String? subscriptionId;
    String? cendynPropertyId;

    TransactionPost({this.transactionContainer,this.subscriptionId,this.cendynPropertyId});
    TransactionPost.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        transactionContainer = JsonConverters.fromJson(json['transactionContainer'],'TransactionContainer',context!);
        subscriptionId = json['subscriptionId'];
        cendynPropertyId = json['cendynPropertyId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'transactionContainer': JsonConverters.toJson(transactionContainer,'TransactionContainer',context!),
        'subscriptionId': subscriptionId,
        'cendynPropertyId': cendynPropertyId
    };

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

TypeContext _ctx = TypeContext(library: 'cert.cendyn.com', types: <String, TypeInfo> {
    'Response': TypeInfo(TypeOf.Class, create:() => Response()),
    'TransactionHeader': TypeInfo(TypeOf.Class, create:() => TransactionHeader()),
    'Transaction': TypeInfo(TypeOf.Class, create:() => Transaction()),
    'TransactionContainer': TypeInfo(TypeOf.Class, create:() => TransactionContainer()),
    'List<Transaction>': TypeInfo(TypeOf.Class, create:() => <Transaction>[]),
    'TransactionPost': TypeInfo(TypeOf.Class, create:() => TransactionPost()),
});

Dart TransactionPost 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.

POST /transaction/{SubscriptionId}/{CendynPropertyId} HTTP/1.1 
Host: cert.cendyn.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"transactionContainer":{"echoToken":"String","transactionHeader":{"cendynPropertyID":"String","sourcePropertyID":"String","externalResID1":"String","externalProfileID":"String","externalRefType":"String","externalRefID":"String","transactionHeaderSource":"String","externalID1":"String","externalID2":"String","openedDate":"0001-01-01T00:00:00.0000000","closedDate":"0001-01-01T00:00:00.0000000","postedDate":"0001-01-01T00:00:00.0000000","userID":"String","userName":"String","salesRep":"String","shippingCode":"String","referenceNum":"String","customCode1":"String","customCode2":"String","customCode3":0,"taxCode":"String","isTaxExempt":false,"taxAmount":0,"feeAmount":0,"discountAmount":0,"netAmount":0,"totalAmount":0,"currencyCode":"String","importSource":"String","importSourceID":"String"},"transactions":[{"cendynPropertyID":"String","sourcePropertyID":"String","externalResID1":"String","externalProfileID":"String","externalRefType":"String","externalRefID":"String","transactionSource":"String","transactionID":"String","transactionGroup":"String","transactionDate":"0001-01-01T00:00:00.0000000","folioID":"String","folioGroupingID":"String","transactionCode":"String","description":"String","creditAmount":0,"debitAmount":0,"netAmount":0,"displayOnInvoice":false,"ledgerAccountNum":"String","ccTransactionType":"String","roomNumber":"String","transferType":"String","transferredResID":"String","referenceNum":"String","postedNights":0,"itemQty":0,"userID":"String","currencyCode":"String","decimals":0,"customValue1":0,"customValue2":0}]},"subscriptionId":"String","cendynPropertyId":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"statusCode":"String","recordCount":0,"errorCount":0}