New REST API Feature: Setting a Receiver for Payments
Until recently, if you have been using the PayPal REST APIs to process payments, you will have seen that the money transacted is always paid to the app owner, known as the payee or receiver. The ability to change the receiver of funds in a transaction by setting a different payee has been a highly requested feature by our developer community.
With that said, we’re happy to share that you can now set the payment receiver when making direct payments in the REST APIs. When setting your payment transaction details, before starting the payment, simply add a payee
object and include the email address of the account that should receive the payment. A sample payment JSON object that includes a payee
email may look something like this:
{
'intent':'sale',
'redirect_urls':{
'return_url':'http://localhost:3000/process',
'cancel_url':'http://localhost:3000/cancel'
},
'payer':{
'payment_method':'paypal'
},
'transactions':[{
'amount':{
'total':'10',
'currency':'USD'
},
'payee':{
'email': 'payee@test.com'
},
'description':'My amazing product'
}]
}
You can see the full payee
object definition in our API documentation.
Currently this functionality is available globally, where PayPal is available, for standard PayPal and credit card payments through the REST APIs only, but we’re working hard to get it enabled for all feature endpoints. Please note that direct credit card payments and their related features are restricted in some countries.
Happy coding!