Confused about locations via the api

OK, I have multiple websites, and we have separate user accounts on each site (as in, if a person wants to use two of our sites, they have to register for both sites separately).

It is my understanding that I should set up each website as a location.

It is also my understanding that “customers” are not location independent, so we’re just going to have duplicate square customer profiles.

However, when I create a customer, since there is no location_id, it’s going under the default location and when I try to create a payment, with a secondary location_id, I receive the error:

“Not authorized to take payments with location_id=” and my secondary locaiton_id.

What am I doing wrong? Please let me know if there’s any other information I can provide.

:waving_hand: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Square Developer
Locations API
International Development

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

When you say separate accounts do you mean multiple location within a Square account or two unique Square accounts? :slight_smile:

My hope is that I have created two locations within the same square account.

Okay, what’s the application ID your using? :slight_smile:

sq0idp-lvozvW0_k-IP-y0pouw_Vg

Okay, it looks like you created another sandbox test account which is why your getting this error. An additional sandbox test account is supposed to represent an entirely different Square account and will have a different access token. What your trying to do is to have another location within your already existing Square account. You’ll want to create an additional location within the Default Test Account and use that location_id when taking payments in sandbox to simulate the experience your building. :slight_smile:

Could you give me the steps to get to where I create another location in the default test acct?

I was here when I created the 2nd location:
Locations - Square Developer Console

Yeah, you can call CreateLocation with our API to create the additional locations. :slight_smile:

is it possible to do from the web console?

(thx for all the help btw!)

Yes, you can in the Account Settings section of you Sandbox seller Dashboard. :slight_smile:

Awesome, thanks!

Here’s what I’ve got so far:

I created 2 more locations (so I have 3 total)
I created a user (on my site) and added a square profile for them (via create customer api)
I added a card, using location 2, and a transaction.

I then used an existing user/profile and added a card for default location, created a transaction
Then i deleted that card, added a new card for location 3 and created a transaction.

What I see in my transactions screen of the dashboard is a bit strange though…

The transaction created at location 2 looks perfect. In the transaction list, it properly says “location 2” and the details view has “paid by” with a link to the user

The transaction created at “default” properly says “default” in the transaction list, but is missing the “paid by”

The transaction created at location 3 has neither.

When saving a card on file it’s not scoped to a single location. Cards are available for the entire account so you only need to store the card on file once. When creating the payment the location_id will determine where the payment gets posted to. :slight_smile:

Yep, I get that. What I’m saying is I made transactions at each location and they all looked like I described.

However, I just now looked, and the locations are showing properly on the transactions list, but only the “location 3” transaction has the “paid by” in the details when clicked.

This is with sandbox payments? Do you have the payment_ids that aren’t showing correctly? :slight_smile:

This one is correct: jPpblb2aJ0gnklw3bEkVi2cdHINZY
this one is not: JaZF5lYrCjxe61cDTFeKIjkbOA7YY

(i think, I was unable to find the payment id via the sandbox, so had to use postman)

Since this is sandbox the paid by isn’t something that’s supported by sandbox which is why your seeing the payments like this. :slight_smile:

1 Like