Paypal Refund Rest Api v2 - Authorization failed due to insufficient permissions

edward_hills
Contributor
Contributor

I am able to successfully execute below APIs

/v2/checkout/orders
/v2/checkout/orders/{order_id}/authorize
/v2/checkout/orders/{order_id}/capture

Why am I getting the "NOT_AUTHORIZED" response while executing a PayPal refund as described here? - https://developer.paypal.com/docs/api/payments/v2/#captures_refund

 

POST request

https://api.sandbox.paypal.com/v2/payments/captures/<Capture ID I got from capture request>/refund

Response

    {
    "name": "NOT_AUTHORIZED",
    "message": "Authorization failed due to insufficient permissions.",
    "debug_id": "6c6xxxxx6c",
    "details": [
        {
            "issue": "PERMISSION_DENIED",
            "field": "capture_id",
            "value": "XXXXXXXXX",
            "description": "You do not have permission to access or perform operations on this resource.",
            "location": "path"
        }
    ],
    "links": [
        {
            "href": "https://developer.paypal.com/docs/api/v2/payments/#NOT_AUTHORIZED",
            "rel": "information_link"
        }
    ]
}
Login to Me Too
4 REPLIES 4

locustv2
Contributor
Contributor

Did you manage to fix this?

 

I am getting the same error on CAPTURE from orders API.

Login to Me Too

b2ccentral
Contributor
Contributor

I am trying to test refunds in the sandbox on orders that I created and captured and get this response as well.

 

{

  • error: "invalid_request",
  • error_description: "No permissions to set target_client_id"

}

Login to Me Too

Dadhich
Contributor
Contributor

Did you manage to solve it? I am facing the same issue in creating a dispute in a sandbox environment.

Login to Me Too

tekinfo
Contributor
Contributor

I have the same problem. How did you solve it

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.