Error: The gift specified is not valid when posting participant fee

I have created a participant fee and now want to add the fee payment, maybe I'm misunderstanding the concept but:


I am sending:


{

"gift_id": "6",

"applied_amount": 20.00

}


To:

https://api.sky.blackbaud.com/event/v1/participants/15/feepayments


Error is:


{

"message": "The gift specified is not valid.",

"error_name": "CreateParticipantFeePaymentGiftNotValid",

"error_code": 1050,

"raw_message": "The gift specified is not valid."

}


My participant details:


{

"id": "15",

"contact_id": "66",

"date_added": "2021-05-26T10:24:57.023+01:00",

"date_modified": "2021-05-26T10:24:57.137+01:00",

"is_constituent": true,

"lookup_id": "57",

"name": "Lance Dennis",

"first_name": "Lance",

"middle_name": "",

"last_name": "Dennis",

"preferred_name": "",

"former_name": "",

"class_of": "",

"phone": "07544 447382",

"do_not_call": false,

"email": "puqoxivuqe@mailinator.com",

"do_not_email": false,

"attended": false,

"rsvp_status": "Attending",

"invitation_status": "Invited",

"rsvp_date": {

"d": 1,

"m": 1,

"y": 1999

},

"total_registration_fees": 20.0

}


My participant fees:


{

"count": 1,

"value": [

{

"id": "6",

"participant_id": "15",

"quantity": 1,

"fee_amount": 20.0,

"tax_receiptable_amount": 0.0,

"date": {

"d": 1,

"m": 1,

"y": 1999

},

"event_fee": {

"id": "5",

"name": "Single",

"event_id": "4",

"cost": 10.0,

"contribution_amount": 10.0,

"number_sold": 1

}

}

Comments

  • Samantha McGuin
    Samantha McGuin Blackbaud Employee
    Tenth Anniversary Kudos 5 Name Dropper Participant
    Hi Daniel,


    Sorry you're having trouble with this error. The fee payment establishes a link between a participant and a gift. You will encounter this error if the gift specified does not exist. Are you able to confirm that the gift was added using the Gift API or already exists?


    Let me know when you get a chance.


    Thanks!


    Samantha McGuin

    Principal Product Manager
  • Hi Samantha maybe I have my flow incorrect then as I'm just getting used to the API.


    I have an online form that registers a constituent for an event where they have also paid a registration fee.


    My code flow after the form is submitted using RE API is like this:

    1. Create Constituent

    2. If constituent successfully stored create participant

    3. If participant successfully stored create participant fee

    4. If participant fee successfully stored create participant fee payment

    5. If participant fee payment successfully stored store other event details on constituent attributes


    Up to number 3 works fine but I need to then store an actual payment I think against the fee (that they already paid online), so how would I do this please ?
  • Samantha McGuin
    Samantha McGuin Blackbaud Employee
    Tenth Anniversary Kudos 5 Name Dropper Participant
    Thanks for the additional detail!


    I believe that between your steps 3 & 4, you need to actually create the gift payment that was taken from your online form via the GIFT API. Then you can move on to your step 4, using the ID of the gift that was created, to store your participant fee payment which is a link between the participant and the gift that was created.


    Try that and see if that helps.


    --Samantha
  • Thanks Samantha that works a treat!

Categories