Skip to main content

Format

All resources in Voyant use TypeIDs - prefixed identifiers that indicate the entity type:
prod_01h8z3y4x2w1v0u9t8s7r6q5p4
└──┘ └─────────────────────────┘
prefix          suffix
The prefix tells you what kind of resource the ID refers to, making debugging and logging much easier.

Common prefixes

EntityPrefixExample
Productprodprod_01h8z3y4x2w1v0u9t8s7r6q5p4
Departuredeptdept_01h8z3y4x2w1v0u9t8s7r6q5p4
Bookingbookbook_01h8z3y4x2w1v0u9t8s7r6q5p4
Booking Passengerbkpxbkpx_01h8z3y4x2w1v0u9t8s7r6q5p4
Personpplppl_01h8z3y4x2w1v0u9t8s7r6q5p4
Organizationorgorg_01h8z3y4x2w1v0u9t8s7r6q5p4
Invoiceinvinv_01h8z3y4x2w1v0u9t8s7r6q5p4
Paymentpaypay_01h8z3y4x2w1v0u9t8s7r6q5p4
Itineraryitinitin_01h8z3y4x2w1v0u9t8s7r6q5p4
Collectioncolcol_01h8z3y4x2w1v0u9t8s7r6q5p4
Tagtagtag_01h8z3y4x2w1v0u9t8s7r6q5p4
Quoteqteqte_01h8z3y4x2w1v0u9t8s7r6q5p4
Webhookhksubhksub_01h8z3y4x2w1v0u9t8s7r6q5p4

Validation

The API validates that IDs have the correct prefix for each field:
// Valid - productId has prod_ prefix
{
  "productId": "prod_01h8z3y4x2w1v0u9t8s7r6q5p4",
  "departureId": "dept_01h9xm2n3p4q5r6s7t8v9w0x1y"
}

// Invalid - booking ID used where product ID expected
{
  "productId": "book_01h8z3y4x2w1v0u9t8s7r6q5p4",
  "departureId": "dept_01h9xm2n3p4q5r6s7t8v9w0x1y"
}
Using an ID with the wrong prefix returns a 400 Bad Request error.

Properties

  • Globally unique: IDs never collide across workspaces or entity types
  • Time-sortable: IDs created later sort after earlier ones
  • Lowercase: Always use lowercase when storing or comparing IDs

Working with IDs

Store and transmit IDs as strings:
// Correct
const productId = "prod_01h8z3y4x2w1v0u9t8s7r6q5p4"

// Validate the prefix if needed
if (!productId.startsWith("prod_")) {
  throw new Error("Invalid product ID")
}
Use the created_at field from API responses if you need creation timestamps - don’t try to extract them from the ID.