Permission denied when using javascript sdk

pogrammerX
Contributor
Contributor

I am making a website with a payment, but it everytime i try to test buy my product i get a Permission denied error :

 

Error: Api: /smart/api/order/$$$$$/capture returned ack: permission_denied {"Insufiecient Permissions "}

 

This is my code:

 

paypal.Buttons({
  onCancel: function (data) {
      alert("aborted")
  },
    onApprove: function(data, actions) {
      return actions.order.capture().then(function(details) {
        alert('Transaction completed by ' + details.payer.name.given_name + '!');
      });
    },

    onError: function(err) {
        alert(err)
    },
     
    createOrder: function(data, actions) {
      // Set up the transaction
      return actions.order.create({
        purchase_units: [{
          amount: {
            value: "50"
          }
        }]
      })
    }
  }).render('#paypal-button-container');
Login to Me Too
2 REPLIES 2

jafii
Contributor
Contributor

Were you able to resolve this issue?

Login to Me Too

Kavyar
Moderator
Moderator

Good day @pogrammerX 

 

Thank you for posting to the PayPal community.

 

I would suggest to please make sure you are use the same LIVE  REST API Credentials(Client ID & Secret) while performing the create order API and capture order API.

 

https://developer.paypal.com/api/rest/authentication/

https://developer.paypal.com/api/rest/postman/ 

 

Can you please try now by creating a new order and capture the order with the same API credentials.

 

Also, 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). 

 

https://developer.paypal.com/docs/multiparty/ 

 

https://developer.paypal.com/docs/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 PayPal.com >> 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.

 

Direct link -  https://www.paypal.com/cgi-bin/webscr?cmd=_profile-api-grant-authorization

                       https://developer.paypal.com/api/nvp-soap/paypal-payments-standard/admin/third-party/ 

 

If your still facing issues, please create an MTS ticket via - https://www.paypal-support.com/s/?language=en_US  with the detailed information and error details.

 

Sincerely,

Kavya

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

Haven't Found your Answer?

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