| POST | /payments/credit |
|---|
import 'package:servicestack/servicestack.dart';
class CreateApplyCreditReply implements IConvertible
{
int? ErrorCode;
String? ErrorMessage;
CreateApplyCreditReply({this.ErrorCode,this.ErrorMessage});
CreateApplyCreditReply.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ErrorCode = json['ErrorCode'];
ErrorMessage = json['ErrorMessage'];
return this;
}
Map<String, dynamic> toJson() => {
'ErrorCode': ErrorCode,
'ErrorMessage': ErrorMessage
};
getTypeName() => "CreateApplyCreditReply";
TypeContext? context = _ctx;
}
class SalesForceCreditInvoiceDetails implements IConvertible
{
int? Invoice;
double? AmountPaid;
String? Region;
String? CostCenter;
SalesForceCreditInvoiceDetails({this.Invoice,this.AmountPaid,this.Region,this.CostCenter});
SalesForceCreditInvoiceDetails.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Invoice = json['Invoice'];
AmountPaid = JsonConverters.toDouble(json['AmountPaid']);
Region = json['Region'];
CostCenter = json['CostCenter'];
return this;
}
Map<String, dynamic> toJson() => {
'Invoice': Invoice,
'AmountPaid': AmountPaid,
'Region': Region,
'CostCenter': CostCenter
};
getTypeName() => "SalesForceCreditInvoiceDetails";
TypeContext? context = _ctx;
}
class CreateApplyCredit implements IConvertible
{
String? ClassName;
String? UniqueId;
DateTime? CreatedDateTime;
int? ClientId;
String? GroupId;
String? UserId;
int? BhUserId;
int? CreditId;
String? CurrencyType;
String? CreditType;
String? Notes;
List<SalesForceCreditInvoiceDetails>? InvoiceDetails;
CreateApplyCredit({this.ClassName,this.UniqueId,this.CreatedDateTime,this.ClientId,this.GroupId,this.UserId,this.BhUserId,this.CreditId,this.CurrencyType,this.CreditType,this.Notes,this.InvoiceDetails});
CreateApplyCredit.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'];
BhUserId = json['BhUserId'];
CreditId = json['CreditId'];
CurrencyType = json['CurrencyType'];
CreditType = json['CreditType'];
Notes = json['Notes'];
InvoiceDetails = JsonConverters.fromJson(json['InvoiceDetails'],'List<SalesForceCreditInvoiceDetails>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ClassName': ClassName,
'UniqueId': UniqueId,
'CreatedDateTime': JsonConverters.toJson(CreatedDateTime,'DateTime',context!),
'ClientId': ClientId,
'GroupId': GroupId,
'UserId': UserId,
'BhUserId': BhUserId,
'CreditId': CreditId,
'CurrencyType': CurrencyType,
'CreditType': CreditType,
'Notes': Notes,
'InvoiceDetails': JsonConverters.toJson(InvoiceDetails,'List<SalesForceCreditInvoiceDetails>',context!)
};
getTypeName() => "CreateApplyCredit";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'devapi.billhighway.com', types: <String, TypeInfo> {
'CreateApplyCreditReply': TypeInfo(TypeOf.Class, create:() => CreateApplyCreditReply()),
'SalesForceCreditInvoiceDetails': TypeInfo(TypeOf.Class, create:() => SalesForceCreditInvoiceDetails()),
'CreateApplyCredit': TypeInfo(TypeOf.Class, create:() => CreateApplyCredit()),
'List<SalesForceCreditInvoiceDetails>': TypeInfo(TypeOf.Class, create:() => <SalesForceCreditInvoiceDetails>[]),
});
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 /payments/credit HTTP/1.1
Host: devapi.billhighway.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateApplyCredit xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.SalesForce">
<BhUserId>0</BhUserId>
<ClassName>String</ClassName>
<ClientId>0</ClientId>
<CreatedDateTime>0001-01-01T00:00:00</CreatedDateTime>
<CreditId>0</CreditId>
<CreditType>String</CreditType>
<CurrencyType>String</CurrencyType>
<GroupId>String</GroupId>
<InvoiceDetails>
<SalesForceCreditInvoiceDetails>
<AmountPaid>0</AmountPaid>
<CostCenter>String</CostCenter>
<Invoice>0</Invoice>
<Region>String</Region>
</SalesForceCreditInvoiceDetails>
</InvoiceDetails>
<Notes>String</Notes>
<UniqueId>String</UniqueId>
<UserId>String</UserId>
</CreateApplyCredit>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CreateApplyCreditReply xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.SalesForce"> <ErrorCode>0</ErrorCode> <ErrorMessage>String</ErrorMessage> </CreateApplyCreditReply>