Hello,
I’m executing a request to the batchUpsertCatalogObjects
endpoint using the Square npm package. Whenever I send the request I’m getting the following error:
Invalid object `#E4MKQ73UX2J6KY32REYIBR4F`: [merchant_token=MLNDC7S41Y00W] Global Attribute present_at_all_locations required on ITEM_ITEM_MODIFIER_LIST_MEMBERSHIP..
But there is no object in my request with id “#E4MKQ73UX2J6KY32REYIBR4F”. In fact, each time the id listed here is different, and it is never an id I’m passing in the request body.
What’s going on here?
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
Catalog API
Add Custom Attributes
Merchants API
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 error message you’re seeing is indicating that there’s an issue with the present_at_all_locations
attribute on an object of type ITEM_ITEM_MODIFIER_LIST_MEMBERSHIP
. This type of object is used to associate a modifier list with an item.
The present_at_all_locations
attribute is required for all catalog objects and indicates whether the object is visible in all locations or just specific ones. If you’re trying to associate a modifier list with an item, make sure that you’re including this attribute and setting it to either true
or false
.
The ID that’s being shown in the error message (“#E4MKQ73UX2J6KY32REYIBR4F”) is likely a temporary ID that’s being generated internally during the request. It’s not something that you need to provide or that you can control.
So, to resolve this issue, you should review your request body and ensure that all objects of type ITEM_ITEM_MODIFIER_LIST_MEMBERSHIP
include the present_at_all_locations
attribute.
This answer was reviewed by @Bryan-Square.
I’m actually not sending any items of type ITEM_ITEM_MODIFIER_LIST_MEMBERSHIP
either, which is what is so confusing.
What is your application ID?
I’m using application id sq0idp-ML1qjCQWMh-l1qfqNqDt4w
Thanks for the application id.
Tried reviewing the related API Logs, and I can see these calls were in sandbox. Tried looking at the request body, but it’s hidden in the API log.
Can you try and replicate the issue with a UpsertCatalogObject - just to isolate it down to the one entry, and provide the request body here (if there’s no sensitive information in the request body).
I’ve just tried submitting with just one entry but it succeeded. Unfortunately this is a very large request, as it’s being used in a script to populate items in a sandbox account and there are over 200 objects. So it’ll be difficult to trace it down to a single object. But I’ve logged it on my side and in the entire input there’s never an id matching the object id that’s coming back in the error.
Is there a flag or something I can pass along with my request so that it doesn’t get hidden in your logs?
Unfortunely, there’s isn’t a flag. And this its rare I’m unable to review a request body in the API logs.
In any case, Bryan’s helped escalate the question here on the Square side. Something odd about your error we’re trying to dig into.
If you can spare the time to find the particular object entry in the bigger BatchUpsertCatalogObjects API call, it might be helpful as we take a deeper look into this. We’ll get back to you on the Square side investigation.