We use OAuth for accessing client's transactions, we require clients to do a setup for us on their Square Account.
Client OAuth
To get authorization to access their account, the client needs to complete OAuth process, we can send them the next URL to grant us access:
POS Configuration
We need to create a new POS configuration for the location we are going to set up, it needs to be:
- type `square`
- and pattern for external ID should be: square-{MerchantID}:{Square-Location-ID}
example: square-ML51FS2353W0V:LENA7XBSHKF5J
In order to get the square location id, if the client does not know it, which would probably be the normal case since now we have a square token available, we can use the existing square API to get the locations and map them.
first, we need to get the square access token, we can use mono API for this:
curl --location --request GET ' \ --header 'Authorization: Bearer {mono token}' \ with the access token we can now call square location API:
curl --location --request GET ' \ --header 'Authorization: Bearer {square access token}' \