Search code examples
node.jsexpressrestpaypal

NOT_AUTHORIZED error – only in PayPal Live environment


I'm building a marketplace and trying to integrate PayPal into it. I want users to connect their PayPal accounts to the platform. I got it all working in the Sandbox environment (the whole integration). But, as soon as I switch to Live it throws the following error:

data: {
  name: 'NOT_AUTHORIZED',
  message: 'Authorization failed due to insufficient permissions.',
  debug_id: 'f4c87859c9f90',
  information_link: '',
  details: [Array],
  links: []
}

The endpoint that I call to get this error is: https://api-m.paypal.com/v2/customer/partner-referrals

No other details. Anyone knows how to fix this? Thanks in advance.


Solution

  • You need a live partner app to use the referrals API.

    As the note in the documentation says:

    Fill out this form to be an approved partner. You need to be an approved partner to go live. Calls to the PayPal Commerce Platform APIs without approval will return a 401 Unauthorized HTTP status code. You can call and test the PayPal Commerce Platform APIs with your sandbox credentials before you are approved.