Search code examples
square-connect

Why are some uuid upper case?


I noticed that the ids for items and their child objects such as category, category or modifier ids, can contain upper and lower case alpha characters. It was my understanding that upper case characters were not allowed in UUIDs. It is currently causing an issue for me, as the data store where I keep my ids is converting them to lower case. When I later try to retrieve an item using that id in the /items endpoint, I get a 404 return code because the case has changed. Is there a way to consistently use lower case when looking up an item? Thanks, Mike


Solution

  • You should treat all identifiers in the Square Connect API as opaque strings and store and index them accordingly. While it's true that you may currently end up with something that looks like a UUID if you allow the API to generate an ID for you, this is not something you should rely upon in your implementation. This is why the official docs do not specify that you will get a UUID back.