# How can I fix the error message “Could not find contribution record” from PayPal?

We have a new recurring contribution that isn't being entered into Civi. In the ConfigAndLog log I see "Could not find contribution record 20874". In the nginx logs I see that that number is being passed from PayPal as contributionID.

POST /sites/all/modules/civicrm/extern/ipn.php?reset=1&contactID=10132&contributionID=20874&module=contribute&contributionRecurID=25&contributionPageID=2 HTTP/1.1


Of course, that id is not in the contribution table. After looking at ones that worked it looks like the contributionID sent from PayPal is that of the first contribution of the recurring contributions.

Unfortunately, this error wasn't noticed right away so I can't see if there were any other errors when it was first created.

So can I just manually create a record in contributions with that id and have it work? What is it looking for in that record? (Well, I'd enter a payment for that person and change the id and anything else it is looking for.)

We don't want to have the person cancel the recurring and do it again. It's bad form to ask a donor to redo their payments. They might just cancel and not redo it.

## 1 Answer

You can create a fake initial payment on a recurring contribution and CiviCRM will handle the IPN properly. Unfortunately, this is a bit of a tedious process.

Fortunately, it's all documented on my PayPal and CiviCRM page. See the section called Modifying an IPN to reflect an updated CiviCRM contact ID. The scenario is a little different but the techniques are applicable here.

• Thank you. I tried to just update the contribution record the admin had manually put in but alas too many foreign key issues so in the end I just created new first transaction and made the transaction_id be that which PayPal was sending. That worked. Yea. – Paul-Tahoe Jul 18 '17 at 22:53
• Yes, I should have been explicit that this is the preferred route. Hopefully the docs were helpful for you in that! – Jon G - Megaphone Tech Jul 19 '17 at 14:41
• The document was very helpful. Saved me a work. I was also interested the change the id's PayPal is sending particularly the contact_id but alas either they've changed it or we don't have the right type of account. I could go to the page you mention but no modify button. A change button but even examining it I didn't find where I could change say the contact id. (We have a few donors who set up recurring on their individual id but rather have it show up under their household. Of course, I can do a lot of moving id's around and make it work but...) – Paul-Tahoe Jul 19 '17 at 20:51