Skip to main content
Skip table of contents

External Gift API Reference

Overview

This document provides an overview of the External Gift API endpoint for importing single gifts into iMIS.

The External Gift API endpoint is a REST/JSON-based API endpoint.

Authentication

Authentication uses a pre-shared, static Bearer token.

Pass the token as a static Authorization Bearer token:

Authorization: Bearer TOKEN_VALUE_HERE

Rate Limits

While there are no explicit rate limits in place on the API, please be aware that excessive calls can disrupt the client's server or environment.

As a general rule of thumb, it takes iMIS between 2 to 5 seconds to fully process a gift.

Therefore, avoid multiple concurrent requests. Process each request in sequence, not in parallel. If possible, implement a queue system to spread out requests.

Concepts / Terminology

  • Transaction ID – A generic numeric code value, not to exceed 16 characters, which uniquely identifies this transaction.

    • Note that this Transaction ID is shared amongst multiple potential third parties, so it is a best practice to prefix your transaction IDs or ensure they are otherwise globally unique.

  • Financial Account ID – This is an arbitrary ID that is used by CSiDonate to hold various financial settings and preferences.

    • CSI will provide this value to you on behalf of the client. Do not use any other value than the one provided. Do not use any value equal to or less than zero (0).

  • iMIS ID – A 10-character alphanumeric (but usually limited to numbers) value which uniquely identifies any contact record in iMIS (individual or company/group/chapter).

  • Distribution – Generally speaking, this is a way to identify a fund in iMIS. Distributions, in addition to pointing to funds, can also optionally contain a default appeal or campaign code. Conceptually, a distribution is synonymous with a fund.

  • Campaign – A code value indicating which fundraising campaign this donation should be tied to.

  • Appeal – A code value indicating which fundraising appeal this donation should be tied to.

Endpoints

See the Models section below for documentation regarding request and response bodies.

POST /api/v1/integrations/importGift

Inserts a gift to be imported at a later date.

Request Body: A single Gift Import Request JSON object.

Successful Response: 202 Accepted

GET /api/v1/integrations/distributions

Retrieves a list of valid distribution codes and descriptions.

Returns: A JSON array of Distribution objects.

Successful Response: 200 OK

GET /api/v1/integrations/appeals

Retrieves a list of valid appeal codes and descriptions.

Returns: A JSON array of Appeal objects.

Successful Response: 200 OK

GET /api/v1/integrations/campaigns

Retrieves a list of valid campaign codes and descriptions.

Returns: A JSON array of Campaign objects.

Successful Response: 200 OK

Responses

200 OK

200 OK indicates that the request was successful and, in some cases, the request body contains the requested information as a JSON response.

202 Accepted

202 Accepted response status indicates that your request was successfully received and recorded into the database for later processing.

400 Bad Request

400 Bad Request response status indicates that there was a preliminary validation error with the request body.

See the Message property on the response JSON object for a description of the validation error. Below are some examples of validation errors that can occur.

Description

Sample Response Body

transactionId Missing

{"Message":"Required field 'transactionId' is missing or negative."}

transactionId Is A Duplicate

{"Message":"Transaction ID XXXXXXXXX has already been imported. This request is a duplicate and will not be processed."}

amount Is Required

{"Message":"Amount must be greater than 0."}

amount Is Non-Numeric

{"Message":"Invalid request body (unable to deserialize model). Newtonsoft.Json.JsonReaderException: Could not convert string to decimal: X. Path 'amount', line 4, position 14."}

receivedDate Is Not A Date

{"Message":"Invalid request body (unable to deserialize model). Newtonsoft.Json.JsonReaderException: Could not convert string to DateTime: X. Path 'receivedDate', line 22, position 23."}

distribution Or campaignCode Is Required

{"Message":"Either a distribution code, or a (mapped) campaign code are required."}

financialAccountId Is Required

{"Message":"Financial Account ID is missing. Contact CSI if you are not sure what this value should be."}

Contact Information Is Required

{"Message":"First and last name, or Company name, or iMIS ID is required."}

401 Unauthorized

401 Unauthorized response status indicates that the Bearer token was missing or incorrect from the request.

{"Message":"Authorization has been denied for this request."}

405 Method Not Allowed

405 Method Not Allowed response is returned when the HTTP verb is not supported on the target URL. Typically this indicates a GET where a POST was required or vice versa.

{"Message":"The requested resource does not support http method 'POST'."}

500 Internal Server Error

This occurs if there was an error inserting the gift request into the database.

The request should be attempted again, or if the error persists, contact CSI for assistance.

Models

Gift Import Request

(tick) – Required
(warning) – Conditionally required depending on other fields

Important Note

Property names are case-sensitive.


Property

Type

Max Length

Required

Description

imisId

string

10

(warning)

iMIS ID. Required if first/last or company name is not provided.

amount

decimal


(tick)

Gift amount, in USD.

financialAccountId

integer


(tick)

The financial account ID to use for the financial settings for this transaction. Value is obtained from CSI during implementation. Sending the wrong value can lead to errors.

nameTitle

string

25


Name prefix or honorific.

firstName

string

20

(warning)

First name. Required if iMIS ID or company name is not provided.

