What is the best way to check for incoming payment?

Temp20230103ae
Contributor
Contributor

Hi All,

 

I want to run an API call to see if I recently received a payment on my paypal account. I tried "/v1/reporting/transactions" but the payments I get are quite old, i.e. older than 3h. It seems the update depends on the "last_refreshed_datetime" which is operated by paypal. Setting "sync_mode" to false does not provide any improvement. 

 
So I guess there must be a better way, but could not identify this so far.
 

What I need is an (almost) instant update when a payment came in. What do you recommend to use? 

 

Thanks.

Login to Me Too
1 REPLY 1

MTS_Jennifer
Moderator
Moderator

Hello @Temp20230103ae ,

Thank you for posting to the PayPal Community.

Transaction search api, shows details on transactions that are 3 hours old or older, as you confirmed with your testing.

 

If you are using PayPal Standard, you can get immediate notifications via Instant Payment Notifications:

https://developer.paypal.com/api/nvp-soap/ipn/ -> General information

https://developer.paypal.com/api/nvp-soap/ipn/IPNSetup/ -> Configuring a listener

 

If you are using Rest API, and you need immediate information on an order, you can use Order Details API, this option will show you the details of the Order that was processed.

https://developer.paypal.com/docs/api/orders/v2/#orders_get

 

If using Rest API you can also use webhooks to get real time notifications of payments, and the status of transactions:

https://developer.paypal.com/api/rest/webhooks/rest/ -> Overview

https://developer.paypal.com/api/rest/webhooks/rest/#subscribe-to-events -> How to subscribe to events

https://developer.paypal.com/docs/api/webhooks/v1/#verify-webhook-signature -> Webhooks API

https://developer.paypal.com/api/rest/webhooks/event-names/ -> Webhooks event names

 

You can test Webhooks and IPNs by going to https://webhook.site you will be provided a listener url so that you can test how they work.

 

Thank you,

Jennifer

MTS

PayPal

 

 

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.