Igor Ševo
Igor Ševo

Reputation: 5525

PayPal mass payment with REST API

Is there a way to execute a mass payment from the application to several other accounts by e-mail addresses using the new REST API? I can do this with Classic API, but am not sure how to achieve the same with REST API.

I am working with PayPal SDK for C#.

I have found this related post: Paypal REST API Adaptive / Multiple Payments (change payee). However, some code samples would be nice.

Upvotes: 8

Views: 2019

Answers (4)

Harsh Patel
Harsh Patel

Reputation: 6840

As per the latest version of REST API here are the details

Doc Link: https://developer.paypal.com/docs/api/payments.payouts-batch/v1/#payouts_post

REST API [POST]: https://api.sandbox.paypal.com/v1/payments/payouts

Body:

{
  "sender_batch_header": {
    "sender_batch_id": "Payouts_2018_100007",
    "email_subject": "You have a payout!",
    "email_message": "You have received a payout! Thanks for using our service!"
  },
  "items": [
    {
      "recipient_type": "EMAIL",
      "amount": {
        "value": "9.87",
        "currency": "USD"
      },
      "note": "Thanks for your patronage!",
      "sender_item_id": "201403140001",
      "receiver": "[email protected]",
      "alternate_notification_method": {
        "phone": {
          "country_code": "91",
          "national_number": "9999988888"
        }
      },
      "notification_language": "fr-FR"
    }
  ]
}

Sample response:

{
  "batch_header": {
    "sender_batch_header": {
      "sender_batch_id": "Payouts_2018_100008",
      "email_subject": "You have a payout!",
      "email_message": "You have received a payout! Thanks for using our service!"
    },
    "payout_batch_id": "5UXD2E8A7EBQJ",
    "batch_status": "PENDING"
  }
}

Upvotes: 0

Jason Z
Jason Z

Reputation: 874

This is Jason, the developer of the PayPal .NET SDK on GitHub. Payouts API support (formerly known as Mass Payments) is now available in version 1.2 of the PayPal .NET SDK. You can get the SDK binaries by downloading them directly from GitHub or using NuGet.

There's also a Samples project included with the SDK on GitHub that shows how to create batch payouts as well as retrieve the details of a batch payout or individual payout item.

If there's a use case that isn't in the samples and you'd like to have added, feel free to open an issue on GitHub with a description of the use case or send a pull request, and I'd be more than happy to get it added. :)

Upvotes: 1

Rolf
Rolf

Reputation: 111

PayPal just made a REST version of Payouts available. Here is the Payouts Overview.

To get access:

  • Go to your dashboard.
  • Go to My account.
  • Find the Payouts capability and click Get Started.

Upvotes: 4

Igor Ševo
Igor Ševo

Reputation: 5525

The PayPal C# SDK does not currently allow making these calls (11.11.2013.). The API itself has the functionality that allows setting the payee for the payment, however this functionality is still incomplete as the PayPal REST API is in beta.

Usage of PayPal Classic API is advised here as it is stable and tested.

Upvotes: 8

Related Questions