Search code examples
c#paypalpaypal-rest-sdk

What is the correct PayPal API workflow for PayOut feedback?


I cannot seem to find the documentation for this workflow in the docs.

We are making PayOuts to individuals via PayPal using the C# .Net PayPal SDK.

We want to get the Transaction ID for the payout to store back against our payment records.

Currently I creating the PayOut (via Payout.Create) and that this point the batch status is PENDING and there is no Transaction Id

I then repeatedly Get the PayOut (via Payout.Get) with a exponentially-backed-off delay interval until the batch status changes (SUCCESS,UNCLAIMED,DENIED etc.), and/or there is a batch error reported, or we have tried too many times.

Is this the correct approach? Should I be using another technique?


Solution

  • The PayPal-NET-SDK is deprecated and should not be used. Most PayPal REST API operations should be done with direct HTTPS call integrations in JSON format (no SDK)

    In the REST Application you are processing payouts with, you can register a webhook event listener URL. There are various events for payouts, including PAYMENT.PAYOUTS-ITEM.SUCCEEDED