Required role: | REGISUserRole |
POST | /DynamicsCRM/Payments |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class CRMPaymentResponse implements IConvertible
{
int? regent_id;
String? contact_addressee;
String? donor_first_name;
String? donor_last_name;
String? donor_addressee;
String? donor_city;
String? donor_country;
String? donor_owner_full_name;
bool? is_contact;
bool? is_account;
int? soft_credit_regent_id;
String? soft_credit_contact_addressee;
String? soft_credit_contact_first_name;
String? soft_credit_contact_last_name;
bool? soft_credit_contact_spouse_is_main_contact;
String? soft_credit_contact_city;
String? soft_credit_contact_country;
String? soft_credit_contact_owner_full_name;
int? soft_credit_second_regent_id;
String? soft_credit_second_contact_addressee;
String? soft_credit_second_contact_first_name;
String? soft_credit_second_contact_last_name;
bool? soft_credit_second_contact_spouse_is_main_contact;
String? soft_credit_second_contact_city;
String? soft_credit_second_contact_country;
String? soft_credit_second_contact_owner_full_name;
bool? spouse_is_main_contact;
int? import_id;
String? donation_id;
String? payment_id;
String? guid;
String? name;
String? description;
String? appeal_code;
String? designation;
String? designation_description;
String? general_ledger_account_number;
String? campaign;
double? total_pledge_amount;
double? total_paid_amount;
double? amount;
double? canadian_amount;
double? payment_exchange_rate;
double? receipt_amount;
double? gift_exchange_rate;
double? total_paid_canadian_amount;
bool? is_recurring;
bool? is_complete;
bool? is_parent_donation;
String? currency;
String? source;
String? channel;
String? receipting_organization;
String? type;
bool? push_to_gp;
DateTime? finance_entry_date;
String? finance_id;
bool? acknowledgment_sent;
bool? send_acknowledgment;
String? acknowledgment_template_guid;
String? parent_guid;
bool? anonymous;
DateTime? gift_date;
DateTime? recurring_gift_start_date;
DateTime? recurring_gift_end_date;
DateTime? payment_date;
String? tax_receipt;
DateTime? tax_receipt_date_sent;
String? cheque_number;
int? version_number;
DateTime? added_date;
CRMPaymentResponse({this.regent_id,this.contact_addressee,this.donor_first_name,this.donor_last_name,this.donor_addressee,this.donor_city,this.donor_country,this.donor_owner_full_name,this.is_contact,this.is_account,this.soft_credit_regent_id,this.soft_credit_contact_addressee,this.soft_credit_contact_first_name,this.soft_credit_contact_last_name,this.soft_credit_contact_spouse_is_main_contact,this.soft_credit_contact_city,this.soft_credit_contact_country,this.soft_credit_contact_owner_full_name,this.soft_credit_second_regent_id,this.soft_credit_second_contact_addressee,this.soft_credit_second_contact_first_name,this.soft_credit_second_contact_last_name,this.soft_credit_second_contact_spouse_is_main_contact,this.soft_credit_second_contact_city,this.soft_credit_second_contact_country,this.soft_credit_second_contact_owner_full_name,this.spouse_is_main_contact,this.import_id,this.donation_id,this.payment_id,this.guid,this.name,this.description,this.appeal_code,this.designation,this.designation_description,this.general_ledger_account_number,this.campaign,this.total_pledge_amount,this.total_paid_amount,this.amount,this.canadian_amount,this.payment_exchange_rate,this.receipt_amount,this.gift_exchange_rate,this.total_paid_canadian_amount,this.is_recurring,this.is_complete,this.is_parent_donation,this.currency,this.source,this.channel,this.receipting_organization,this.type,this.push_to_gp,this.finance_entry_date,this.finance_id,this.acknowledgment_sent,this.send_acknowledgment,this.acknowledgment_template_guid,this.parent_guid,this.anonymous,this.gift_date,this.recurring_gift_start_date,this.recurring_gift_end_date,this.payment_date,this.tax_receipt,this.tax_receipt_date_sent,this.cheque_number,this.version_number,this.added_date});
CRMPaymentResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
regent_id = json['regent_id'];
contact_addressee = json['contact_addressee'];
donor_first_name = json['donor_first_name'];
donor_last_name = json['donor_last_name'];
donor_addressee = json['donor_addressee'];
donor_city = json['donor_city'];
donor_country = json['donor_country'];
donor_owner_full_name = json['donor_owner_full_name'];
is_contact = json['is_contact'];
is_account = json['is_account'];
soft_credit_regent_id = json['soft_credit_regent_id'];
soft_credit_contact_addressee = json['soft_credit_contact_addressee'];
soft_credit_contact_first_name = json['soft_credit_contact_first_name'];
soft_credit_contact_last_name = json['soft_credit_contact_last_name'];
soft_credit_contact_spouse_is_main_contact = json['soft_credit_contact_spouse_is_main_contact'];
soft_credit_contact_city = json['soft_credit_contact_city'];
soft_credit_contact_country = json['soft_credit_contact_country'];
soft_credit_contact_owner_full_name = json['soft_credit_contact_owner_full_name'];
soft_credit_second_regent_id = json['soft_credit_second_regent_id'];
soft_credit_second_contact_addressee = json['soft_credit_second_contact_addressee'];
soft_credit_second_contact_first_name = json['soft_credit_second_contact_first_name'];
soft_credit_second_contact_last_name = json['soft_credit_second_contact_last_name'];
soft_credit_second_contact_spouse_is_main_contact = json['soft_credit_second_contact_spouse_is_main_contact'];
soft_credit_second_contact_city = json['soft_credit_second_contact_city'];
soft_credit_second_contact_country = json['soft_credit_second_contact_country'];
soft_credit_second_contact_owner_full_name = json['soft_credit_second_contact_owner_full_name'];
spouse_is_main_contact = json['spouse_is_main_contact'];
import_id = json['import_id'];
donation_id = json['donation_id'];
payment_id = json['payment_id'];
guid = json['guid'];
name = json['name'];
description = json['description'];
appeal_code = json['appeal_code'];
designation = json['designation'];
designation_description = json['designation_description'];
general_ledger_account_number = json['general_ledger_account_number'];
campaign = json['campaign'];
total_pledge_amount = JsonConverters.toDouble(json['total_pledge_amount']);
total_paid_amount = JsonConverters.toDouble(json['total_paid_amount']);
amount = JsonConverters.toDouble(json['amount']);
canadian_amount = JsonConverters.toDouble(json['canadian_amount']);
payment_exchange_rate = JsonConverters.toDouble(json['payment_exchange_rate']);
receipt_amount = JsonConverters.toDouble(json['receipt_amount']);
gift_exchange_rate = JsonConverters.toDouble(json['gift_exchange_rate']);
total_paid_canadian_amount = JsonConverters.toDouble(json['total_paid_canadian_amount']);
is_recurring = json['is_recurring'];
is_complete = json['is_complete'];
is_parent_donation = json['is_parent_donation'];
currency = json['currency'];
source = json['source'];
channel = json['channel'];
receipting_organization = json['receipting_organization'];
type = json['type'];
push_to_gp = json['push_to_gp'];
finance_entry_date = JsonConverters.fromJson(json['finance_entry_date'],'DateTime',context!);
finance_id = json['finance_id'];
acknowledgment_sent = json['acknowledgment_sent'];
send_acknowledgment = json['send_acknowledgment'];
acknowledgment_template_guid = json['acknowledgment_template_guid'];
parent_guid = json['parent_guid'];
anonymous = json['anonymous'];
gift_date = JsonConverters.fromJson(json['gift_date'],'DateTime',context!);
recurring_gift_start_date = JsonConverters.fromJson(json['recurring_gift_start_date'],'DateTime',context!);
recurring_gift_end_date = JsonConverters.fromJson(json['recurring_gift_end_date'],'DateTime',context!);
payment_date = JsonConverters.fromJson(json['payment_date'],'DateTime',context!);
tax_receipt = json['tax_receipt'];
tax_receipt_date_sent = JsonConverters.fromJson(json['tax_receipt_date_sent'],'DateTime',context!);
cheque_number = json['cheque_number'];
version_number = json['version_number'];
added_date = JsonConverters.fromJson(json['added_date'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'regent_id': regent_id,
'contact_addressee': contact_addressee,
'donor_first_name': donor_first_name,
'donor_last_name': donor_last_name,
'donor_addressee': donor_addressee,
'donor_city': donor_city,
'donor_country': donor_country,
'donor_owner_full_name': donor_owner_full_name,
'is_contact': is_contact,
'is_account': is_account,
'soft_credit_regent_id': soft_credit_regent_id,
'soft_credit_contact_addressee': soft_credit_contact_addressee,
'soft_credit_contact_first_name': soft_credit_contact_first_name,
'soft_credit_contact_last_name': soft_credit_contact_last_name,
'soft_credit_contact_spouse_is_main_contact': soft_credit_contact_spouse_is_main_contact,
'soft_credit_contact_city': soft_credit_contact_city,
'soft_credit_contact_country': soft_credit_contact_country,
'soft_credit_contact_owner_full_name': soft_credit_contact_owner_full_name,
'soft_credit_second_regent_id': soft_credit_second_regent_id,
'soft_credit_second_contact_addressee': soft_credit_second_contact_addressee,
'soft_credit_second_contact_first_name': soft_credit_second_contact_first_name,
'soft_credit_second_contact_last_name': soft_credit_second_contact_last_name,
'soft_credit_second_contact_spouse_is_main_contact': soft_credit_second_contact_spouse_is_main_contact,
'soft_credit_second_contact_city': soft_credit_second_contact_city,
'soft_credit_second_contact_country': soft_credit_second_contact_country,
'soft_credit_second_contact_owner_full_name': soft_credit_second_contact_owner_full_name,
'spouse_is_main_contact': spouse_is_main_contact,
'import_id': import_id,
'donation_id': donation_id,
'payment_id': payment_id,
'guid': guid,
'name': name,
'description': description,
'appeal_code': appeal_code,
'designation': designation,
'designation_description': designation_description,
'general_ledger_account_number': general_ledger_account_number,
'campaign': campaign,
'total_pledge_amount': total_pledge_amount,
'total_paid_amount': total_paid_amount,
'amount': amount,
'canadian_amount': canadian_amount,
'payment_exchange_rate': payment_exchange_rate,
'receipt_amount': receipt_amount,
'gift_exchange_rate': gift_exchange_rate,
'total_paid_canadian_amount': total_paid_canadian_amount,
'is_recurring': is_recurring,
'is_complete': is_complete,
'is_parent_donation': is_parent_donation,
'currency': currency,
'source': source,
'channel': channel,
'receipting_organization': receipting_organization,
'type': type,
'push_to_gp': push_to_gp,
'finance_entry_date': JsonConverters.toJson(finance_entry_date,'DateTime',context!),
'finance_id': finance_id,
'acknowledgment_sent': acknowledgment_sent,
'send_acknowledgment': send_acknowledgment,
'acknowledgment_template_guid': acknowledgment_template_guid,
'parent_guid': parent_guid,
'anonymous': anonymous,
'gift_date': JsonConverters.toJson(gift_date,'DateTime',context!),
'recurring_gift_start_date': JsonConverters.toJson(recurring_gift_start_date,'DateTime',context!),
'recurring_gift_end_date': JsonConverters.toJson(recurring_gift_end_date,'DateTime',context!),
'payment_date': JsonConverters.toJson(payment_date,'DateTime',context!),
'tax_receipt': tax_receipt,
'tax_receipt_date_sent': JsonConverters.toJson(tax_receipt_date_sent,'DateTime',context!),
'cheque_number': cheque_number,
'version_number': version_number,
'added_date': JsonConverters.toJson(added_date,'DateTime',context!)
};
getTypeName() => "CRMPaymentResponse";
TypeContext? context = _ctx;
}
class CRMPaymentsResponse implements IConvertible
{
ResponseStatus? responseStatus;
List<CRMPaymentResponse>? payments;
DateTime? from_date;
DateTime? to_date;
int? start_version_number;
int? end_version_number;
CRMPaymentsResponse({this.responseStatus,this.payments,this.from_date,this.to_date,this.start_version_number,this.end_version_number});
CRMPaymentsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
payments = JsonConverters.fromJson(json['payments'],'List<CRMPaymentResponse>',context!);
from_date = JsonConverters.fromJson(json['from_date'],'DateTime',context!);
to_date = JsonConverters.fromJson(json['to_date'],'DateTime',context!);
start_version_number = json['start_version_number'];
end_version_number = json['end_version_number'];
return this;
}
Map<String, dynamic> toJson() => {
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!),
'payments': JsonConverters.toJson(payments,'List<CRMPaymentResponse>',context!),
'from_date': JsonConverters.toJson(from_date,'DateTime',context!),
'to_date': JsonConverters.toJson(to_date,'DateTime',context!),
'start_version_number': start_version_number,
'end_version_number': end_version_number
};
getTypeName() => "CRMPaymentsResponse";
TypeContext? context = _ctx;
}
class CRMPaymentsRequest implements IConvertible
{
DateTime? from_date;
DateTime? to_date;
int? regent_id;
int? start_version_number;
int? end_version_number;
bool? recurring_only;
bool? completed_only;
CRMPaymentsRequest({this.from_date,this.to_date,this.regent_id,this.start_version_number,this.end_version_number,this.recurring_only,this.completed_only});
CRMPaymentsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
from_date = JsonConverters.fromJson(json['from_date'],'DateTime',context!);
to_date = JsonConverters.fromJson(json['to_date'],'DateTime',context!);
regent_id = json['regent_id'];
start_version_number = json['start_version_number'];
end_version_number = json['end_version_number'];
recurring_only = json['recurring_only'];
completed_only = json['completed_only'];
return this;
}
Map<String, dynamic> toJson() => {
'from_date': JsonConverters.toJson(from_date,'DateTime',context!),
'to_date': JsonConverters.toJson(to_date,'DateTime',context!),
'regent_id': regent_id,
'start_version_number': start_version_number,
'end_version_number': end_version_number,
'recurring_only': recurring_only,
'completed_only': completed_only
};
getTypeName() => "CRMPaymentsRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'data.regent_college.edu', types: <String, TypeInfo> {
'CRMPaymentResponse': TypeInfo(TypeOf.Class, create:() => CRMPaymentResponse()),
'CRMPaymentsResponse': TypeInfo(TypeOf.Class, create:() => CRMPaymentsResponse()),
'List<CRMPaymentResponse>': TypeInfo(TypeOf.Class, create:() => <CRMPaymentResponse>[]),
'CRMPaymentsRequest': TypeInfo(TypeOf.Class, create:() => CRMPaymentsRequest()),
});
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 /DynamicsCRM/Payments HTTP/1.1
Host: data.regent-college.edu
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
from_date: 0001-01-01,
to_date: 0001-01-01,
regent_id: 0,
start_version_number: 0,
end_version_number: 0,
recurring_only: False,
completed_only: False
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } }, payments: [ { regent_id: 0, contact_addressee: String, donor_first_name: String, donor_last_name: String, donor_addressee: String, donor_city: String, donor_country: String, donor_owner_full_name: String, is_contact: False, is_account: False, soft_credit_regent_id: 0, soft_credit_contact_addressee: String, soft_credit_contact_first_name: String, soft_credit_contact_last_name: String, soft_credit_contact_spouse_is_main_contact: False, soft_credit_contact_city: String, soft_credit_contact_country: String, soft_credit_contact_owner_full_name: String, soft_credit_second_regent_id: 0, soft_credit_second_contact_addressee: String, soft_credit_second_contact_first_name: String, soft_credit_second_contact_last_name: String, soft_credit_second_contact_spouse_is_main_contact: False, soft_credit_second_contact_city: String, soft_credit_second_contact_country: String, soft_credit_second_contact_owner_full_name: String, spouse_is_main_contact: False, import_id: 0, donation_id: String, payment_id: String, guid: String, name: String, description: String, appeal_code: String, designation: String, designation_description: String, general_ledger_account_number: String, campaign: String, total_pledge_amount: 0, total_paid_amount: 0, amount: 0, canadian_amount: 0, payment_exchange_rate: 0, receipt_amount: 0, gift_exchange_rate: 0, total_paid_canadian_amount: 0, is_recurring: False, is_complete: False, is_parent_donation: False, currency: String, source: String, channel: String, receipting_organization: String, type: String, push_to_gp: False, finance_entry_date: 0001-01-01, finance_id: String, acknowledgment_sent: False, send_acknowledgment: False, acknowledgment_template_guid: String, parent_guid: String, anonymous: False, gift_date: 0001-01-01, recurring_gift_start_date: 0001-01-01, recurring_gift_end_date: 0001-01-01, payment_date: 0001-01-01, tax_receipt: String, tax_receipt_date_sent: 0001-01-01, cheque_number: String, version_number: 0, added_date: 0001-01-01 } ], from_date: 0001-01-01, to_date: 0001-01-01, start_version_number: 0, end_version_number: 0 }