# Struggle retrieving Paypal Access Token using ClientId and Secret 2021

**URL:** <https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580>\
**Category:** APIs\
**Created:** [July 5, 2021, 10:12am UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580 "2021-07-05T10:12:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![vovahumnytskiy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vovahumnytskiy/32/235953_2.png) [@vovahumnytskiy](https://forum.bubble.io/u/vovahumnytskiy)\
**Post date:** [July 5, 2021, 10:12am UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/1 "2021-07-05T10:12:54Z")

</div>

Due to the lack of knowledge, I fail to set up general Paypal API call to get Acess Token. Need your help, guys.

Here, how Paypal wants me to do it:

 ![343424](https://us1.discourse-cdn.com/bubble/original/3X/1/d/1d6024dec2aca23faebeee047b2c2a566cf2de60.png)

How I’ve set it up:

 ![44](https://us1.discourse-cdn.com/bubble/original/3X/2/3/2302f2b66cd215fd3615c7f01f889466826fe79b.png)

What I got:

 ![rewrewrew](https://us1.discourse-cdn.com/bubble/original/3X/5/c/5c6539ec550d18cd5f90d121a7ebdbe5bf5845a9.png)

Thanks a lot

---

<div class="post-metadata">

**Author:** ![partha](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@partha](https://forum.bubble.io/u/partha)\
**Post date:** [July 5, 2021, 10:21am UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/2 "2021-07-05T10:21:31Z")

</div>

Hi @vovahumnytskiy - Since the curl command uses “-u” the API is expecting Basic Auth with username as CLIENT\_ID and Password as CLIENT\_SECRET.

Please try this way and check it out.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/9/a/9aa9c33ce3be94831874cd8ede3330476a88a5cf.png)

---

<div class="post-metadata">

**Author:** ![vovahumnytskiy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vovahumnytskiy/32/235953_2.png) [@vovahumnytskiy](https://forum.bubble.io/u/vovahumnytskiy)\
**Post date:** [July 5, 2021, 10:31am UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/3 "2021-07-05T10:31:01Z")

</div>

> [@partha](#):
>
> Please try this way and check it out.

I’ve already tried it. Doesn’t work ((

---

<div class="post-metadata">

**Author:** ![vovahumnytskiy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vovahumnytskiy/32/235953_2.png) [@vovahumnytskiy](https://forum.bubble.io/u/vovahumnytskiy)\
**Post date:** [July 5, 2021, 10:33am UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/4 "2021-07-05T10:33:28Z")

</div>

![ACC](https://us1.discourse-cdn.com/bubble/original/3X/5/8/589a1e97d7724ea409b3cd4f7b61e8a715216076.png)  
 ![6666](https://us1.discourse-cdn.com/bubble/original/3X/f/0/f0cca739c0089f62928cf0ddd11a9a34834809e3.png)

---

<div class="post-metadata">

**Author:** ![partha](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@partha](https://forum.bubble.io/u/partha)\
**Post date:** [July 5, 2021, 10:34am UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/5 "2021-07-05T10:34:19Z")

</div>

Did you try ‘oAuth2 Password Flow’ also? (instead of HTTP Basic Auth) which also takes username and password.

---

<div class="post-metadata">

**Author:** ![vovahumnytskiy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vovahumnytskiy/32/235953_2.png) [@vovahumnytskiy](https://forum.bubble.io/u/vovahumnytskiy)\
**Post date:** [July 5, 2021, 10:36am UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/6 "2021-07-05T10:36:46Z")

</div>

it requires additional field, I don’t know what to write there

 ![eeeee](https://us1.discourse-cdn.com/bubble/original/3X/a/f/afc2d79914e7840942da019e0e3a8b91b9371e15.png)

---

<div class="post-metadata">

**Author:** ![vovahumnytskiy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vovahumnytskiy/32/235953_2.png) [@vovahumnytskiy](https://forum.bubble.io/u/vovahumnytskiy)\
**Post date:** [July 5, 2021, 10:37am UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/7 "2021-07-05T10:37:40Z")

</div>

![ewe2e2e+](https://us1.discourse-cdn.com/bubble/original/3X/7/0/70f8cb077b670929e74479b38013347b04adb603.png)

---

<div class="post-metadata">

**Author:** ![vovahumnytskiy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vovahumnytskiy/32/235953_2.png) [@vovahumnytskiy](https://forum.bubble.io/u/vovahumnytskiy)\
**Post date:** [July 5, 2021, 11:37am UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/8 "2021-07-05T11:37:56Z")

</div>

As I’ve realized, I should refuse making separate call for Acess Toket retrieval  
I should use “OAuth2 User-Agent Flow” API type.  
But still no way I can set it up correctly. Doesn’t work 😢

 ![ц141241](https://us1.discourse-cdn.com/bubble/original/3X/7/4/74c38fde9a49d577c49a5a4eb6ea41654e407a34.png)  
 ![324524](https://us1.discourse-cdn.com/bubble/original/3X/7/3/73d2430a10660b318e45fa96f6f74ba4e848bbf9.png)  
 ![435345634t634](https://us1.discourse-cdn.com/bubble/original/3X/6/f/6fb4438bbc77bcaa7963ca6842852fe948ee6ba5.png)  
 ![ertewtew](https://us1.discourse-cdn.com/bubble/original/3X/c/7/c7ddad71e1f172c221259b1dc6a842dd2680781c.png)

---

<div class="post-metadata">

**Author:** ![vovahumnytskiy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vovahumnytskiy/32/235953_2.png) [@vovahumnytskiy](https://forum.bubble.io/u/vovahumnytskiy)\
**Post date:** [July 5, 2021, 8:04pm UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/9 "2021-07-05T20:04:40Z")

</div>

up ⬆ ⬆ ⬆

---

<div class="post-metadata">

**Author:** ![Jici](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jici/32/30722_2.png) [@Jici](https://forum.bubble.io/u/Jici)\
**Post date:** [July 5, 2021, 8:25pm UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/10 "2021-07-05T20:25:42Z")

</div>

Use auth: oAuth2 Custom token  
Put in url  
[https://clientid:clientsecret@api-m.sandbox.paypal.com/v1/oauth2/token?grant\_type=client\_credentials](https://clientid:clientsecret@api-m.sandbox.paypal.com/v1/oauth2/token?grant_type=client_credentials)

---

<div class="post-metadata">

**Author:** ![vovahumnytskiy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vovahumnytskiy/32/235953_2.png) [@vovahumnytskiy](https://forum.bubble.io/u/vovahumnytskiy)\
**Post date:** [July 5, 2021, 8:39pm UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/11 "2021-07-05T20:39:28Z")

</div>

> [@Jici](#):
>
> [https://clientid:clientsecret@api-m.sandbox.paypal.com/v1/oauth2/token?grant\_type=client\_credentials](https://clientid:clientsecret@api-m.sandbox.paypal.com/v1/oauth2/token?grant_type=client_credentials)

Hey, @Jici , thank you, it worked.  
Do you know why User-Agent Flow does not work?

---

<div class="post-metadata">

**Author:** ![Jici](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jici/32/30722_2.png) [@Jici](https://forum.bubble.io/u/Jici)\
**Post date:** [July 5, 2021, 8:42pm UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/12 "2021-07-05T20:42:03Z")

</div>

If you wan’t to use user-agent, it’s a different WF in this case to implement.

Do you need to requiere your user to auth with their own account?

---

<div class="post-metadata">

**Author:** ![vovahumnytskiy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vovahumnytskiy/32/235953_2.png) [@vovahumnytskiy](https://forum.bubble.io/u/vovahumnytskiy)\
**Post date:** [July 5, 2021, 8:42pm UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/13 "2021-07-05T20:42:50Z")

</div>

> [@Jici](#):
>
> [https://clientid:clientsecret@api-m.sandbox.paypal.com/v1/oauth2/token?grant\_type=client\_credentials](https://clientid:clientsecret@api-m.sandbox.paypal.com/v1/oauth2/token?grant_type=client_credentials)

no, I want to use Paypal API just to create webhooks from Bubble interface

---

<div class="post-metadata">

**Author:** ![Jici](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jici/32/30722_2.png) [@Jici](https://forum.bubble.io/u/Jici)\
**Post date:** [July 5, 2021, 8:44pm UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/14 "2021-07-05T20:44:10Z")

</div>

Yes, but do you need just to access your own paypal account webhook or to let user link their paypal account and create webhook for their account?

---

<div class="post-metadata">

**Author:** ![vovahumnytskiy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vovahumnytskiy/32/235953_2.png) [@vovahumnytskiy](https://forum.bubble.io/u/vovahumnytskiy)\
**Post date:** [July 5, 2021, 8:44pm UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/15 "2021-07-05T20:44:56Z")

</div>

I need to allow my users to create webhooks in their Paypal account

---

<div class="post-metadata">

**Author:** ![vovahumnytskiy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vovahumnytskiy/32/235953_2.png) [@vovahumnytskiy](https://forum.bubble.io/u/vovahumnytskiy)\
**Post date:** [July 5, 2021, 8:46pm UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/16 "2021-07-05T20:46:11Z")

</div>

For Stripe it worked via “parameter in the URL” and my user just needed to provide their Stripe Secret and that is all

---

<div class="post-metadata">

**Author:** ![Jici](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jici/32/30722_2.png) [@Jici](https://forum.bubble.io/u/Jici)\
**Post date:** [July 5, 2021, 8:47pm UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/17 "2021-07-05T20:47:24Z")

</div>

So you need them to create their own account and in this case, you need to use paypal connect process.  
[https://developer.paypal.com/docs/log-in-with-paypal/integrate/](https://developer.paypal.com/docs/log-in-with-paypal/integrate/)

The setup is different in dev dashboard to create it but also in Bubble.  
Not sure, but If I remember, you will need to create the full process manually. Check on the forum you should find post about handling oauth2 manually

---

<div class="post-metadata">

**Author:** ![vovahumnytskiy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vovahumnytskiy/32/235953_2.png) [@vovahumnytskiy](https://forum.bubble.io/u/vovahumnytskiy)\
**Post date:** [July 5, 2021, 8:49pm UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/18 "2021-07-05T20:49:01Z")

</div>

they create Paypal account outside of my Bubble app

---

<div class="post-metadata">

**Author:** ![Jici](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jici/32/30722_2.png) [@Jici](https://forum.bubble.io/u/Jici)\
**Post date:** [July 5, 2021, 8:51pm UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/19 "2021-07-05T20:51:21Z")

</div>

Yes. It always the case.  
But if you wan’t to create webhook in their account, you need to connect to their paypal.  
Actually, you are connecting your own account only.

---

<div class="post-metadata">

**Author:** ![vovahumnytskiy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vovahumnytskiy/32/235953_2.png) [@vovahumnytskiy](https://forum.bubble.io/u/vovahumnytskiy)\
**Post date:** [July 5, 2021, 8:53pm UTC](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580/20 "2021-07-05T20:53:34Z")

</div>

Regarding API call to create Paypal webhook, do you know what is the issue?

Paypal Instructions:  
 ![332](https://us1.discourse-cdn.com/bubble/original/3X/1/4/148d52dd381d37ea950bc884205808c6562bf6c1.png)

What I do:

 ![7787568767](https://us1.discourse-cdn.com/bubble/original/3X/3/3/336021eb67c4baea92cd9b783727c9c2794d6337.png)

Result:

 ![678](https://us1.discourse-cdn.com/bubble/original/3X/7/5/75a3f3edacbe9d7ec0c55b4a4159bfaeefc92276.png)

[Next page](https://forum.bubble.io/t/struggle-retrieving-paypal-access-token-using-clientid-and-secret-2021/158580.md?page=2)
