Which PayPal API will achieve crowd payments - paypal

My application already receive payments using Stripe API. Once payment is received, I must pay affiliates related to the transaction. This could be 1 to many recipients.
I want to use PayPal, I want to wire an API into my application so that I may pay all pending payments by clicking a "release funds" button...clicking the release funds button would pay related recipients to their email address from a paypal account that I will keep flush with funds.
Which PayPal API will achieve this? (paying many recipients from one paypal account)
I've done a lot of research on this and alternatives. Before I spend valuable dev time on this, I need to know I'm heading down the right path so any advice would be most helpful.
thanks

The MassPay API will do it, but you'll need to get MassPay enabled on your PayPal account in order to use it. It's free, but it's just not enabled by default.
You could also look into Adaptive Payments, specifically the Pay API. In that case you would build a script that loops through all your recipients and sends payments one at a time.

Related

PayPal auto withdraw

If you have used oDesk or Elance then you would be familiar with how you can withdraw your funds to your paypal account.
My question is which paypal feature do they use for this auto withdraw method?
I am building a website for a client who will connect specialists to clients. Clients will pay directly on the website and my client will hold the funds in his account. Once the specialist has completed the appointment they can request to withdraw the funds.
I've come across chained payments but that has a limit of 90 days, so would not work for bookings longer than that.
Ideally I would like to know how sites such as Elance manage this where freelancers can request to withdraw their money from the dashboard, and then receive the specified amount automatically.
Thanks in advance for your help.
For Adaptive Payments, use the Pay Call.
Look at Implicit Payments -- if the caller of the API is also the senderEmail or sender.accountId it will have automatic approval and be able to send programatically.
Alternatively, MassPay can also send from an account program

PayPal PreApproved Payments

I am using PayPal PreApproved payments for my crowd funding website, where project backers are only charged if the project is successfully backed.
I am worried that high rate of payments will fail when the PayPal API tries to collect the funds when a project is successful:
a backer might not have any funds in their PayPal account
a backer might close their account once the project is successful (to intentionally stop payment)
a backer might remove/cancel their preapproved payment
etc...
There are a number of ways that the payment could fail which would mean that the project owner would not get their funds.
Can anyone suggest a way of tightening or securing payments. Please note, that PayPal will only allow you to use PreApproved payments for crowdfunding. Please also note that project owners need to be able to receive the funds from my site. Sometimes, these funds can be as small as $10 or up to $10,000 so we need to use PayPal to pay them as there is not other method of getting the funds to the project owner
I've implemented Paypal Adaptive payments and used them for payments at http://www.wethetrees.com and we had the exact problems you are describing. The capture rate is almost random, we were down to 35% with one campaign and had to manually send all backers invoices.
When capturing we had backers with closed/unauthorized accounts, insufficient funds, unavailable payment methods etc. We switched to just doing direct capture for a while, which is great since we get 100% of all pledges, but Paypal closed our account without notice when one of our campaigns mentioned the word "Cuba".
The solution in the end was to scrap Paypal so now we're using Wepay and Dwolla, and we're considering Bitpay (Bitcoin) as well. Seems to like Paypal wants to kill crowdfunding or doesn't understand it. Anything less than a 90% capture rate is totally unacceptable and will cause projects to fail.
Preapproval isn't the only thing they'll allow you to use. That's just one part of the Adaptive Payments API, but you could go with a delayed chained payment, too.
This way your account can be treated sort of like an Escrow. You can use the Pay API to create payments in the system that are split between receivers accordingly. Only the primary receiver would get paid at first, though, and then you can call ExecutePayment to submit the secondary payments from the primary account within 90 days.
This way the primary account holds all of the funds so they're available to pay out when the goal is reached. If the goal is not reached the payments could be refunded.

Withdraw money feature for paypal

