Create_Payment_Link and LocationID of seller

The create_payment_link API wants the LocationID of the seller matching the authorization token. I thought I might use the Location API

– I have the seller’s authorization token – just exchange it for the Location ID
`GET /v2/locations/{location_id} - Square API Explorer
https://connect.squareup.com/v2/locations/main

This generates the error

category": “AUTHENTICATION_ERROR”,
“code”: “INSUFFICIENT_SCOPES”,
“detail”: “The merchant has not given your application sufficient permissions to do that. The merchant must authorize your application for the following scopes: MERCHANT_PROFILE_READ”
}

!! HOWEVER !! those permissions ARE granted during oauth – see Developer Dashboard Log:

REQUEST
{
“client_id”: “sq0idp-fGPn-QZvqEnvGeWHA9sHMw”,
“client_secret”: “[redacted]”,
“code”: “[redacted]”,
“redirect_uri”: “User Editor”,
“grant_type”: “authorization_code”,
“scopes”: [
“ORDERS_WRITE”,
“ORDERS_READ”,
“PAYMENTS_WRITE”,
“PAYMENTS_READ”,
“PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS”,
“MERCHANT_PROFILE_READ”
]
}

RESPONSE

200 – OK

{
“access_token”: “[redacted]”,
“token_type”: “bearer”,
“expires_at”: “2024-03-08T01:15:21Z”,
“merchant_id”: “516FB1QR33PFH”,
“refresh_token”: “[redacted]”,
“short_lived”: false
}