Back to Collection Items
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
DECLARE @hr int
DECLARE @iTmp0 int
-- Important: Do not use nvarchar(max). See the warning about using nvarchar(max).
DECLARE @sTmp0 nvarchar(4000)
-- This example assumes the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
DECLARE @http int
-- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
IF @hr <> 0
BEGIN
PRINT 'Failed to create ActiveX component'
RETURN
END
DECLARE @success int
-- Use this online tool to generate code from sample JSON: Generate Code to Create JSON
-- The following JSON is sent in the request body.
-- {
-- "amount": 150.25,
-- "transactionPeriod": "monthly",
-- "transactionInterval": 3,
-- "transactionDay": "5",
-- "startDate": "2024-07-06",
-- "endDate": "2024-07-06",
-- "campaign": {
-- "id": "<CAMPAIGN_ID>"
-- },
-- "outreachSourceCode": {
-- "id": "<SOURCE_CODE_ID>",
-- "sourceCode": "AnimalEmailCampaign2023"
-- },
-- "donor": {
-- "donorType": "individual",
-- "organizationName": "mini cat town",
-- "firstName": "David",
-- "lastName": "Taylor",
-- "phone": "510-434-8920",
-- "email": "davidtaylor@salesforce.com",
-- "address": [
-- {
-- "addressType": "mailing",
-- "street": "123 Main Street",
-- "city": "Oakland",
-- "state": "CA",
-- "postalCode": "94610",
-- "country": "US"
-- }
-- ],
-- "accountCustomFields": [
-- {
-- "fieldName": "string",
-- "fieldValue": "string"
-- }
-- ]
-- },
-- "paymentInstrument": {
-- "type": "credit card",
-- "accountHolderName": "david taylor",
-- "expiryMonth": "10",
-- "expiryYear": "2026",
-- "last4": "4585",
-- "cardBrand": "visa",
-- "bankName": "chase",
-- "digitalWalletProvider": "apple pay",
-- "bankAccountHolderType": "primary",
-- "bankAccountType": "checking",
-- "bankAccountNumber": "123456",
-- "bankCode": "HBUK",
-- "gatewayName": "stripe",
-- "processorName": "classy",
-- "processorPaymentReference": "string",
-- "gatewayReference": "string"
-- },
-- "giftCommitmentCustomFields": [
-- {
-- "fieldName": "string",
-- "fieldValue": "string"
-- }
-- ],
-- "giftCommitmentScheduleCustomFields": [
-- {
-- "fieldName": "string",
-- "fieldValue": "string"
-- }
-- ]
-- }
DECLARE @json int
-- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @json OUT
EXEC sp_OAMethod @json, 'UpdateNumber', @success OUT, 'amount', '150.25'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'transactionPeriod', 'monthly'
EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'transactionInterval', 3
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'transactionDay', '5'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'startDate', '2024-07-06'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'endDate', '2024-07-06'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'campaign.id', '<CAMPAIGN_ID>'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'outreachSourceCode.id', '<SOURCE_CODE_ID>'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'outreachSourceCode.sourceCode', 'AnimalEmailCampaign2023'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'donor.donorType', 'individual'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'donor.organizationName', 'mini cat town'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'donor.firstName', 'David'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'donor.lastName', 'Taylor'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'donor.phone', '510-434-8920'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'donor.email', 'davidtaylor@salesforce.com'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'donor.address[0].addressType', 'mailing'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'donor.address[0].street', '123 Main Street'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'donor.address[0].city', 'Oakland'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'donor.address[0].state', 'CA'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'donor.address[0].postalCode', '94610'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'donor.address[0].country', 'US'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'donor.accountCustomFields[0].fieldName', 'string'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'donor.accountCustomFields[0].fieldValue', 'string'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.type', 'credit card'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.accountHolderName', 'david taylor'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.expiryMonth', '10'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.expiryYear', '2026'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.last4', '4585'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.cardBrand', 'visa'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.bankName', 'chase'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.digitalWalletProvider', 'apple pay'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.bankAccountHolderType', 'primary'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.bankAccountType', 'checking'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.bankAccountNumber', '123456'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.bankCode', 'HBUK'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.gatewayName', 'stripe'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.processorName', 'classy'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.processorPaymentReference', 'string'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'paymentInstrument.gatewayReference', 'string'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'giftCommitmentCustomFields[0].fieldName', 'string'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'giftCommitmentCustomFields[0].fieldValue', 'string'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'giftCommitmentScheduleCustomFields[0].fieldName', 'string'
EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'giftCommitmentScheduleCustomFields[0].fieldValue', 'string'
-- Adds the "Authorization: Bearer <access_token>" header.
EXEC sp_OASetProperty @http, 'AuthToken', '<access_token>'
DECLARE @sbRequestBody int
-- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbRequestBody OUT
EXEC sp_OAMethod @json, 'EmitSb', @success OUT, @sbRequestBody
DECLARE @resp int
EXEC sp_OAMethod @http, 'PTextSb', @resp OUT, 'PATCH', 'https://domain.com/services/data/v{{version}}/connect/fundraising/commitments/:commitmentId', @sbRequestBody, 'utf-8', 'application/json', 0, 0
EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT
IF @iTmp0 = 0
BEGIN
EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @json
EXEC @hr = sp_OADestroy @sbRequestBody
RETURN
END
DECLARE @sbResponseBody int
-- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT
EXEC sp_OAMethod @resp, 'GetBodySb', @success OUT, @sbResponseBody
DECLARE @jResp int
-- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jResp OUT
EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody
EXEC sp_OASetProperty @jResp, 'EmitCompact', 0
PRINT 'Response Body:'
EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT
PRINT @sTmp0
DECLARE @respStatusCode int
EXEC sp_OAGetProperty @resp, 'StatusCode', @respStatusCode OUT
PRINT 'Response Status Code = ' + @respStatusCode
IF @respStatusCode >= 400
BEGIN
PRINT 'Response Header:'
EXEC sp_OAGetProperty @resp, 'Header', @sTmp0 OUT
PRINT @sTmp0
PRINT 'Failed.'
EXEC @hr = sp_OADestroy @resp
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @json
EXEC @hr = sp_OADestroy @sbRequestBody
EXEC @hr = sp_OADestroy @sbResponseBody
EXEC @hr = sp_OADestroy @jResp
RETURN
END
EXEC @hr = sp_OADestroy @resp
-- Sample JSON response:
-- (Sample code for parsing the JSON response is shown below)
-- {
-- "success": true,
-- "links": {
-- "giftcommitment": {
-- "href": "/services/data/vXX.X/sobjects/sObject/<SFDC_GIFT_COMMITMENT_ID>",
-- "id": "<SFDC_GIFT_COMMITMENT_ID>"
-- },
-- "giftcommitmentschedule": {
-- "href": "/services/data/vXX.X/sobjects/sObject/<SFDC_GIFT_COMMITMENT_SCHEDULE_ID>",
-- "id": "<SFDC_GIFT_COMMITMENT_SCHEDULE_ID>"
-- }
-- }
-- }
-- Sample code for parsing the JSON response...
-- Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
DECLARE @success int
EXEC sp_OAMethod @jResp, 'BoolOf', @success OUT, 'success'
DECLARE @Href nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Href OUT, 'links.giftcommitment.href'
DECLARE @Id nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Id OUT, 'links.giftcommitment.id'
DECLARE @GiftcommitmentscheduleHref nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @GiftcommitmentscheduleHref OUT, 'links.giftcommitmentschedule.href'
DECLARE @GiftcommitmentscheduleId nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @GiftcommitmentscheduleId OUT, 'links.giftcommitmentschedule.id'
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @json
EXEC @hr = sp_OADestroy @sbRequestBody
EXEC @hr = sp_OADestroy @sbResponseBody
EXEC @hr = sp_OADestroy @jResp
END
GO
Curl Command
curl -X PATCH
-H "Authorization: Bearer <access_token>"
-d '{
"amount": 150.25,
"transactionPeriod": "monthly",
"transactionInterval": 3,
"transactionDay": "5",
"startDate": "2024-07-06",
"endDate": "2024-07-06",
"campaign": {
"id": "<CAMPAIGN_ID>"
},
"outreachSourceCode": {
"id": "<SOURCE_CODE_ID>",
"sourceCode": "AnimalEmailCampaign2023"
},
"donor": {
"donorType": "individual",
"organizationName": "mini cat town",
"firstName": "David",
"lastName": "Taylor",
"phone": "510-434-8920",
"email": "davidtaylor@salesforce.com",
"address": [
{
"addressType": "mailing",
"street": "123 Main Street",
"city": "Oakland",
"state": "CA",
"postalCode": "94610",
"country": "US"
}
],
"accountCustomFields": [
{
"fieldName": "string",
"fieldValue": "string"
}
]
},
"paymentInstrument": {
"type": "credit card",
"accountHolderName": "david taylor",
"expiryMonth": "10",
"expiryYear": "2026",
"last4": "4585",
"cardBrand": "visa",
"bankName": "chase",
"digitalWalletProvider": "apple pay",
"bankAccountHolderType": "primary",
"bankAccountType": "checking",
"bankAccountNumber": "123456",
"bankCode": "HBUK",
"gatewayName": "stripe",
"processorName": "classy",
"processorPaymentReference": "string",
"gatewayReference": "string"
},
"giftCommitmentCustomFields": [
{
"fieldName": "string",
"fieldValue": "string"
}
],
"giftCommitmentScheduleCustomFields": [
{
"fieldName": "string",
"fieldValue": "string"
}
]
}'
https://domain.com/services/data/v{{version}}/connect/fundraising/commitments/:commitmentId
Postman Collection Item JSON
{
"name": "Update Commitments",
"request": {
"method": "PATCH",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n\"amount\": 150.25,\n \"transactionPeriod\": \"monthly\",\n \"transactionInterval\": 3,\n \"transactionDay\": \"5\",\n \"startDate\": \"2024-07-06\",\n \"endDate\": \"2024-07-06\",\n \"campaign\": {\n \"id\": \"<CAMPAIGN_ID>\"\n },\n \"outreachSourceCode\": {\n \"id\": \"<SOURCE_CODE_ID>\",\n \"sourceCode\": \"AnimalEmailCampaign2023\"\n },\n \"donor\": {\n \"donorType\": \"individual\",\n \"organizationName\": \"mini cat town\",\n \"firstName\": \"David\",\n \"lastName\": \"Taylor\",\n \"phone\": \"510-434-8920\",\n \"email\": \"davidtaylor@salesforce.com\",\n \"address\": [\n {\n \"addressType\": \"mailing\",\n \"street\": \"123 Main Street\",\n \"city\": \"Oakland\",\n \"state\": \"CA\",\n \"postalCode\": \"94610\",\n \"country\": \"US\"\n }\n ],\n \"accountCustomFields\": [\n {\n \"fieldName\": \"string\",\n \"fieldValue\": \"string\"\n }\n ]\n },\n \"paymentInstrument\": {\n \"type\": \"credit card\",\n \"accountHolderName\": \"david taylor\",\n \"expiryMonth\": \"10\",\n \"expiryYear\": \"2026\",\n \"last4\": \"4585\",\n \"cardBrand\": \"visa\",\n \"bankName\": \"chase\",\n \"digitalWalletProvider\": \"apple pay\",\n \"bankAccountHolderType\": \"primary\",\n \"bankAccountType\": \"checking\",\n \"bankAccountNumber\": \"123456\",\n \"bankCode\": \"HBUK\",\n \"gatewayName\": \"stripe\",\n \"processorName\": \"classy\",\n \"processorPaymentReference\": \"string\",\n \"gatewayReference\": \"string\"\n },\n \"giftCommitmentCustomFields\": [\n {\n \"fieldName\": \"string\",\n \"fieldValue\": \"string\"\n }\n ],\n \"giftCommitmentScheduleCustomFields\": [\n {\n \"fieldName\": \"string\",\n \"fieldValue\": \"string\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/connect/fundraising/commitments/:commitmentId",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"connect",
"fundraising",
"commitments",
":commitmentId"
],
"variable": [
{
"key": "commitmentId",
"value": ""
}
]
},
"description": "Modify the schedule or payment instrument metadata on an existing active gift commitment.\n\n## Required Attributes:\n\n- {commitmentId}\n \n- amount\n \n- transactionPeriod (Monthly, Weekly, Yearly, etc.)\n \n- startDate\n \n- paymentInstrument.type\n \n\nAll 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:\n\n- CustomFields collections - These cannot be left in the request body as an empty collection or with an empty string for the FieldName.\n \n\n## Validated Property Formats (an empty string is considered valid)\n\n- DateTime - YYYY-MM-DDTHH:MM:SSZ\n \n- Date - YYYY-MM-DD\n \n- Email - a valid formatted email address\n \n\n### Other Attributes\n\n- OutreachSource -- This is optional. Be sure to create the OutreachSourceCode record in the system if passing a value\n \n- Will accept either an OutreachSourceCode.id (SalesforceId) or an OutreachSourceCode.Code.\n \n\n### Custom Fields\n\n- The field_value can be a text string (inc. for a date data-type) or a numeric value (without quotes)\n \n- Do not include an empty collection or an empty fieldName in the request body"
},
"response": [
{
"name": "Status200-UpdateCommitmentSuccess",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n\"amount\": 150.25,\n \"transactionPeriod\": \"monthly\",\n \"transactionInterval\": 3,\n \"transactionDay\": \"5\",\n \"startDate\": \"2024-07-06\",\n \"endDate\": \"2024-07-06\",\n \"campaign\": {\n \"id\": \"<CAMPAIGN_ID>\"\n },\n \"outreachSourceCode\": {\n \"id\": \"<SOURCE_CODE_ID>\",\n \"sourceCode\": \"AnimalEmailCampaign2023\"\n },\n \"donor\": {\n \"donorType\": \"individual\",\n \"organizationName\": \"mini cat town\",\n \"firstName\": \"David\",\n \"lastName\": \"Taylor\",\n \"phone\": \"510-434-8920\",\n \"email\": \"davidtaylor@salesforce.com\",\n \"address\": [\n {\n \"addressType\": \"mailing\",\n \"street\": \"123 Main Street\",\n \"city\": \"Oakland\",\n \"state\": \"CA\",\n \"postalCode\": \"94610\",\n \"country\": \"US\"\n }\n ],\n \"accountCustomFields\": [\n {\n \"fieldName\": \"string\",\n \"fieldValue\": \"string\"\n }\n ]\n },\n \"paymentInstrument\": {\n \"type\": \"credit card\",\n \"accountHolderName\": \"david taylor\",\n \"expiryMonth\": \"10\",\n \"expiryYear\": \"2026\",\n \"last4\": \"4585\",\n \"cardBrand\": \"visa\",\n \"bankName\": \"chase\",\n \"digitalWalletProvider\": \"apple pay\",\n \"bankAccountHolderType\": \"primary\",\n \"bankAccountType\": \"checking\",\n \"bankAccountNumber\": \"123456\",\n \"bankCode\": \"HBUK\",\n \"gatewayName\": \"stripe\",\n \"processorName\": \"classy\",\n \"processorPaymentReference\": \"string\",\n \"gatewayReference\": \"string\"\n },\n \"giftCommitmentCustomFields\": [\n {\n \"fieldName\": \"string\",\n \"fieldValue\": \"string\"\n }\n ],\n \"giftCommitmentScheduleCustomFields\": [\n {\n \"fieldName\": \"string\",\n \"fieldValue\": \"string\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/connect/fundraising/commitments/:commitmentId",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"connect",
"fundraising",
"commitments",
":commitmentId"
],
"variable": [
{
"key": "commitmentId",
"value": ""
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": ""
}
],
"cookie": [
],
"body": "{\n \"success\": true,\n \"links\": {\n \"giftcommitment\": {\n \"href\": \"/services/data/vXX.X/sobjects/sObject/<SFDC_GIFT_COMMITMENT_ID>\",\n \"id\": \"<SFDC_GIFT_COMMITMENT_ID>\"\n },\n \"giftcommitmentschedule\": {\n \"href\": \"/services/data/vXX.X/sobjects/sObject/<SFDC_GIFT_COMMITMENT_SCHEDULE_ID>\",\n \"id\": \"<SFDC_GIFT_COMMITMENT_SCHEDULE_ID>\"\n }\n }\n}"
},
{
"name": "Status200-UpdateCommitmentRequestValidationFailure",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"amount\": 150.25,\n \"transactionPeriod\": \"monthly\",\n \"transactionInterval\": 3,\n \"transactionDay\": \"5\",\n \"startDate\": \"2024-07-06\",\n \"endDate\": \"2024-07-06\",\n \"campaign\": {\n \"id\": \"<SFDC_CAMPAIGN_ID>\"\n },\n \"outreachSourceCode\": {\n \"sourceCode\": \"AnimalEmailCampaign2023\"\n },\n \"paymentInstrument\": {\n \"type\": \"credit card\",\n \"accountHolderName\": \"test donor\",\n \"expiryMonth\": \"10\",\n \"expiryYear\": \"2026\",\n \"last4\": \"4585\",\n \"cardBrand\": \"visa\",\n \"bankName\": \"chase\",\n \"digitalWalletProvider\": \"apple pay\",\n \"bankAccountHolderType\": \"primary\",\n \"bankAccountType\": \"checking\",\n \"bankAccountNumber\": \"123456\",\n \"bankCode\": \"HBUK\",\n \"gatewayName\": \"stripe\",\n \"processorName\": \"test processor\",\n \"processorPaymentReference\": \"string\",\n \"gatewayReference\": \"string\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/connect/fundraising/commitments/:commitmentId",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"connect",
"fundraising",
"commitments",
":commitmentId"
],
"variable": [
{
"key": "commitmentId",
"value": ""
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": ""
}
],
"cookie": [
],
"body": "{\n \"errors\": [\n {\n \"field\": \"donor.id\",\n \"message\": \"You cant include the donor ID in the request for the Gift Commitment Patch endpoint. Remove the ID from the Donor JSON request and try again.\"\n }\n ],\n \"success\": false\n}"
},
{
"name": "Status200-UpdateCommitmentDatabaseFailure",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"amount\": 150.25,\n \"transactionPeriod\": \"tomorrow\",\n \"transactionInterval\": 3,\n \"transactionDay\": \"5\",\n \"startDate\": \"2024-07-06\",\n \"endDate\": \"2024-07-06\",\n \"outreachSourceCode\": {\n \"sourceCode\": \"AnimalEmailCampaign2023\"\n },\n \"paymentInstrument\": {\n \"type\": \"credit card\",\n \"accountHolderName\": \"test donor\",\n \"expiryMonth\": \"10\",\n \"expiryYear\": \"2026\",\n \"last4\": \"4585\",\n \"cardBrand\": \"visa\",\n \"bankName\": \"chase\",\n \"digitalWalletProvider\": \"apple pay\",\n \"bankAccountHolderType\": \"primary\",\n \"bankAccountType\": \"checking\",\n \"bankAccountNumber\": \"123456\",\n \"bankCode\": \"HBUK\",\n \"gatewayName\": \"stripe\",\n \"processorName\": \"test processor\",\n \"processorPaymentReference\": \"string\",\n \"gatewayReference\": \"string\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/connect/fundraising/commitments/:commitmentId",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"connect",
"fundraising",
"commitments",
":commitmentId"
],
"variable": [
{
"key": "commitmentId",
"value": ""
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": ""
}
],
"cookie": [
],
"body": "{\n \"errors\": [\n {\n \"message\": \"Transaction Period: bad value for restricted picklist field: tomorrow\"\n }\n ],\n \"success\": false\n}"
},
{
"name": "Status200-UpdateCommitmentSuccessWithExternalIds",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n\"amount\": 150.25,\n \"transactionPeriod\": \"monthly\",\n \"transactionInterval\": 3,\n \"transactionDay\": \"5\",\n \"startDate\": \"2024-07-06\",\n \"endDate\": \"2024-07-06\",\n \"campaign\": {\n \"externalId\": {\n \"fieldName\": \"<EXTERNAL_ID_FIELD_NAME>\",\n \"fieldValue\": \"<EXTERNAL_ID_FIELD_VALUE>\"\n }\n },\n \"outreachSourceCode\": {\n \"id\": \"<SOURCE_CODE_ID>\",\n \"sourceCode\": \"AnimalEmailCampaign2023\"\n },\n \"donor\": {\n \"donorType\": \"individual\",\n \"organizationName\": \"ABC Inc.\",\n \"firstName\": \"David\",\n \"lastName\": \"Chavez\",\n \"phone\": \"510-434-8920\",\n \"email\": \"d.chavez@salesforce.com\",\n \"address\": [\n {\n \"addressType\": \"mailing\",\n \"street\": \"123 Main Street\",\n \"city\": \"Oakland\",\n \"state\": \"CA\",\n \"postalCode\": \"94610\",\n \"country\": \"US\"\n }\n ],\n \"accountCustomFields\": [\n {\n \"fieldName\": \"string\",\n \"fieldValue\": \"string\"\n }\n ]\n },\n \"paymentInstrument\": {\n \"type\": \"credit card\",\n \"accountHolderName\": \"david chavez\",\n \"expiryMonth\": \"10\",\n \"expiryYear\": \"2026\",\n \"last4\": \"4585\",\n \"cardBrand\": \"visa\",\n \"bankName\": \"chase\",\n \"digitalWalletProvider\": \"apple pay\",\n \"bankAccountHolderType\": \"primary\",\n \"bankAccountType\": \"checking\",\n \"bankAccountNumber\": \"123456\",\n \"bankCode\": \"HBUK\",\n \"gatewayName\": \"stripe\",\n \"processorName\": \"classy\",\n \"processorPaymentReference\": \"string\",\n \"gatewayReference\": \"string\"\n },\n \"giftCommitmentCustomFields\": [\n {\n \"fieldName\": \"string\",\n \"fieldValue\": \"string\"\n }\n ],\n \"giftCommitmentScheduleCustomFields\": [\n {\n \"fieldName\": \"string\",\n \"fieldValue\": \"string\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/connect/fundraising/commitments/{fieldValue}?externalIdField={fieldName}",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"connect",
"fundraising",
"commitments",
"{fieldValue}"
],
"query": [
{
"key": "externalIdField",
"value": "{fieldName}"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": ""
}
],
"cookie": [
],
"body": "{\n \"success\": true,\n \"links\": {\n \"giftcommitment\": {\n \"href\": \"/services/data/vXX.X/sobjects/sObject/<SFDC_GIFT_COMMITMENT_ID>\",\n \"id\": \"<SFDC_GIFT_COMMITMENT_ID>\"\n },\n \"giftcommitmentschedule\": {\n \"href\": \"/services/data/vXX.X/sobjects/sObject/<SFDC_GIFT_COMMITMENT_SCHEDULE_ID>\",\n \"id\": \"<SFDC_GIFT_COMMITMENT_SCHEDULE_ID>\"\n }\n }\n}"
},
{
"name": "Status400-BadRequestError",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"amount\": 150.25,\n \"transactionPeriod\": \"monthly\",\n \"transactionInterval\": 3,\n \"transactionDay\": \"5\",\n \"startDate\": \"2024-07-06\",\n \"endDate\": \"2024-07-06\",\n \"outreachSourceCode\": {\n \"sourceCode\": \"AnimalEmailCampaign2023\"\n },\n \"paymentInstrument\": {\n \"type\": \"credit card\",\n \"accountHolderName\": \"test donor\",\n \"expiryMonth\": \"10\",\n \"expiryYear\": \"2026\",\n \"last4\": \"4585\",\n \"cardBrand\": \"visa\",\n \"bankName\": \"chase\",\n \"digitalWalletProvider\": \"apple pay\",\n \"bankAccountHolderType\": \"primary\",\n \"bankAccountType\": \"checking\",\n \"bankAccountNumber\": \"123456\",\n \"bankCode\": \"HBUK\",\n \"gatewayName\": \"stripe\",\n \"processorName\": \"test processor\",\n \"processorPaymentReference\": \"string\",\n \"gatewayReference\": \"string\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/connect/fundraising/commitments/:commitmentId",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"connect",
"fundraising",
"commitments",
":commitmentId"
],
"variable": [
{
"key": "commitmentId",
"value": ""
}
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": ""
}
],
"cookie": [
],
"body": " // Even if the JSON request is valid, this is an example of a 400 error code that will be returned if duplicate matching rules are not active. Any non 200 error code would have a similar response structure.\n {\n \"errorCode\": \"UNKNOWN_EXCEPTION\",\n \"message\": \"Provide active duplicate matching rules on Account and Person Account for donor matching. -- industries.fundraisingops.connect.impl.validator.ValidatorUtil.validateMatchingMethod(ValidatorUtil.java:103)\"\n }"
}
]
}