Issue with 403 Forbidden Error when Accessing PayPal Sandbox API.

JohnAlex22
New Community Member

Hello PayPal Community,

I hope you're doing well. I'm currently facing an issue while trying to make API requests to the PayPal Sandbox API endpoint: `https://api-m.sandbox.paypal.com`. Whenever I try to open this URL in my browser or make API requests to it, I receive a 403 Forbidden error.

I've double-checked my API credentials, reviewed the documentation, and ensured that my PayPal sandbox account is properly configured. Despite these efforts, the issue persists.

Could someone please guide me on potential reasons for a 403 error in this context and any specific steps I should take to resolve it? Additionally, if there are any known issues or updates related to this, I would greatly appreciate the information.

 

These are the errors I encounter on my console:

 

Access to fetch at 'https://api-m.sandbox.paypal.com/api/orders' from origin 'https://mulikampango.serveo.net' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

ReactPaypal.js:33     POST https://api-m.sandbox.paypal.com/api/orders net::ERR_FAILED

createOrder @ ReactPaypal.js:33

ReactPaypal.js:61 TypeError: Failed to fetch

    at Object.createOrder (ReactPaypal.js:33:1)

overrideMethod @ console.js:213

createOrder @ ReactPaypal.js:61

await in createOrder (async)

Show 1 more frame

js?client-id=AcdI35qKztR2auzF_T7007hSYAg8ODzVozDeH1O7Ik7mYb9WIC9sRQv5OXgKtY_YZH8jLDkcsuHJpaeY:3 Uncaught Error: Expected an order id to be passed

    at https://www.sandbox.paypal.com/smart/buttons?sdkVersion=5.0.416&style.layout=vertical&style.color=go...

    ... permitted]c2V9LCJ3ZWNoYXRwYXkiOnsiZWxpZ2libGUiOmZhbHNlfSwicGF5dSI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJibGlrIjp7ImVsaWdpYmxlIjpmYWxzZX0sInRydXN0bHkiOnsiZWxpZ2libGUiOmZhbHNlfSwib3h4byI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJib2xldG8iOnsiZWxpZ2libGUiOmZhbHNlfSwiYm9sZXRvYmFuY2FyaW8iOnsiZWxpZ2libGUiOmZhbHNlfSwibWVyY2Fkb3BhZ28iOnsiZWxpZ2libGUiOmZhbHNlfSwibXVsdGliYW5jbyI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJzYXRpc3BheSI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJwYWlkeSI6eyJlbGlnaWJsZSI6ZmFsc2V9fQ&platform=mobile&experiment.enableVenmo=false&flow=purchase&currency=USD&intent=capture&commit=true&vault=false&renderedButtons.0=paypal&renderedButtons.1=card&debug=false&applePaySupport=false&supportsPopups=true&supportedNativeBrowser=false&allowBillingPayments=true&disableSetCookie=true:1497 click_initiate_payment_reject {err: 'Error: Expected an order id to be passed\n    at ht…Ik7mYb9WIC9sRQv5OXgKtY_YZH8jLDkcsuHJpaeY:3:15912)', timestamp: '1704282992596', referer: 'www.sandbox.paypal.com', sdkCorrelationID: 'f753154ea4826', sessionID: 'uid_0898f424b4_mte6nty6mjq', …}

 

Thank you in advance for your assistance!

Best regards,
John [Removed]
Frontend Dev

Login to Me Too
2 REPLIES 2

vaishnavib
Moderator
Moderator

Good day @JohnAlex22

 

Thank you for posting to the PayPal community.

 

When testing in the Sandbox environment and creating your app, you have two options available:

1) Merchant

2) Platform

 

I would suggest you please create your app by selecting Platform. Once you have received the API credentials, you will be able to execute the required API calls in the Sandbox Environment.

 

Please refer to PayPal Commerce Platform for Marketplaces and Platforms product which offers multiparty payment processing solutions for marketplaces and platforms.

 

Note: Please note that for LIVE integration, kindly fill out the Marketplace application via the below link.

 

https://www.paypal.com/us/webapps/mpp/partner-program/contact-us?ref=marketplace

https://developer.paypal.com/docs/multiparty/get-started/#link-stepgolive 

 

Once applied, the respective team will review your business details and contact you directly.

 

Guide link -   https://developer.paypal.com/docs/multiparty/ 

 

If you still facing the issue, please create a MTS ticket via -   https://www.paypal-support.com/s/?language=en_US with detailed error information. 

 

Sincerely,

Vaishnavi

PayPal MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

AliMAli
Contributor
Contributor
IAM submitted may parent
Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.