| POST | /api/SalesForce/InvoiceCollection |
|---|
import 'package:servicestack/servicestack.dart';
class SalesForceInvoiceReply implements IConvertible
{
String? ClassName;
String? UniqueId;
DateTime? CreatedDateTime;
int? ClientId;
int? ErrorCode;
String? ErrorMessage;
int? InvBatchNo;
double? InvAmount;
SalesForceInvoiceReply({this.ClassName,this.UniqueId,this.CreatedDateTime,this.ClientId,this.ErrorCode,this.ErrorMessage,this.InvBatchNo,this.InvAmount});
SalesForceInvoiceReply.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ClassName = json['ClassName'];
UniqueId = json['UniqueId'];
CreatedDateTime = JsonConverters.fromJson(json['CreatedDateTime'],'DateTime',context!);
ClientId = json['ClientId'];
ErrorCode = json['ErrorCode'];
ErrorMessage = json['ErrorMessage'];
InvBatchNo = json['InvBatchNo'];
InvAmount = JsonConverters.toDouble(json['InvAmount']);
return this;
}
Map<String, dynamic> toJson() => {
'ClassName': ClassName,
'UniqueId': UniqueId,
'CreatedDateTime': JsonConverters.toJson(CreatedDateTime,'DateTime',context!),
'ClientId': ClientId,
'ErrorCode': ErrorCode,
'ErrorMessage': ErrorMessage,
'InvBatchNo': InvBatchNo,
'InvAmount': InvAmount
};
getTypeName() => "SalesForceInvoiceReply";
TypeContext? context = _ctx;
}
class SalesForceInvoiceCollectionReply implements IHaveErrorField, IConvertible
{
List<SalesForceInvoiceReply>? InvoiceReply;
bool? IsError;
SalesForceInvoiceCollectionReply({this.InvoiceReply,this.IsError});
SalesForceInvoiceCollectionReply.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
InvoiceReply = JsonConverters.fromJson(json['InvoiceReply'],'List<SalesForceInvoiceReply>',context!);
IsError = json['IsError'];
return this;
}
Map<String, dynamic> toJson() => {
'InvoiceReply': JsonConverters.toJson(InvoiceReply,'List<SalesForceInvoiceReply>',context!),
'IsError': IsError
};
getTypeName() => "SalesForceInvoiceCollectionReply";
TypeContext? context = _ctx;
}
class SalesForceInvoiceItem implements IConvertible
{
String? ClassName;
String? UniqueId;
DateTime? CreatedDateTime;
int? ClientId;
String? ProductName;
String? AmountDue;
String? ProductType;
int? ActPatternTypeId;
DateTime? TermStartDate;
DateTime? TermEndDate;
int? RecognitionPeriod;
String? RevenueAccount;
String? AccountsReceivableAccount;
String? LiabilityAccount;
String? CreditExpenseAccount;
String? InvoiceClearingAccount;
String? CostCenter;
String? Region;
SalesForceInvoiceItem({this.ClassName,this.UniqueId,this.CreatedDateTime,this.ClientId,this.ProductName,this.AmountDue,this.ProductType,this.ActPatternTypeId,this.TermStartDate,this.TermEndDate,this.RecognitionPeriod,this.RevenueAccount,this.AccountsReceivableAccount,this.LiabilityAccount,this.CreditExpenseAccount,this.InvoiceClearingAccount,this.CostCenter,this.Region});
SalesForceInvoiceItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ClassName = json['ClassName'];
UniqueId = json['UniqueId'];
CreatedDateTime = JsonConverters.fromJson(json['CreatedDateTime'],'DateTime',context!);
ClientId = json['ClientId'];
ProductName = json['ProductName'];
AmountDue = json['AmountDue'];
ProductType = json['ProductType'];
ActPatternTypeId = json['ActPatternTypeId'];
TermStartDate = JsonConverters.fromJson(json['TermStartDate'],'DateTime',context!);
TermEndDate = JsonConverters.fromJson(json['TermEndDate'],'DateTime',context!);
RecognitionPeriod = json['RecognitionPeriod'];
RevenueAccount = json['RevenueAccount'];
AccountsReceivableAccount = json['AccountsReceivableAccount'];
LiabilityAccount = json['LiabilityAccount'];
CreditExpenseAccount = json['CreditExpenseAccount'];
InvoiceClearingAccount = json['InvoiceClearingAccount'];
CostCenter = json['CostCenter'];
Region = json['Region'];
return this;
}
Map<String, dynamic> toJson() => {
'ClassName': ClassName,
'UniqueId': UniqueId,
'CreatedDateTime': JsonConverters.toJson(CreatedDateTime,'DateTime',context!),
'ClientId': ClientId,
'ProductName': ProductName,
'AmountDue': AmountDue,
'ProductType': ProductType,
'ActPatternTypeId': ActPatternTypeId,
'TermStartDate': JsonConverters.toJson(TermStartDate,'DateTime',context!),
'TermEndDate': JsonConverters.toJson(TermEndDate,'DateTime',context!),
'RecognitionPeriod': RecognitionPeriod,
'RevenueAccount': RevenueAccount,
'AccountsReceivableAccount': AccountsReceivableAccount,
'LiabilityAccount': LiabilityAccount,
'CreditExpenseAccount': CreditExpenseAccount,
'InvoiceClearingAccount': InvoiceClearingAccount,
'CostCenter': CostCenter,
'Region': Region
};
getTypeName() => "SalesForceInvoiceItem";
TypeContext? context = _ctx;
}
class SalesForceInvoice implements IConvertible
{
String? ClassName;
String? UniqueId;
DateTime? CreatedDateTime;
int? ClientId;
String? GroupId;
String? UserId;
String? OpportunityId;
DateTime? InvoiceDueDate;
int? Installments;
int? Frequency;
int? BhUserId;
String? Description;
bool? Deliver;
String? CurrencyType;
List<SalesForceInvoiceItem>? InvoiceItems;
int? InvoiceNo;
double? InvoiceAmt;
String? ExternalInvBatchNo;
bool? ExemptFromLateFee;
SalesForceInvoice({this.ClassName,this.UniqueId,this.CreatedDateTime,this.ClientId,this.GroupId,this.UserId,this.OpportunityId,this.InvoiceDueDate,this.Installments,this.Frequency,this.BhUserId,this.Description,this.Deliver,this.CurrencyType,this.InvoiceItems,this.InvoiceNo,this.InvoiceAmt,this.ExternalInvBatchNo,this.ExemptFromLateFee});
SalesForceInvoice.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ClassName = json['ClassName'];
UniqueId = json['UniqueId'];
CreatedDateTime = JsonConverters.fromJson(json['CreatedDateTime'],'DateTime',context!);
ClientId = json['ClientId'];
GroupId = json['GroupId'];
UserId = json['UserId'];
OpportunityId = json['OpportunityId'];
InvoiceDueDate = JsonConverters.fromJson(json['InvoiceDueDate'],'DateTime',context!);
Installments = json['Installments'];
Frequency = json['Frequency'];
BhUserId = json['BhUserId'];
Description = json['Description'];
Deliver = json['Deliver'];
CurrencyType = json['CurrencyType'];
InvoiceItems = JsonConverters.fromJson(json['InvoiceItems'],'List<SalesForceInvoiceItem>',context!);
InvoiceNo = json['InvoiceNo'];
InvoiceAmt = JsonConverters.toDouble(json['InvoiceAmt']);
ExternalInvBatchNo = json['ExternalInvBatchNo'];
ExemptFromLateFee = json['ExemptFromLateFee'];
return this;
}
Map<String, dynamic> toJson() => {
'ClassName': ClassName,
'UniqueId': UniqueId,
'CreatedDateTime': JsonConverters.toJson(CreatedDateTime,'DateTime',context!),
'ClientId': ClientId,
'GroupId': GroupId,
'UserId': UserId,
'OpportunityId': OpportunityId,
'InvoiceDueDate': JsonConverters.toJson(InvoiceDueDate,'DateTime',context!),
'Installments': Installments,
'Frequency': Frequency,
'BhUserId': BhUserId,
'Description': Description,
'Deliver': Deliver,
'CurrencyType': CurrencyType,
'InvoiceItems': JsonConverters.toJson(InvoiceItems,'List<SalesForceInvoiceItem>',context!),
'InvoiceNo': InvoiceNo,
'InvoiceAmt': InvoiceAmt,
'ExternalInvBatchNo': ExternalInvBatchNo,
'ExemptFromLateFee': ExemptFromLateFee
};
getTypeName() => "SalesForceInvoice";
TypeContext? context = _ctx;
}
class SalesForceInvoiceCollection implements IConvertible
{
List<SalesForceInvoice>? InvoiceCollection;
SalesForceInvoiceCollection({this.InvoiceCollection});
SalesForceInvoiceCollection.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
InvoiceCollection = JsonConverters.fromJson(json['InvoiceCollection'],'List<SalesForceInvoice>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'InvoiceCollection': JsonConverters.toJson(InvoiceCollection,'List<SalesForceInvoice>',context!)
};
getTypeName() => "SalesForceInvoiceCollection";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'devapi.billhighway.com', types: <String, TypeInfo> {
'SalesForceInvoiceReply': TypeInfo(TypeOf.Class, create:() => SalesForceInvoiceReply()),
'SalesForceInvoiceCollectionReply': TypeInfo(TypeOf.Class, create:() => SalesForceInvoiceCollectionReply()),
'List<SalesForceInvoiceReply>': TypeInfo(TypeOf.Class, create:() => <SalesForceInvoiceReply>[]),
'SalesForceInvoiceItem': TypeInfo(TypeOf.Class, create:() => SalesForceInvoiceItem()),
'SalesForceInvoice': TypeInfo(TypeOf.Class, create:() => SalesForceInvoice()),
'List<SalesForceInvoiceItem>': TypeInfo(TypeOf.Class, create:() => <SalesForceInvoiceItem>[]),
'SalesForceInvoiceCollection': TypeInfo(TypeOf.Class, create:() => SalesForceInvoiceCollection()),
'List<SalesForceInvoice>': TypeInfo(TypeOf.Class, create:() => <SalesForceInvoice>[]),
});
Dart SalesForceInvoiceCollection DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/SalesForce/InvoiceCollection HTTP/1.1
Host: devapi.billhighway.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<SalesForceInvoiceCollection xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.SalesForce">
<InvoiceCollection>
<SalesForceInvoice>
<BhUserId>0</BhUserId>
<ClassName>String</ClassName>
<ClientId>0</ClientId>
<CreatedDateTime>0001-01-01T00:00:00</CreatedDateTime>
<CurrencyType>String</CurrencyType>
<Deliver>false</Deliver>
<Description>String</Description>
<ExemptFromLateFee>false</ExemptFromLateFee>
<ExternalInvBatchNo>String</ExternalInvBatchNo>
<Frequency>0</Frequency>
<GroupId>String</GroupId>
<Installments>0</Installments>
<InvoiceAmt>0</InvoiceAmt>
<InvoiceDueDate>0001-01-01T00:00:00</InvoiceDueDate>
<InvoiceItems>
<SalesForceInvoiceItem>
<AccountsReceivableAccount>String</AccountsReceivableAccount>
<ActPatternTypeId>0</ActPatternTypeId>
<AmountDue>String</AmountDue>
<ClassName>String</ClassName>
<ClientId>0</ClientId>
<CostCenter>String</CostCenter>
<CreatedDateTime>0001-01-01T00:00:00</CreatedDateTime>
<CreditExpenseAccount>String</CreditExpenseAccount>
<InvoiceClearingAccount>String</InvoiceClearingAccount>
<LiabilityAccount>String</LiabilityAccount>
<ProductName>String</ProductName>
<ProductType>String</ProductType>
<RecognitionPeriod>0</RecognitionPeriod>
<Region>String</Region>
<RevenueAccount>String</RevenueAccount>
<TermEndDate>0001-01-01T00:00:00</TermEndDate>
<TermStartDate>0001-01-01T00:00:00</TermStartDate>
<UniqueId>String</UniqueId>
</SalesForceInvoiceItem>
</InvoiceItems>
<InvoiceNo>0</InvoiceNo>
<OpportunityId>String</OpportunityId>
<UniqueId>String</UniqueId>
<UserId>String</UserId>
</SalesForceInvoice>
</InvoiceCollection>
</SalesForceInvoiceCollection>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<SalesForceInvoiceCollectionReply xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.SalesForce">
<InvoiceReply>
<SalesForceInvoiceReply>
<ClassName>String</ClassName>
<ClientId>0</ClientId>
<CreatedDateTime>0001-01-01T00:00:00</CreatedDateTime>
<ErrorCode>0</ErrorCode>
<ErrorMessage>String</ErrorMessage>
<InvAmount>0</InvAmount>
<InvBatchNo>0</InvBatchNo>
<UniqueId>String</UniqueId>
</SalesForceInvoiceReply>
</InvoiceReply>
</SalesForceInvoiceCollectionReply>