Basically I have a script where user should have Withdraw button on his account so he can automatically withdraw money from my paypal balance
What API should I use in this case and is this available at all for paypal?
You may be interested in the Mass Pay API. You can send them in batches, say daily, weekly, or monthly.
See here for an explination directly from paypal:
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/howto_api_masspay
The MassPay API allows you to send payments to up to 250 recipients with a single API call. The payment amount for each recipient is specified individually, but all payments in a MassPay API request must have the same currency type. You can choose to specify recipients by email address or PayPal customer account number.
And here for PHP examples (if you're using PHP):
https://www.x.com/paypal-apis-masspay-php-5.3/soap
There are additional examples and a large amount of documentation on the first PayPal.com link, regardless of programming language used.
Please keep in mind Mass Pay has it's own fee schedule.
There is also Adaptive payments, which may be more up your alley, as it's designed for more fine-grained control and has a larger API available. Information can be obtained here:
https://www.x.com/content/introducing-adaptive-payments
However, the Adaptive payments will require approval of each Payment by you (the sender) via the PayPal website. If you want 100% automation, the Mass Pay API is the way to go.
Please realize a mistake here could cost you infinate amounts of money, so tread extremely carefully.
If you're attempting to withdraw money from your PayPal account and move it to your bank account that's not something you can do via the API, unfortunately. You have to do that manually through PayPal, or you can call them and request that they enable AutoSweep for you, which will automatically move the balance in PayPal to your bank at the end of each day.
Ya there is preapproval api in AdaptivePayment. You can approve the api caller for the amount he want to withdraw from your account on your behalf.
You can refer api here : https://www.x.com/developers/paypal/documentation-tools/api/preapproval-api-operation

Pay a user with Paypal

I want to use Paypal to pay users with a paypal button.
I tried to use a standard cmd=_xclick, but it doesn't return enough informations after processing the payment. IPN seems to concentrate on stores and not on payrolls, and Mass Pay seems incomplete (it needs an xml list of users informations at start, and there is no real-time modification of users informations).
Is there only Mass Pay api that is reliable for payment?
I really thought I could solve this one using google, but none of the threads and documentations really solved my problem.
[Edit]
I tried MassPay but didn't qualify with only a Premier Account.
Check out Adaptive Payments -> Implicit Payments.
It allows you to programatically send money out of your own paypal account.
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_APIntro
(You have to scroll down a bit until you find Implicit Payment Flow)

Dispatch a Paypal checkout to multiple account automatically

My website allows user to buy stuffs, and the payments will be splitted between a few people (generally 1/4 people).
So far, the processus I use is to receive the payment into one account, and then use the Paypal Adaptive Payment API to send this received payment to all the people, based on their percentage.
The problem with this solution is that the "reception paypal account" will have a lot of input/output money and will be the Achille's talon of my e-commerce (if this account is suspended, my commerce is down).
My question is quite simple: is there a way to do this automatically?
I found that if the buyer have a Paypal account, then I could directly use the Paypal API to dispatch it's payment (based on his paypal email) to the people, and that is perfect, but the problem is : what happens if the buyer doesn't have a paypal account and want to pay with, say, a credit card?
Thanks for your help!
Ok, the solution is quite simple in fact but need a complete change :
I had to forget about Web checkout and use Paypal API, do a PAY request with a Chained Payment (defining multiple receivers, with one (me) setted at primary: true). In that request, set the ipnNotificationUrl to be notified of the evolution of payments and that's it!
The response from paypal, if correct, will contain a paykey.
Then, you have to redirect the buyer to :
https://www.paypal.com/webscr?cmd=_ap-payment&paykey={PAYKEY_HERE}
or
https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey={PAYKEY_HERE}
Then, to be kept updated, all you have to do is send a request to Paypal containing the paykey to know the paymentdetails !
That's it !
I'll answer my question on that, looking into the Paypal Adaptive Payment API, we can see a dedicated section "Guest Payments".
It seems it's possible, but it requires all the people that will receive the money to have a Business Account or Premium account!
Well I'll add a second answer because it's more complete and slightly different from the first one.
The best way to do it quite simply is to use the Express Checkout API (SetExpressCheckout, GetExpressCheckoutDetails, DoExpressCheckoutPayment).
By using it instead of the basic "checkout" bouton with an IPN behind, it is possible to define more than one recipient that will receive the money : the parallel payment.
It's that easy!
(Now I have to rewrite all my code to implement it, yayh!)