Hi Square Team,
I hope you’re doing well!
I have a question regarding the item data structure. I noticed that for some items, the field present_at_all_locations
is set to true
, but there are still values listed in the present_at_location_ids
array.
Could you please help clarify how these two fields are intended to work together? Specifically, I’m wondering why present_at_location_ids
would contain values if present_at_all_locations
is already set to true
.
Thank you in advance for your help!
Best regards,
Murphy
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
Locations API
Square Developer
Working with Addresses
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.
The present_at_all_locations
field indicates whether the item is available at all locations. If it’s set to true
, the item is available at all locations.
The present_at_location_ids
field lists the specific locations where the item is available. This field is typically used when present_at_all_locations
is set to false
, meaning the item is only available at specific locations.
However, it’s possible for an item to be available at all locations (present_at_all_locations
is true
) and still have specific locations listed in present_at_location_ids
. This could occur if the item was initially set to be available at specific locations, and then later updated to be available at all locations. The present_at_location_ids
field would still retain the specific locations where the item was initially available.
In general, if present_at_all_locations
is true
, you can assume the item is available at all locations, regardless of what is listed in present_at_location_ids
.
This answer was reviewed by @Bryan-Square.