This is my first time to set up a PayPal masspay. I don't know what variables should I put in my HTML form.

Here is the form:

<form action="" method="POST" name="_masspay">
    <input type="hidden" name="cmd" value="_masspay" />
    <input type="hidden" name="receiver_email_1" value="" />
    <input type="hidden" name="receiver_email_2" value="" />
    <input type="hidden" name="mc_currency_1" value="USD" />
    <input type="hidden" name="mc_currency_2" value="USD" />
    <input type="hidden" name="item_name_1" value="item name" /> 
    <input type="hidden" name="item_name_2" value="website fees" /> 
    <input type="hidden" name="amount_1" value="10.00" />
    <input type="hidden" name="amount_2" value="2.00" />
    <input type="hidden" name="custom" value="1" /> 
    <input type="hidden" name="return" value="" /> 
    <input type="hidden" name="cancel_return" value="" /> 
    <button type="submit">Pay With PayPal</button>

I don't know what I should have in the cmd field. This is my first time creating an HTML IPN form for masspay.

Can anyone help?

Recommended Answers

All 9 Replies

Oh, my goodness! I used to use MassPay a few years ago but I don't know if I still have access to that old code base. I will try to pull it up and see if I can find something. The first thing I remember though about using MassPay is you need to specifically enable it for your account. I just googled for the Mass Payments API and it says: "Note: The MassPay API is Deprecated as of September 1, 2017. For new integrations, see the Payouts Overview."

It looks like you sound be using this instead:

Soooo, just to clarify, to use the Payouts API you need to be sending a POST request with a JSON payload. You shouldn't be using an HTML form. May I ask what your use case is in that you want an end-user to click a button and pay multiple people? Maybe there's a better way of doing it.

The Mass Pay API, and now the Payouts API, are for things like affiliate programs, etc. where the app needs to pay a large number of its users at once.

Hi Dani. I am building a site similar to eBay and Reddit. And I want my users to receive payments from each other. I like using the IPN because I am familiar with it. If you can help me with HTML I would be greatful.

Hope I answered your question. Plus I love Dani Web :)

So I'm actually not sure what eBay and Reddit have in common :)

That aside, I don't think you can use IPN for users paying each other. The recipient's PayPal address needs to manually opt into receiving IPN notifications, which your end-users aren't all going to do or know how to do. I think you might also need to have a PayPal merchant account in order to enable IPN notifications.

You also can't use PayPal MassPay because it's been deprecated and won't work anymore.

Maybe if you gave me a clearer example of what you're trying to do, I can propose an alternative. Do you just want to be notified when one person pays another person through your platform? Or do you want to take a cut of it (e.g. profit sharing). PayPal profit sharing works such that the buyer will pay your app $10. Your app will keep $3 and automatically forward $7 on to the seller.

Hope I answered your question. Plus I love Dani Web :)

Thanks so much!!

Hi Dani. I want to get a cut of the transaction and forward the rest to the user. I can create a merchant account, but the problem is in the code.
I haven't done it before. Just a few hints will do. Now I know that I must use JSON with the Payouts API, but is there anything else?

Are there any good toturials for Payouts API?


So if you want to get a cut of the transaction and forward the rest to the user, you don't want to use JSON with the Payouts API. That's why I wanted to get a clearer picture of what you're trying to do. Because, for your use case, you don't want to use the old Masspay API or the Payouts API. That's not what they're designed for.

What you want to do instead is use Adaptive Payments, which is specifically designed for when you are the owner of an app, and you want there to be multiple receivers of the payment. Her'es more information:

If you read that entire page, it should answer all your questions. Parallel payments looks like what you would like to do.

I understand that the page says that you need to opt-in to the service, so your best bet is to read that whole page, and then contact PayPal customer service for more information about getting started.

Unfortunately, PayPal IPN or the Payouts API won't do what you want.

Wow. Thank you very much!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.