PayPal API Setup Issues

  1. My goal: Connect to the PayPal API so I can pull revenue reports.
  2. Issue: Authentication is failing.
  3. Steps I've taken to troubleshoot: Confirmed correct client_ID and client secret, tried adding and removing scope, tried switching to custom auth, tried authentication/bearer in call vs in resource setup, tried a different API endpoint and simpler request, troubleshooted with Claude. Nothing seeming to work.

Error when attempting to call the API:
{"data":null,"error":{"statusCode":400,"error":"Bad Request","message":"{"error":"invalid_token","error_description":"Token signature verification failed"}","data":{"error":"invalid_token","error_description":"Token signature verification failed"},"metadata":{"request":{"url":"https://api.sandbox.paypal.com/v1/reporting/transactions?end_date=2025-07-03T06%3A59%3A59.999Z&start_date=2025-07-02T07%3A00%3A00.000Z","method":"GET","body":null,"headers":{"User-Agent":"Retool/2.0 (+https://docs.tryretool.com/docs/apis)","Authorization":"---sanitized---","ot-baggage-requestId":"undefined","x-datadog-trace-id":"7356369474408944248","x-datadog-parent-id":"6816127518841186079","x-datadog-sampling-priority":"0","x-datadog-tags":"_dd.p.tid=6866f93a00000000,_dd.p.dm=-1","traceparent":"00-6866f93a000000006617130faeac1278-5e97bfdd704b271f-00","tracestate":"dd=t.tid:6866f93a00000000;t.dm:-1;s:0;p:5e97bfdd704b271f","X-Retool-Forwarded-For":"35.90.103.132"}},"headers":{"content-type":["application/json"],"content-length":["83"],"connection":["keep-alive"],"date":["Thu, 03 Jul 2025 21:42:20 GMT"],"access-control-expose-headers":["Server-Timing"],"cache-control":["max-age=0, no-cache, no-store, must-revalidate"],"paypal-debug-id":["7130faeac1278"],"server-timing":["traceparent;desc="00-00000000000000006617130faeac1278-a1b715defbcfc844-01""],"vary":["Accept-Encoding"],"http_x_pp_az_locator":["ccg18.slc"],"strict-transport-security":["max-age=31536000; includeSubDomains"]},"status":401,"statusText":"Unauthorized"},"authenticationStatus":"UNAUTHENTICATED"}}

Hey @kt727 - if I remember correctly, PayPal requires basic authentication on the /oauth2/token endpoint.

This is a huge pain to do manually, but there should be a Beta toggle in your org settings to do this automatically!

Give that a shot and let me know if it works. :+1:

Thank you for your help! I did find the beta toggle and turned it on, and it might be progress because I'm getting a new error, but still not seeing it work.

{"data":null,"error":{"statusCode":400,"error":"Bad Request","message":"{"name":"AUTHENTICATION_FAILURE","message":"Authentication failed due to invalid authentication credentials or a missing Authorization header.","links":[{"href":"https://developer.paypal.com/docs/api/overview/#error\",\"rel\":\"information_link\"}]}","data":{"name":"AUTHENTICATION_FAILURE","message":"Authentication failed due to invalid authentication credentials or a missing Authorization header.","links":[{"href":"https://developer.paypal.com/docs/api/overview/#error","rel":"information_link"}]},"metadata":{"request":{"url":"https://api.paypal.com/v1/reporting/transactions?end_date=2025-07-03T06%3A59%3A59.999Z&start_date=2025-07-02T07%3A00%3A00.000Z","method":"GET","body":null,"headers":{"User-Agent":"Retool/2.0 (+https://docs.tryretool.com/docs/apis)","ot-baggage-requestId":"undefined","x-datadog-trace-id":"6087666276111225969","x-datadog-parent-id":"5933105482441104027","x-datadog-sampling-priority":"0","x-datadog-tags":"_dd.p.tid=686756ba00000000,_dd.p.dm=-1","traceparent":"00-686756ba00000000547bbc396abc1471-5256a00057d31a9b-00","tracestate":"dd=t.tid:686756ba00000000;t.dm:-1;s:0;p:5256a00057d31a9b","X-Retool-Forwarded-For":"35.90.103.132"}},"headers":{"connection":["keep-alive"],"content-length":["244"],"server-timing":["traceparent;desc="00-0000000000000000000b4a5932d3ce60-66aba6dd1f27665d-01""],"access-control-expose-headers":["Server-Timing"],"tracestate":["dd=t.tid:686756ba00000000;t.dm:-1;s:0;p:6e79e652a818c3e9"],"paypal-debug-id":["b4a5932d3ce60"],"cache-control":["max-age=0, no-cache, no-store, must-revalidate"],"traceparent":["00-686756ba00000000547bbc396abc1471-43dabbb3a5c1fc07-01"],"via":["1.1 varnish, 1.1 varnish, 1.1 varnish"],"accept-ranges":["bytes"],"set-cookie":["l7_az=ccg01.phx; Path=/; Domain=paypal.com; Expires=Fri, 04 Jul 2025 04:51:15 GMT; HttpOnly; Secure"],"date":["Fri, 04 Jul 2025 04:21:15 GMT"],"content-type":["application/json"],"strict-transport-security":["max-age=63072000; includeSubDomains; preload"],"x-served-by":["cache-bfi-krnt7300088-BFI, cache-bfi-krnt7300088-BFI"],"x-cache":["MISS, MISS, MISS, MISS"],"x-cache-hits":["0, 0, 0, 0"],"x-timer":["S1751602875.959794,VS0,VE107"],"vary":["Accept-Encoding"]},"status":401,"statusText":"Unauthorized"},"authenticationStatus":"UNAUTHENTICATED"}}

The Beta toggle that I mentioned previously is only relevant when Retool makes its request to the token endpoint. You still need an Authorization header with a value of Bearer OAUTH2_TOKEN!