Change the button from Sandbox to Production

New Community Member

Hello ,
I integrated on a site the payment button.
I ran all the tests in Sandbox without any problems.
The button is the standard one that is generated to which I added javascript code to change the value and the return page


<div style="max-width:550px; display: inline-block;">
<div id="paypal-button-container"></div>


  createOrder: function (data, actions) {
// This function sets up the details of the transaction, including the amount and line item details.
return actions.order.create({
  purchase_units: [{
amount: {
currencyCode: "EUR",
value: '10',
style: {
disableMaxWidth: true
application_context: {
  shipping_preference: 'NO_SHIPPING'
  onApprove: function (data, actions) {
// This function captures the funds from the transaction.
return actions.order.capture().then(details => {
  // This function shows a transaction success message to your buyer.
//  alert('Transaction completed by ' +;
document.getElementById('loader').style.display = 'none'; // Nasconde il loader
document.getElementById('redirectMessage').style.display = 'block'; // Mostra il messaggio di redirect
setTimeout(function () {
// Effettua il redirect dopo 5 secondi
window.location.href = 'return.asp';
}, 5000);
  onCancel: function (data) {
console.log('Pagamento annullato:', data);
document.getElementById('errorPay').innerHTML = 'Pagamento annullato.';
document.getElementById('errorPay').style.display = 'block';
  onError: function (err) {
console.error('Errore durante il pagamento:', err);
// Accesso al codice e al messaggio di errore specifico
var errorCode = err.code;
var errorMessage = err.message;
switch (errorCode) {
document.getElementById('errorPay').innerHTML = 'Pagamento fallito. Si prega di riprovare.';
document.getElementById('errorPay').style.display = 'block';
document.getElementById('errorPay').innerHTML = 'Pagamento annullato.';
document.getElementById('errorPay').style.display = 'block';
document.getElementById('errorPay').innerHTML = 'Si è verificato un errore durante il pagamento: ' + errorMessage;
document.getElementById('errorPay').style.display = 'block';

what I changed in the transition from sandbox to real is only the client-id
But I can't get the button to work and in the brower console I have these error messages
"err": "Error: /v2/checkout/orders returned status 403 (Corr ID: f8372090db9a9).\n\n{\"name\":\"NOT_AUTHORIZED\",\"details\":[{\"issue\":\"PERMISSION_DENIED\",\"description\":\"You do not have permission to access or perform operations on this resource.\"}],\"message\":\"Authorization failed due to insufficient permissions.\",\"debug_id\":\"f8372090db9a9\",\"links\":[{\"href\":\"\",\"rel\":\"information_link\"}]}\n

Login to Me Too

PayPal Employee
PayPal Employee

Hi @SubitoCerchi 


Thank you for posting to the PayPal community.


From your error message, it appears that the API call to "/v2/checkout/orders" is returning a 403 error, which signifies that the client does not have permission to access the requested resource. This could be due to a number of reasons, including incorrect permissions on your PayPal account and incorrect client credentials. 


 If a third-party eCommerce partner is performing API operation on your behalf, you(i.e merchant) should be on-boarded and necessary API permissions should be granted to the Partner(API Caller). 

Documentation Link: PayPal Multiparty Payments,

Multiparty Seller Onboarding


Merchants can manually grant permission to a third-party eCommerce to access specific information in your PayPal account and perform PayPal API operations on your behalf.


Login to >> Settings >> Account Settings >> Website payments >> API Access >> Pre-built payment solution >> Grant API permission >> Contact your "Third-party software eCommerce" for Third Party Permission Username >> Enter the username.


Documentation link:   Grant a Third Party Permissions


If you are still facing issues, please create an MTS ticket via -  with all the relevant information, including your client ID, the exact API call you're making, and the full error message you're receiving. 





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

Haven't Found your Answer?

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