Create Commitments
POST {{_endpoint}}/services/data/v{{version}}/connect/fundraising/commitments
Create gift transactions with related new or matched donors, optional transaction designations, and payment instrument metadata. Supports custom fields for the donor account and gift transaction.
Required Attributes:
commitments.amount
commitments.transactionPeriod
commitments.startDate
donor.donorType (
individual
ororganization
)donor.lastName
donor.organization
paymentinstrument.type
All other attributes are optional can be left as an empty string or just removed from the request body entirely. The only exceptions to this are:
- CustomFields collections - These cannot be left in the request body as an empty collection or wit an empty string for the FieldName.
Validated Property Formats (an empty string is considered valid)
- DateTime - YYYY-MM-DDTHH:MM:SSZ
- Date - YYYY-MM-DD
- Email - a valid formatted email address
Other Attributes
- OutreachSource -- This is optional. Be sure to create the OutreachSourceCode record in the system if passing a value
- Will accept either an OutreachSourceCode.id (SalesforceId) or an OutreachSourceCode.Code.
Custom fields
- The field_value can be a text string (inc. for a date data-type) or a numeric value (without quotes)
- Do not include an empty collection or an empty fieldName in the request body
Request Body
{"processingOptions"=>{"donorOptions"=>{"defaultUpdateLogic"=>"update_all"}}, "commitments"=>[{"amount"=>150.25, "currencyIsoCode"=>"USD", "transactionPeriod"=>"monthly", "transactionInterval"=>3, "transactionDay"=>"5", "startDate"=>"2024-07-06", "endDate"=>"2024-08-06", "campaign"=>{"id"=>"<SFDC_CAMPAIGN_ID>"}, "outreachSourceCode"=>{"id"=>"<SFDC_OUTREACH_SOURCE_CODE_ID>", "sourceCode"=>"AnimalEmailCampaign2023"}, "donor"=>{"donorType"=>"individual", "id"=>"<SFDC_ACCOUNT_ID>", "firstName"=>"Test", "lastName"=>"Donor", "phone"=>"510-434-8920", "email"=>"test.donor@salesforce.com", "address"=>[{"addressType"=>"mailing", "street"=>"123 Main Street", "city"=>"Oakland", "state"=>"CA", "postalCode"=>"94610", "country"=>"US"}], "accountCustomFields"=>[{"fieldName"=>"<VALID_CUSTOM_FIELD_API_NAME>", "fieldValue"=>"string"}]}, "paymentInstrument"=>{"type"=>"credit card", "accountHolderName"=>"test donor", "expiryMonth"=>"10", "expiryYear"=>"2026", "last4"=>"4585", "cardBrand"=>"visa", "bankName"=>"chase", "digitalWalletProvider"=>"apple pay", "bankAccountHolderType"=>"primary", "bankAccountType"=>"checking", "bankAccountNumber"=>"123456", "bankCode"=>"HBUK", "gatewayName"=>"stripe", "processorName"=>"test processor", "processorPaymentReference"=>"string", "gatewayReference"=>"string"}, "designations"=>[{"designationId"=>"<SFDC_GIFT_DESIGNATION_ID>", "percent"=>10}], "firstTransaction"=>{"amount"=>150.25, "receivedDate"=>"2024-07-06", "donorCoverAmount"=>0.25, "transactionStatus"=>"Unpaid", "gatewayTransactionFee"=>0.75, "processorTransactionFee"=>0.45, "processorReference"=>"cls-1247586928747", "gatewayReference"=>"102656693ac3ca6e0cdafbfe89ab99", "lastGatewayResponseCode"=>"invalid_cvc", "lastGatewayErrorMessage"=>"The card’s security code is invalid. Check the card’s security code or use a different card.", "lastGatewayProcessedDateTime"=>"2023-07-06T21:57:51Z"}, "giftCommitmentCustomFields"=>[{"fieldName"=>"<VALID_CUSTOM_FIELD_API_NAME>", "fieldValue"=>"string"}], "giftCommitmentScheduleCustomFields"=>[{"fieldName"=>"<VALID_CUSTOM_FIELD_API_NAME>", "fieldValue"=>"string"}]}]}
RESPONSES
status: Created
{"successes":0,"failures":2,"notProcessed":1,"details":[{"success":false,"errors":{"message":"Amount must be greater than 10.00"}}]}