CreateGift API returning "500 Internal Server Error" for Custom Fields with type CodeTableEntry

Hello,

We are getting a “500 Internal Server Error” when attempting to create a Gift with a Custom Field with type CodeTableEntry for an existing Constituent. Note: we are able to create a Gifts with Custom Fields of all other types (Text, Boolean, etc) as expected.

We're wondering if the issue is on BB's side or if our syntax for CodeTableEntry Custom Fields might be incorrect.

In the example below, our Custom Field: “Are you a member?” is a CodeTableEntry with the following values:

Request URL
https://api.sky.blackbaud.com/gift/v1/gifts/customfields/categories/values?category_name=Are you a member?

Response

{
"count": 3,
"value": ["No thanks", "Not yet; I'd like to become a member", "Yes, I'm already a member."]
}

In the create Gift API request below, we pass “No thanks” as the Custom Field value. Which results in a 500 Internal Server Error.

Request

POST https://api.sky.blackbaud.com/gift/v1/gifts HTTP/1.1
Host: api.sky.blackbaud.com
Content-Type: application/json
Bb-Api-Subscription-Key: ••••
Authorization: ••••

{
"amount": {
"value": 5
},
"gift_splits": [
{
"amount": {
"value": 5
},
"fund_id": "21"
}
],
"type": "Donation",
"payments": [
{
"payment_method": "CreditCard"
}
],
"custom_fields": [
{
"category": "Are you a member?",
"value": "No thanks"
}
],
"constituent_id": "330387"
}

Note 2: When we use RE NXT Web View, extract the option value from the Add Gift form, and pass that as the “Are you a member?” Custom Field value, we are able to successfully Add the Gift via the API, but we do not see a way of obtaining this value via API. Repeating the above Add Gift request with the custom fields edited below example works as expected:

"custom_fields": [
{
"category": "Are you a member?",
"value": "73466"
}
]

1b6aa865e6f15a65ad347c84c7efbb6b-huge-sc

Thank you,

Aaron

Comments

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 Facilitator 3 bbcon 2025 Attendee Badge

    @Aaron Colon
    I just gave it a try and what you seeing seems to be the behavior.

    On the POST endpoint for Create Gift, the custom fields property when specifying a custom field of type table entry, it requires you to provide the table entries ID in order to create the custom field.

    However, when you use the POST endpoint for create custom field direct on a gift that's already created, you can specify the “text” of the table entry instead of the table entry ID. (so if you do not want to find out the table entry ID, you can create the gift first, THEN call the create gift custom field endpoint to create the custom field.

    IF you want to avoid having to make 2nd call, you can actually find out the table entry ID, you will need use to a few endpoint calls to find out:

    Use:

    to see ALL code tables, and locate the code tables that holds the values for your custom field category.

    Then use

    and provide the code_tableid to get all table entries for this code table, and you will find the table_entries_id for the text value you need.

    280f345c3f704eb008af15ba8ded4772-huge-im
  • @Aaron Colon @Alex Wong

    I also have this problem on Modifying/Deleting lists in the API. It requires the List Id which I cannot seem to locate programmatically.

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 Facilitator 3 bbcon 2025 Attendee Badge

    @Bob Rowe
    You can get the ID from this endpoint:

  • Diane Ellis
    Diane Ellis Blackbaud Employee
    Tenth Anniversary Kudos 1 Name Dropper Participant

    @Aaron Colon
    We tested this and found that if you change “value” to “description” you can add the desired code table entry for the Custom Field. This isn't super clear in the documentation but is sort of there. This would allow you to add it without needing the Table Entry ID.

    cbc02a1bfb38c448f9363ce1adceeaa8-huge-im
  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 Facilitator 3 bbcon 2025 Attendee Badge

    @Diane Ellis
    I gave it a try, but it is not working for me, which endpoint did you try and what is your JSON request body looks like, mind looks like this and while the gift is created and the custom field is added, the value is blank (and I confirmed the string I passed in is one of the table entry value).

    543825e70b939e6e5e27910f5ee37315-huge-im
    da93b98677e14bc4895563c1e095955e-huge-im
    439440988ede4fe2e777afcc97910c47-huge-im
    1f710aaa8d008b567b307fdf002af4d5-huge-im
    c5ed37b91c4bbeb4bbee0575b44deba8-huge-im
  • Diane Ellis
    Diane Ellis Blackbaud Employee
    Tenth Anniversary Kudos 1 Name Dropper Participant

    @Alex Wong Sorry about that. Upon checking further, we found that Post Gift never populated an existing or new table entry when using Value or Description. You can change Value to Description if the table entry exists already and no longer receive an Error, but the Custom Field Description also does not populate on the gift record either despite the response of success. We're filing a defect for the behavior from the Support side of this.

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 Facilitator 3 bbcon 2025 Attendee Badge

    @Diane Ellis
    I am using an existing table entry, “Online Express” as my screenshot shows when at the gift record, edit the custom field shows the selection. description doesn't seems to be a property that can be used (it was not documented that way in SKY API anyway), it is value with the table entries id. the API Call doesn't seems to complaint about an “extranous” property being passed it and just ignores it.

  • Thank you very much, @Alex Wong and @Diane Ellis.

    I have also confirmed with BB support that IDs are required on the CreateGift endpoint for Custom Fields of type CodeTableEntry.

    I have requested that BB:

    1. Update the SKY API documentation to reflect the required use of IDs for CodeTableEntries.
    2. Update the SKY API to support using CodeTableEntry Descriptions or IDs.

    Best,
    Aaron