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="https://www.paypal.com/cgi-bin/webscr" method="POST" name="_masspay">
    <input type="hidden" name="cmd" value="_masspay" />
    <input type="hidden" name="receiver_email_1" value="support@example.com" />
    <input type="hidden" name="receiver_email_2" value="paypal@example.com" />
    <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="https://www.example.com/buy/12" /> 
    <input type="hidden" name="cancel_return" value="https://www.example.com/buy/12" /> 
    <button type="submit">Pay With PayPal</button>
</form>

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?

Dani AI

Generated

You will not be able to make MassPay work with an HTML form. MassPay was replaced by PayPal Payouts, which is a server-side REST API that expects OAuth 2.0 and JSON, not browser form posts. Also, IPN is legacy; for new builds PayPal recommends Webhooks for payment events. (paypal.com, developer.paypal.com)

Given your marketplace goal (keep a cut and send the rest to the seller), Dani’s instinct was right to steer away from Payouts for checkout itself. In 2025 the recommended pattern is PayPal Commerce Platform multiparty checkout: create an order to the seller and set your platform fee and disbursement mode. Use delayed disbursement if you want to hold funds and release later. (developer.paypal.com)

Example: create an order that collects a $3 fee on a $10 purchase and delays the seller payout until you release it.

curl -X POST https://api-m.sandbox.paypal.com/v2/checkout/orders \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "intent": "CAPTURE",
    "purchase_units": [{
      "amount": {"currency_code": "USD", "value": "10.00"},
      "payee": {"email_address": "seller@example.com"},
      "payment_instruction": {
        "disbursement_mode": "DELAYED",
        "platform_fees": [{"amount": {"currency_code": "USD","value": "3.00"}}]
      }
    }]
  }'

Key steps that have worked well for similar builds:

  • Onboard sellers to your platform (Partner Referrals) so you can specify them as the payee and collect fees. (developer.paypal.com)
  • After capture, listen for PAYMENT.CAPTURE.COMPLETED via Webhooks; avoid IPN. (developer.paypal.com)
  • When ready to pay the seller, release DELAYED funds using Referenced Payouts (or standard Payouts for non-referenced disbursements). Payouts access must be enabled on your account. (developer.paypal.com, paypal.com)

Note: Adaptive Payments (which Dani mentioned back in 2019) is now legacy/limited release and not available for new integrations; use the multiparty checkout flow above instead. (developer.paypal.com)

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: https://developer.paypal.com/docs/payouts/integrate/api-integration/

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?

Thanks

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!

Were you able to get this done?

Be a part of the DaniWeb community

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