Quantcast
Channel: Active questions tagged paypal - Stack Overflow
Viewing all articles
Browse latest Browse all 518

How to resolve Paypal API "SENDER_RESTRICTED" error

$
0
0

I'm making a payout request with the PayPal REST API.

await axios.post('https://api-m.paypal.com/v1/payments/payouts', {    sender_batch_header: {    sender_batch_id: Math.random().toString(36).substring(2, 15),    email_subject: "You have a payment!",    email_message: message    },    items: [{    recipient_type: "EMAIL",    amount: {        currency: "USD",        value: (Math.round(amount * 100) / 100).toFixed(2)    },        note: "Thanks for your business!",        receiver: email,        sender_item_id: Math.random().toString(36).substring(2, 15)    }]    }, {    headers: {"Authorization": `Basic ${Buffer.from(key.client_id +":" + key.client_secret).toString('base64')}`,"Content-Type": "application/json"    }});

This request consistently returns a 403SENDER_RESTRICTED error.Response Data:

{    name: 'SENDER_RESTRICTED',    message: 'Authorization error occurred.',    debug_id: 'ede691decdb68',    information_link: 'https://developer.paypal.com/docs/api/payments.payouts-batch/#errors',     links: []}

The PayPal REST API documentation doesn't tell me what the error means. Since it throws a different error if I try to use random credentials it seems that the credentials I am using are already correct.


Viewing all articles
Browse latest Browse all 518

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>