How to Customize Payouts Using Mass Pay

Note: The MassPay API is Deprecated as of September 1, 2017. For new integrations, see the Payouts Overview.

The Mass Pay API enables you to send up to 250 payouts with a single call. Identify the payees using their e-mail addresses, PayPal User IDs, or mobile phone numbers.

Customize Payouts

  1. Set up the call and authentication.

    Specify the endpoint, call name, API credentials, and the version of the API you're calling. The version number should reflect the latest version number unless you have reason to use an earlier version.

    https://api-3t.sandbox.paypal.com/nvp     # Sandbox endpoint
    USER=<var>Caller_ID</var>                            # the PayPal User ID of the caller account
    PWD=<var>Caller_Pswd</var>                           # the caller account Password
    SIGNATURE=<var>Caller_Sig</var>                      # the caller account Signature
    METHOD=MassPay                            # API operation
    VERSION=93                                # API version
    
  2. Set the global call values.

    Set the RECEIVERTYPE and CURRENCYCODE values, and a customized EMAILSUBJECT (there can be only one of each of these values per call):

    RECEIVERTYPE=EmailAddress                 # set to EmailAddress, UserID, or PhoneNumber
    CURRENCYCODE=USD                          # currency code for all payouts
    EMAILSUBJECT=You have a payment from TEST # custom e-mail subject for all payouts
    
  3. Set up the payouts.

    Specify the details for each payout. You can add a custom message and tracking number to each payout, as shown:

    L_AMT0=1.23                                # 1st txn amount, starting at "0"
    L_EMAIL0=e-mail_1@example.com              # e-dress of 1st payee
    L_NOTE0= Thank you for our catered lunch.  # custom e-mail msg for 1st payee
    L_UNIQUEID0=TxnNo123                       # unique ID for txn
    L_AMT1=4.56                                # 2nd txn amount
    L_EMAIL1=e-mail_2@example.com
    L_NOTE1= Thank you for the Balloons!
    L_UNIQUEID1=TxnNo456
    
  4. Send the request.

    The following cURL command shows a complete example of how to make three payouts by using a single Mass Pay call:

    curl https://api-3t.sandbox.paypal.com/nvp \
      -s \
      --insecure \
      -d USER=<var>Caller_ID</var> \
      -d PWD=<var>Caller_Pswd</var> \
      -d SIGNATURE=<var>Caller_Sig</var> \
      -d METHOD=MassPay \
      -d VERSION=93 \
      -d RECEIVERTYPE=EmailAddress \
      -d CURRENCYCODE=USD \
      -d EMAILSUBJECT= You have a new payment from TEST \
      -d L_EMAIL0=e-mail_1@example.com \
      -d L_AMT0=1.23 \
      -d L_NOTE0= Thank you for our catered lunch. \
      -d L_UNIQUEID0=TxnNo123 \
      -d L_EMAIL1=e-mail_2@example.com \
      -d L_AMT1=4.56 \
      -d L_NOTE1= Thank you for the Balloons! \
      -d L_UNIQUEID1=TxnNo456 \
      -d L_EMAIL2=e-mail_3@example.com \
      -d L_AMT2=7.89 \
      -d L_NOTE2= Thank you for your cleaning service. \
      -d L_UNIQUEID2=TxnNo789
    

    To see this call in action, substitute your own Sandbox API credentials into the call and use the e-mail addresses associated with your Sandbox test accounts for your different payees. After making the call, review the e-mail messages in your Sandbox to see the outcome from the call.

Learn More

For details on how to send multiple payouts by using Mass Pay, see:

Note: For how to use the PayPal APIs, use the Sandbox for testing, and move your app into production, see Apps 101.

Feedback