UUID Generator: Why My Lookup API Rejected Every ID Pasted From Support Emails
Last month our support team filed the same bug three times in one week. A customer copies their order ID from an email, pastes it into the admin lookup, and the API answers with a 400. The ID looks perfectly fine to everyone involved.
I pulled the failing values from the request logs. One was 550E8400-E29B-41D4-A716-446655440000 , wrapped in braces because that is how Outlook renders identifiers copied from certain calendar-style footers. Another came from a PDF invoice with urn:uuid: stuck in front. A third carried an invisible trailing newline from the PDF text layer.
All three were the same UUID. None of them were the same string . That distinction cost us a week of finger-pointing, so here is the fix I landed, plus the traps I hit on the way.
Method 1: Parse and Canonicalize in Python (3.11.1)
My first instinct was a regex.β¦