API - Mission Donations Follow
The missions donations api is a way to list and create donations inside Focus Missions. Donations can be debits or credits depending on the needs. Please note that currently there is no way through the Api to delete donations.
Listing Request
Below is an example request to list the donations for a specific mission trip where {missionid} is the mission ID for the donations to be searched. Please replace <TENANT_API_URL> with the url is that presented under the license key section for settings inside of Focus Missions. Refer to the authentication section of the document for instructions on how to find this url.
URL: https://<TENANT_API_URL>/1.0/missions/{missionid}/donations
Request Headers:
Authorization: Basic 239848923sdfhs93jsdf0u2h3
Content-Type: application/json
Host: 52projects.focusmissions.com
Host: 52projects.focusmissions.com
Response: HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.5
Set-Cookie: .ASPXANONYMOUS=XRdMygx5HU6ZEcf49Mbwdn_v3mnDtQ-HbxG-rPGqcJ0fIyriul33HaZmz_jSfGkCPYu6evUWvM9mDwUOoCiQKZseKAA5gTo_5wkvW9stpmMtz7SiEK6H_RRgc8ArQpTjU_oyIg2; expires=Thu, 30-Mar-2017 10:18:32 GMT; path=/; HttpOnly
X-Pagination:{"totalCount":96,"totalPages":5,"prevPageLink":"","nextPageLink":"https://52projects.focusmissions.com/api/1.0/missions?page=2&pageSize=20"}
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Thu, 19 Jan 2017 23:38:32 GMT
Content-Length: 70308
[
{
"id": 279939,
"mission": {
"id": 6071,
"name": "AFC Prague - Springbreak 2019"
},
"debitInCents": null,
"creditInCents": 900,
"donor": {
"personID": 254731,
"firstName": "John",
"lastName": "James",
"email": "cagutekunst+john@gmail.com",
"cellPhone": "5055959899",
"address": {
"line1": "123 Main St",
"line2": null,
"line3": null,
"line4": null,
"line5": null,
"city": "Dallas",
"province": "TX",
"postalCode": "77777",
"country": null
}
},
"donorName": "John James",
"donorEmail": "cagutekunst+john@gmail.com",
"donorCellPhone": "5055959899",
"donorAddress": {
"line1": "123 Main St",
"line2": null,
"line3": null,
"line4": null,
"line5": null,
"city": "Dallas",
"province": "TX",
"postalCode": "77777",
"country": null
},
"referenceNumber": "8351933",
"receivedDate": "2018-11-12T17:58:16.043",
"participantID": 43028,
"donationType": {
"id": 2,
"name": "Donated"
},
"donationState": {
"id": 1,
"name": "Active"
},
"allocationType": null,
"thanked": false,
"donorNameIsHidden": false,
"amountIsHidden": true,
"specialInstructions": null,
"externalIdentifier": 462729297
},
....
]
Below are some optional query string parameters that can be added to the request
Querystring Parameter | Data Type | Definition |
---|---|---|
updatedFrom | dateTime | Adds a filter to the request to only retrieve donations where the receivedDate is greater than the date provided. Date should be in UTC |
updatedTo | dateTime | Adds a filter to the request to only retrieve donations where the receivedDate is less than the date provided. Date should be in UTC |
Create Request
Below is an example request to list the donations for a specific mission trip where {missionid} is the mission ID for the donation to be created. Please replace <TENANT_API_URL> with the url is that presented under the license key section for settings inside of Focus Missions. Refer to the authentication section of the document for instructions on how to find this url.
URL: https://<TENANT_API_URL>/1.0/missions/{missionid}/donations
Request Headers:
Authorization: Basic 239848923sdfhs93jsdf0u2h3
Content-Type: application/json
Host: 52projects.gomethod.app
{
"id": 0,
"mission": {
"id": 3954,
"name": null
},
"debitInCents": null,
"creditInCents": 1000,
"donorName": "Winter Green",
"referenceNumber": "148794",
"receivedDate": "2018-03-23T19:45:30.87",
"participantID": 11685,
"donationType": {
"id": 6,
"name": null
},
"donationState": {
"id": 7,
"name": null
},
"allocationType": null,
"thanked": false,
"donorNameIsHidden": false,
"amountIsHidden": false,
"specialInstructions": null,
"externalIdentifier": null
}
Donation Types
Donation Type | Definition |
---|---|
donated = 2, selfdonated = 3, scheduleddonation = 4, initialpayment = 6, customallocation = 7 |
donated = when a payment is donated to the mission trip or the participant selfdonated = when a payment is made by the participant toe the participant scheduleddonation = when a payment is created because of a schedule initialpayment = when a payment is made and its the first payment for the participant customallocation = When the donation is associated to a custom allocation type |
Donation States
Donation State | Definitions |
---|---|
active = 1, pendingrefund = 2, refunded = 3, pendingcomplete = 6, failed = 7, removed = 8 |
active = When the donation is in an active state and visible pendingrefund = When a donation is a payment and a refund has been requested but is not complete yet. refunded = What a donation is a payment and the refund is completed pendingcomplete = When a payment is in a state of pending. Mainly happens for ACH transactions that have not been settled yet but are successful. failed = When a payment has failed removed = When a donation is of donation type custom allocation and the donation has been removed from the participant but not re allocated somewhere |