We have implemented PayPal smart button client-side integration. We are passing the invoice id to Paypal after creating the order. we are using the Paypal patch method to call PayPal patch API from SDK. In some cases, the patch is not successful and returns the Insufficient privileges error message
Request URL: https://www.sandbox.paypal.com/smart/api/order/98J582655S968502V/patch
Request params: {"data":{"patch":[{"op":"add","path":"/purchase_units/@reference_id=='default'/invoice_id","value":"xyfuiiohsklxalks"}]}}
Response: {ack: "permission_denied", message: "Insufficient privileges"}
This is not happening all time, but in some scenarios, it's returning the error.
I am sure with these cases:
- PayPal token is not expired because we are calling the patch method next to order creating API.
- The request param is correct because we used this for a successful patch too.
Can you please explain to me the reason for this? I hope it's not the implementation part because it's not 100% reproducible issue.