I have been developing an application and using my production account.
I need to start testing the creation of orders and then payments, for this I created a new sandbox account.
I am filtering all of my SDK requests to a specific location ID as this is an online ordering platform when I want to limit available items to have an online and physical store location.
In the production application, this was working ok.
However, since switching to the sandbox the SDK requests to the catalogue are returning a 200 but not producing any items.
I exported all of the items from the production catalogue and imported them to the sandbox one. I created a new “online” location in the sandbox account and made sure all items are available at this location.
My application now uses the sandbox online location ID and pretty much everything fails except for a call to get the categories.
As I mentioned earlier no catalogue items are returned anymore and when I do try and create an order (after removing the location ID from the request) I get an authorization error like below:
{"errors": [{"code": "FORBIDDEN","detail": "Not authorized to access orders with location_id=LFPBZD73080G7","category": "AUTHENTICATION_ERROR"}]}
This is how I am initializing the client SDK
const squareClient = new Client({
environment: Environment.Sandbox,
accessToken: params.SQUARE_ACCESS_TOKEN_SANDBOX,
customUrl: "https://connect.squareupsandbox.com",
});
const { catalogApi, ordersApi } = squareClient;