POST | /billables |
---|
import 'package:servicestack/servicestack.dart';
/**
* Report/create a new billable
*/
// @Api(Description="Report/create a new billable")
class NewBillable implements IPost, IConvertible
{
/**
* The account to associate the billable with
*/
// @ApiMember(Description="The account to associate the billable with")
String? accountId;
/**
* The customer to associate the billable with
*/
// @ApiMember(Description="The customer to associate the billable with")
String? customerId;
/**
* The session ID to associate the billable with. You must specify either this or (AccountId + CustomerID)
*/
// @ApiMember(Description="The session ID to associate the billable with. You must specify either this or (AccountId + CustomerID)")
String? sessionId;
/**
* The call SID to report
*/
// @ApiMember(Description="The call SID to report")
String? callSid;
NewBillable({this.accountId,this.customerId,this.sessionId,this.callSid});
NewBillable.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
accountId = json['accountId'];
customerId = json['customerId'];
sessionId = json['sessionId'];
callSid = json['callSid'];
return this;
}
Map<String, dynamic> toJson() => {
'accountId': accountId,
'customerId': customerId,
'sessionId': sessionId,
'callSid': callSid
};
getTypeName() => "NewBillable";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'evovoice.io', types: <String, TypeInfo> {
'NewBillable': TypeInfo(TypeOf.Class, create:() => NewBillable()),
});
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 /billables HTTP/1.1
Host: evovoice.io
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<NewBillable xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Billing">
<AccountId>String</AccountId>
<CallSid>String</CallSid>
<CustomerId>String</CustomerId>
<SessionId>String</SessionId>
</NewBillable>