x

Multiple sellers on one marketplace application

I'm looking at creating an online marketplace app that would allow sellers to connect their square accounts so that when users make a purchase on the app the transaction would go through the Square API and to the seller's account. Is there a better way to direct payments to the seller's account so that each seller doesn't need to generate an "Application ID" and "Access token" to use the API? 

1,301 Views
Message 1 of 4
Report
3 REPLIES 3
Admin

@adia

 

You wouldn't need to generate an application for each Seller, but you do need to generate and Oauth access token:

 

https://developer.squareup.com/docs/oauth-api/what-it-does

 

If you have specific additional questions - Please let us know!

kellyj
Technical Program Manager: AI
Square Inc
1,239 Views
Message 2 of 4
Report

Thanks @kellyj .

 

I saw that Oauth is the way to go. Once you get the access token I assume most applications store it on the server/DB to access it anytime there is a purchase?

 

Also is there a common implementation applications use to refresh the token before the 30-day expiration? Maybe a cron job or something simple?

1,236 Views
Message 3 of 4
Report
Admin

@adia

 

We typically don't document a best practice for storing access tokens, but yes storing tokens securely in a database on a server sounds like it should work fine.

 

I would advise you to set up a cron job to happen every so often (before 30 days). That's ideal.

kellyj
Technical Program Manager: AI
Square Inc
1,229 Views
Message 4 of 4
Report