Required role: | REGISUserRole |
POST | /DynamicsCRM/Payments |
---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CRMPaymentResponse:
regent_id: int = 0
contact_addressee: Optional[str] = None
donor_first_name: Optional[str] = None
donor_last_name: Optional[str] = None
donor_addressee: Optional[str] = None
donor_city: Optional[str] = None
donor_country: Optional[str] = None
donor_owner_full_name: Optional[str] = None
is_contact: bool = False
is_account: bool = False
soft_credit_regent_id: Optional[int] = None
soft_credit_contact_addressee: Optional[str] = None
soft_credit_contact_first_name: Optional[str] = None
soft_credit_contact_last_name: Optional[str] = None
soft_credit_contact_spouse_is_main_contact: bool = False
soft_credit_contact_city: Optional[str] = None
soft_credit_contact_country: Optional[str] = None
soft_credit_contact_owner_full_name: Optional[str] = None
soft_credit_second_regent_id: Optional[int] = None
soft_credit_second_contact_addressee: Optional[str] = None
soft_credit_second_contact_first_name: Optional[str] = None
soft_credit_second_contact_last_name: Optional[str] = None
soft_credit_second_contact_spouse_is_main_contact: bool = False
soft_credit_second_contact_city: Optional[str] = None
soft_credit_second_contact_country: Optional[str] = None
soft_credit_second_contact_owner_full_name: Optional[str] = None
spouse_is_main_contact: bool = False
import_id: Optional[int] = None
donation_id: Optional[str] = None
payment_id: Optional[str] = None
guid: Optional[str] = None
name: Optional[str] = None
description: Optional[str] = None
appeal_code: Optional[str] = None
designation: Optional[str] = None
designation_description: Optional[str] = None
general_ledger_account_number: Optional[str] = None
campaign: Optional[str] = None
total_pledge_amount: Decimal = decimal.Decimal(0)
total_paid_amount: Decimal = decimal.Decimal(0)
amount: Decimal = decimal.Decimal(0)
canadian_amount: Decimal = decimal.Decimal(0)
payment_exchange_rate: Decimal = decimal.Decimal(0)
receipt_amount: Decimal = decimal.Decimal(0)
gift_exchange_rate: Optional[Decimal] = None
total_paid_canadian_amount: Optional[Decimal] = None
is_recurring: bool = False
is_complete: bool = False
is_parent_donation: bool = False
currency: Optional[str] = None
source: Optional[str] = None
channel: Optional[str] = None
receipting_organization: Optional[str] = None
type: Optional[str] = None
push_to_gp: bool = False
finance_entry_date: Optional[datetime.datetime] = None
finance_id: Optional[str] = None
acknowledgment_sent: bool = False
send_acknowledgment: bool = False
acknowledgment_template_guid: Optional[str] = None
parent_guid: Optional[str] = None
anonymous: bool = False
gift_date: Optional[datetime.datetime] = None
recurring_gift_start_date: Optional[datetime.datetime] = None
recurring_gift_end_date: Optional[datetime.datetime] = None
payment_date: Optional[datetime.datetime] = None
tax_receipt: Optional[str] = None
tax_receipt_date_sent: Optional[datetime.datetime] = None
cheque_number: Optional[str] = None
version_number: int = 0
added_date: Optional[datetime.datetime] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CRMPaymentsResponse:
response_status: Optional[ResponseStatus] = None
payments: Optional[List[CRMPaymentResponse]] = None
from_date: Optional[datetime.datetime] = None
to_date: Optional[datetime.datetime] = None
start_version_number: Optional[int] = None
end_version_number: Optional[int] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CRMPaymentsRequest:
from_date: Optional[datetime.datetime] = None
to_date: Optional[datetime.datetime] = None
regent_id: Optional[int] = None
start_version_number: Optional[int] = None
end_version_number: Optional[int] = None
recurring_only: bool = False
completed_only: bool = False
Python CRMPaymentsRequest 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 /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 }