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

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

<TransactionPost xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CenResSS.ServiceModel">
  <CendynPropertyId>String</CendynPropertyId>
  <SubscriptionId>String</SubscriptionId>
  <TransactionContainer>
    <EchoToken>String</EchoToken>
    <TransactionHeader>
      <CendynPropertyID>String</CendynPropertyID>
      <ClosedDate>0001-01-01T00:00:00</ClosedDate>
      <CurrencyCode>String</CurrencyCode>
      <CustomCode1>String</CustomCode1>
      <CustomCode2>String</CustomCode2>
      <CustomCode3>0</CustomCode3>
      <DiscountAmount>0</DiscountAmount>
      <ExternalID1>String</ExternalID1>
      <ExternalID2>String</ExternalID2>
      <ExternalProfileID>String</ExternalProfileID>
      <ExternalRefID>String</ExternalRefID>
      <ExternalRefType>String</ExternalRefType>
      <ExternalResID1>String</ExternalResID1>
      <FeeAmount>0</FeeAmount>
      <ImportSource>String</ImportSource>
      <ImportSourceID>String</ImportSourceID>
      <IsTaxExempt>false</IsTaxExempt>
      <NetAmount>0</NetAmount>
      <OpenedDate>0001-01-01T00:00:00</OpenedDate>
      <PostedDate>0001-01-01T00:00:00</PostedDate>
      <ReferenceNum>String</ReferenceNum>
      <SalesRep>String</SalesRep>
      <ShippingCode>String</ShippingCode>
      <SourcePropertyID>String</SourcePropertyID>
      <TaxAmount>0</TaxAmount>
      <TaxCode>String</TaxCode>
      <TotalAmount>0</TotalAmount>
      <TransactionHeaderSource>String</TransactionHeaderSource>
      <UserID>String</UserID>
      <UserName>String</UserName>
    </TransactionHeader>
    <Transactions>
      <Transaction>
        <CCTransactionType>String</CCTransactionType>
        <CendynPropertyID>String</CendynPropertyID>
        <CreditAmount>0</CreditAmount>
        <CurrencyCode>String</CurrencyCode>
        <CustomValue1>0</CustomValue1>
        <CustomValue2>0</CustomValue2>
        <DebitAmount>0</DebitAmount>
        <Decimals>0</Decimals>
        <Description>String</Description>
        <DisplayOnInvoice>false</DisplayOnInvoice>
        <ExternalProfileID>String</ExternalProfileID>
        <ExternalRefID>String</ExternalRefID>
        <ExternalRefType>String</ExternalRefType>
        <ExternalResID1>String</ExternalResID1>
        <FolioGroupingID>String</FolioGroupingID>
        <FolioID>String</FolioID>
        <ItemQty>0</ItemQty>
        <LedgerAccountNum>String</LedgerAccountNum>
        <NetAmount>0</NetAmount>
        <PostedNights>0</PostedNights>
        <ReferenceNum>String</ReferenceNum>
        <RoomNumber>String</RoomNumber>
        <SourcePropertyID>String</SourcePropertyID>
        <TransactionCode>String</TransactionCode>
        <TransactionDate>0001-01-01T00:00:00</TransactionDate>
        <TransactionGroup>String</TransactionGroup>
        <TransactionID>String</TransactionID>
        <TransactionSource>String</TransactionSource>
        <TransferType>String</TransferType>
        <TransferredResID>String</TransferredResID>
        <UserID>String</UserID>
      </Transaction>
    </Transactions>
  </TransactionContainer>
</TransactionPost>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<Response xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CenResSS.ServiceModel">
  <ErrorCount>0</ErrorCount>
  <RecordCount>0</RecordCount>
  <StatusCode>String</StatusCode>
</Response>