UUID Use Case

UUID Order ID

Customers see their order ID. A UUID keeps it unguessable so one buyer cannot walk another's order by changing a number.

Customer-facingOpaquev4

Generated locally with the Web Crypto API — nothing leaves your browser.

What Is UUID Order ID?

How to generate

  1. Default orders.id to a UUID.
  2. Generate a separate invoice_no for statements.
  3. Reference the UUID in customer emails.

Use Cases

Code Examples

PostgreSQL
CREATE TABLE orders (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  invoice_no SERIAL
);

Frequently Asked Questions

Do customers hate UUID order IDs?
They rarely type them — they click a link or copy from email. Keep a short invoice number for human reference.
Need both UUID and serial?
Yes: UUID for URLs/safety, serial for accounting and human readability.

Related tools