"Invalid object: Invalid Object with Id: #aaa\n[merchant_token=?] Duplicate temporary object token #aaa."

I am getting no closer to working with this Catalog (or any other) Square API. Now the cryptic errors have graduated to become non-sensical errors.

"Invalid object: Invalid Object with Id: #aaa\n[merchant_token=XXX] Duplicate temporary object token #aaa."

It was my understanding that temporary tokens are supposed to be duplicates. I thought that maybe it was being sent twice in too short succession, so I regenerated to idempotency_key. No help

I am obviously doing something wrong. It would be nice if the error messages could aim me to where I can fix whatever that is, but, instead, I am left to bother you nice people.

SOLVED: Thanks to [Creating Product w/NodeJs](Creating Product w/NodeJs - #3 by Square-Dev-AI)

I saw that tempo tokens are NOT supposed to be the same. That post used origToken-variation in the variation. I did the same and it worked.

:wave: 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

Get Developer Credentials
Test in the Sandbox
Merchants API Overview

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.

Thanks to another question entitled " Creating Product w/NodeJs"

I found the solution. The Id is NOT supposed to be the same. That post had the variation’s iD as origId-variation

I did that and it worked

The error message you’re seeing is indicating that you’re using the same temporary object token (#aaa in your case) for more than one object in the same API call. Temporary object tokens are meant to be unique within a single API call, even though they can be reused across different API calls.

When you’re creating multiple objects in a single API call, each object should have a unique temporary object token. This allows the API to correctly build relationships between objects. For example, if you’re creating an item and its variations in the same API call, the item and each variation should have a different temporary object token.

To resolve this issue, ensure that each object you’re creating in a single API call has a unique temporary object token.

This answer was reviewed by @Bryan-Square.

Glad to hear you figured it out. :slightly_smiling_face: