Get Balance of an Addaptive account - paypal

Paypal Addaptive Account/Payment APIs don't offer any methods to retrieve their balance. Is this possible via GetBalance from the Merchant API?

You should be able to use GetFundingPlans which is part of Adaptive Payments API:
https://developer.paypal.com/webapps/developer/docs/classic/api/adaptive-payments/GetFundingPlans_API_Operation/
However, this is only allowed to be called on implicitly (you have to be the sender and caller of the API.) If you wish to get other peoples balance you need to use the Classic API call GetBalance, and you would need to use the Permissions API to request permission first.

Related

How app can get PayPal user transaction info?

Can I get notification with data at specific url when users who connected PayPal to my app throught Oauth2 will get payment? I know it possible with IPN, but then each user need to add my url in their account settings. Is any another way?
Update: Or can I manually get information about last user transactions(completed outside my app)?
There are a number of ways to accomplish what you're trying to do, I think.
You mentioned IPN, and that would be the best way. You can specify the NotifyURL in your standard button code or API requests (depending on how you're setting up the payments) so that IPNs for those payments will be sent to your IPN URL. That way you don't have to have users set that up in their own account.
Alternatively (or in conjunction with), you could use the Permissions API to allow users to authenticate your app to make API calls on their behalf. Then you can use the TransactionSearch and GetTransactionDetails APIs to pull any info you need about their account transaction history.

Paypal payouts tracking

I use paypal REST api (sanbdbox). I need to make automatic payouts, track it, get the list of all payments (including created payout via REST api). I managed creating single batch payout and get status for it. But I can't get list of all payments (income and outcome) and match my payouts.
When you create a payout store the sender_batch_id you use, and when you get a response store the payout_batch_id / payout_item_id then update poll the status using
/v1/payments/payouts/payout_batch_id
or
/v1/payments/payouts-item/payout_item_id
Preferably instead use the webhooks API to get a notification when the status changes, then update the status accordingly.
Either of these approaches requires you to somehow keep track of your own payouts. I do not see a way to list previously submitted payouts in the REST API. There are of course many ways you could organize and track your requests.

How to test a PayPal capture API call with Sandbox

I have setup PayPal Sandbox test accounts, a Personal (buyer) and a Business (merchant).
I'd like to test a PayPal 'DoCapture' API Operation. The problem I'm encountering is that I need an AuthorizationID and don't know how to obtain it. If i run the 'DoExpressCheckoutPayment' API call, I do not get an AuthorizationID returned, using the merchant API credentials, though I do get an 'ACK' of success. Do I need to be using the buyer credentials with the 'DoExpressCheckOutPayment' call? I don't see the API credentials in the PayPal Sandbox profile for the Personal account.
Express Checkout example with authorization and capturing you can find here.
Short answer - according with DoCapture documentation
AuthorizationID ... This is the transaction ID returned from DoExpressCheckoutPayment...
According with DoExpressCheckout documentation you need field from response, attention, PaymentInfo#TransactionId
... this value is your AuthorizationID for use with the Authorization & Capture APIs.
This is what you need to do to implement the capture API.
Create Payment: set intent as authorize in its request to get payment Id
Show Payment Details: to get approval_url. The customer will use this URL to pay for the order.
Execute approved PayPal payment: Use this API after customer successfully pays for the order. This API returns authorization-id along with capture link.
Use Capture API: use the URL obtained from step 3 to capture.
Use this link and check payments API.
https://developer.paypal.com/docs/api/payments/#payment_execute
Hope this helps to someone who stumbles upon here.

How to get PayPal user's currencies?

We need to list currencies associated with a given PayPal account, is there a way to accomplish this using the api?
No. This is buyer-account data and is not available to API callers.

Get payment history on Paypal API

I need to find a way of getting a Paypal account holders payment history using the Paypal api. If we have a user's consent (i.e. we've already used the Permissions API to redirect them to Paypal, and they've consented to give us permissions to get details of payments to their account), what's the next step?
I've seen a similar question here which talked about using GetTransactionDetails call, but that seems only to get details for a single transaction. Another answer mentioned the Payment.List method, but didn't give an example of how it's used.
Can anyone point me in the right direction?
I would recommend using the TransactionSearch API. This will let you get a list of transactions (up to 100 at a time). You can then use the GetTransactionDetails API to get more information on individual transactions.
https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/TransactionSearch_API_Operation_NVP/