Gift API Error

When using the Gift API → Gift (Create) call, gift_splits is a required attribute, which takes a GiftSplitAdd array. Each object in a GiftSplitAdd array requires a fund_id attribute, which takes a String. All donations for the application that I am developing will go into the same fund (for example purposes we will call the fund ‘Gift Fund’). In the Raiser's Edge NXT database, the fund id column for Gift Fund is defined as ‘Gift Fund’, not a number. Since all donations go into one fund, I am storing the fund name as an environment variable called ‘FUND_ID’. When I build the request body, I define fund_id inside of the gift splits object using process.env.FUND_ID, and have verified that the variable is coming from the environment as the correct data and the correct datatype.

When I call the Gift api, it returns a 25001 error with the error message: "The provided id value ‘Gift Fund’ is not in the correct format. I am passing the fund id in as a string. What format is this error referring to? As far as I know, I am passing all required values and datatypes in the request body. Note: I've also tried passing this variable into the body directly as a string instead of calling the env variable.

Comments

  • @Kyle Lejeune
    the api is expecting the fund system id that is an integer. Yes, while the documentation expects “string”, it is not the “FUND ID" that is a string. so you need to go to your fund record in database view, and go to File > Property to get the system record id of the fund.

    then provide that into the gift splits array

    “fund_id”: “999999”

    where 999999 is the integer that is a system record id of the fund record

Categories