middleName

string

20


Middle name.

maidenName

string

30


Maiden name.

lastName

string

30

(warning)

Last name. Required if iMIS ID or company name is not provided.

nameSuffix

string

10


Name suffix.

company

string

80

(warning)

Company name. Required if first/last or iMIS ID is not provided.

address

string

40


Address. For second and third lines, separate each with a space or a comma.

city

string

40


City name.

state

string

15


State or province (abbreviation).

zipCode

string

10


ZIP / Postal code.

emailAddress

string

100

(tick)

E-mail address.

phone

string

25


Phone number. Can be formatted with + ( ) -.

notes

string

255


Any notes, either internal or from the donor.

distribution

string

30

(warning)

Distribution code. Required if a mapped campaign code is not specified.

campaignCode

string

10

(warning)

Campaign code. Required and must be in the mapping if a distribution code is not specified.

appealCode

string

40


Appeal code.

softCreditId

string

10


The ID of another contact record in IMIS to apply a 100% soft credit to, for this gift.

receivedDate

string (datetime)



Received or transaction date.

transactionId

string

255

(tick)

Unique transaction ID. Duplicate transaction IDs will be rejected.

Business Rules

Contact Information

CSiDonate must match a gift to a contact record in iMIS.

If we are not able to find a match, or an explicit ID is not provided, CSiDonate will then create a new contact record in iMIS for this gift.

Therefore, you MUST provide any one of the following set of data:

  • iMIS ID

  • --OR--

  • First Name and Last Name

  • --OR--

  • Company Name (only used if this is a corporate gift / company check)

Transaction ID

The Transaction ID must be globally unique, that is, it must be unique to any other external financial system that may interact with iMIS.

It is best practice to use a randomly generated alphanumeric string for this value, with length of at least 8. This ensures sufficient random entropy to avoid a collision.

Avoid using auto-incrementing int values for this field, unless you are able to prefix the number with a unique identifier for your system.

Distribution / Fund

CSiDonate will use the provided Distribution Code as-is when writing the gift.

However, it is also possible to set up a mapping, for cases where the distribution code is otherwise not able to be sent over.

In this special case, the Campaign Code can be set up to be mapped to a desired Distribution Code within iMIS, without explicitly knowing the distribution code itself. When this feature is used, the Campaign Code is always blank when sent to iMIS – it is "consumed" during the mapping, and otherwise not able to be used.

See the Gen Tables page for information on how to set up the mapping.

The presence of the gen table determines if this feature is activated or not.

Example Gift Import Request JSON

JS
{
   "imisId": "",
   "amount": 12.34,
   "financialAccountId": 6,
   "nameTitle": "Mr.",
   "firstName": "Bob",
   "middleName": "A.",
   "maidenName": "Test",
   "lastName": "McTester",
   "nameSuffix": "T.S.T.R.",
   "company": "",
   "address": "123 Main Sr",
   "city": "Testertown",
   "state": "NY",
   "zipCode": "10001",
   "emailAddress": "bmctester@example.org",
   "phone": "(555) 555-1234",
   "notes": "",
   "distribution": "BMOC",
   "campaignCode": "",
   "appealCode": "IL",
   "receivedDate": "2018-12-01T08:45:32.847",
   "transactionId": "900000004"
}

Distributions

Property

Type

Description

Title

string

The display or friendly name of the distribution.

Code

string

The code value of the distribution. This is used in the gift import request.

AppealCode

string

Optional. The default appeal code that is assigned to this distribution.

CampaignCode

string

Optional. The default campaign code that is assigned to this distribution.


Example Distribution Response

CODE
[
  {
    "Title": "Alpha",
    "Code": "ALPHA",
    "AppealCode": "",
    "CampaignCode": ""
  },
  {
    "Title": "Alpha Gamma",
    "Code": "ALGA",
    "AppealCode": "",
    "CampaignCode": ""
  },
  ...
  {
    "Title": "Zeta Beta",
    "Code": "ZEBE",
    "AppealCode": "",
    "CampaignCode": ""
  }
}

Appeals

Property

Type

Description

Code

string

The code value of the appeal. This is used in the gift import request.

Description

string

The code value and friendly description concatenated with " - ".

Example Appeal Response

CODE
[
  {
    "Code": "100000",
    "Description": "100000 - Alpha"
  },
  {
    "Code": "100004",
    "Description": "100001 - Beta"
  },
  {
    "Code": "100003",
    "Description": "100002 - Delta"
  },
  ...
]

Campaigns

Property

Type

Description

Code

string

The code value of the campaign. This is used in the gift import request.

Description

string

The code value and friendly description concatenated with " - ".

Example Campaign Response

CODE
[
  {
    "Code": "5K_RUN_WALK",
    "Description": "5K_RUN_WALK - 5K Run/Walk"
  },
  {
    "Code": "SAFE",
    "Description": "SAFE - A Safe Place"
  },
  {
    "Code": "ACTS",
    "Description": "ACTS - Acts of Kindness Fund"
  },
  {
    "Code": "AARS",
    "Description": "AARS - Area Alumnae Recognition Scholarship"
  },
  ...
]


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.