Required permission: | CreatePayments |
POST | /Dynamics/CreateSale/{regent_id} |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class FinanceCreateSaleItemsRequest implements IConvertible
{
double? amount;
String? code;
FinanceCreateSaleItemsRequest({this.amount,this.code});
FinanceCreateSaleItemsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
amount = JsonConverters.toDouble(json['amount']);
code = json['code'];
return this;
}
Map<String, dynamic> toJson() => {
'amount': amount,
'code': code
};
getTypeName() => "FinanceCreateSaleItemsRequest";
TypeContext? context = _ctx;
}
class FinanceCreateSaleRequest implements IConvertible
{
int? regent_id;
double? amount;
String? code;
String? rebate_code;
double? rebate_amount;
String? payment_id;
String? reporting_term;
List<FinanceCreateSaleItemsRequest>? sale_items;
FinanceCreateSaleRequest({this.regent_id,this.amount,this.code,this.rebate_code,this.rebate_amount,this.payment_id,this.reporting_term,this.sale_items});
FinanceCreateSaleRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
regent_id = json['regent_id'];
amount = JsonConverters.toDouble(json['amount']);
code = json['code'];
rebate_code = json['rebate_code'];
rebate_amount = JsonConverters.toDouble(json['rebate_amount']);
payment_id = json['payment_id'];
reporting_term = json['reporting_term'];
sale_items = JsonConverters.fromJson(json['sale_items'],'List<FinanceCreateSaleItemsRequest>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'regent_id': regent_id,
'amount': amount,
'code': code,
'rebate_code': rebate_code,
'rebate_amount': rebate_amount,
'payment_id': payment_id,
'reporting_term': reporting_term,
'sale_items': JsonConverters.toJson(sale_items,'List<FinanceCreateSaleItemsRequest>',context!)
};
getTypeName() => "FinanceCreateSaleRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'data.regent_college.edu', types: <String, TypeInfo> {
'FinanceCreateSaleItemsRequest': TypeInfo(TypeOf.Class, create:() => FinanceCreateSaleItemsRequest()),
'FinanceCreateSaleRequest': TypeInfo(TypeOf.Class, create:() => FinanceCreateSaleRequest()),
'List<FinanceCreateSaleItemsRequest>': TypeInfo(TypeOf.Class, create:() => <FinanceCreateSaleItemsRequest>[]),
});
Dart FinanceCreateSaleRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /Dynamics/CreateSale/{regent_id} HTTP/1.1
Host: data.regent-college.edu
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
regent_id: 0,
amount: 0,
code: String,
rebate_code: String,
rebate_amount: 0,
payment_id: String,
reporting_term: String,
sale_items:
[
{
amount: 0,
code: String
}
]
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } }