Square OAuth & using dynamic values in API Requests

I am using the Zeroqode Square Seller Authorization (OAuth) plugin to connect Square POS to my Bubble app. The plugin also handles the refresh token process.

Now that I have the OAuth set up correctly I am starting to build out my API calls using the API Connector.

The first API request I set up is Create Customer. I successfully used the API Connector to create a customer in my Square Developer Dashboard.

This is my current setup in the API Connector. I’m new to setting up APIs in Bubble and hoping to get some guidance from this community. Does this look correct?

This is my workflow action to create a customer.

Questions
The access token is saved to the database (with strict privacy settings) so I set up the parameter access_token in the API call so I could use the access token saved in the database in the workflow action.

If I add the parameter access_token to every API request will it always work as long as I continue to have OAuth access even when the token is refreshed?

Will I run into problems when the access token automatically refreshes or is there a better way to do this?

Do I need to worry that the Authorization Value in the top part of the API call where it says Shared headers for all calls > Authorization > value is not a dynamic value? Will this mess up my API calls in my workflows when the token is automatically refreshed?

Finally, is there a way to manually trigger an OAuth access token refresh while I’m building so I can see if my setup works correctly without needing to wait 30 days for the token to refresh?

Any and all help is greatly appreciated. Thank you!

1 Like

Did you ever get this working smoothly? I’m trying to do the same thing.

I got a bit further but have since put the project on hold.

I ended up making all of my own plugins so it would be easier to get the fields I wanted.

I was able to create the following actions:

  • OAuth Initiate
  • OAuth Exchange for token
  • Retrieve merchant
  • Create customer
  • Create gift card
  • Create Cards
  • List Catalog
  • List Catalog modifiers
  • List Catalog item options
  • List Catalog item variations
  • Search Catalog
  • Retrieve items by category id
  • Create order

I also finished up the Payment Element so I could add a card and use it for subscriptions and payments directly from the app. Similar to Apple Pay.

I was working on constructing line items to finish up the checkout flow when I set it aside.

If you have a specific question I can try to help

2 Likes