How to make payment to merchant with card on file?

I have an app which stores users cards just prior to placing the first order on the app… this COF is then used for subsequent purchases from various other merchants. Can someone give me a pointer as to where I can find docs which show how to make this payment to the merchant? I assume the locationId (on the CreatePayment) is the identifier for the merchant and the oAuth AccessToken setting somewhere on the client. I am doing this in C#.

I have tried the following when creating the client
1.
NOTE: merchantAccessToken is set as a bearer token in the header…
new Square.SquareClient.Builder()
.AddAdditionalHeader(“Authorization”,$“Bearer {merchantAccessToken}”)
.AccessToken(“squareAccessToken”)
.SquareVersion(“squareVersion”)
.Environment(“squareEnvironment”)
.Build();

I have also tried

NOTE: merchantAccessToken is set as the AccessToken
new Square.SquareClient.Builder()
.AccessToken(“merchantAccessToken”)
.SquareVersion(“squareVersion”)
.Environment(“squareEnvironment”)
.Build();

The first method, I get this error message:
Category: “INVALID_REQUEST_ERROR”
Code: “BAD_REQUEST”
Detail: “Not authorized to take payments with location_id=xxxxxxxxxxx”
Field: null

The second method, I get the message:
Category: “AUTHENTICATION_ERROR”
Code: “FORBIDDEN”
Detail: “Unauthorized to use this card”
Field: “sounce_id”

Can someone nudge me in the right direction please?

The second way would be the correct way (you do not use your own personal access token when making calls on behalf of merchants). With that said, is the location_id you’re setting part of the merchant’s account? To be clear, the location and customer_id, and the card_id all need to be a part of the merchant’s account, as they’re scoped per-merchant, not per-application.

Feel free to share your Square app id and the location_id that you’re trying to do this with, if the above doesn’t help, and I can take a look at the logs.