Typed IDs
Thor resource IDs are opaque typed strings shaped like <prefix>_<payload>. The prefix identifies the resource type and lets Thor reject an ID passed to the wrong argument early.
Copy the complete ID returned by GraphQL. Do not generate IDs, parse the payload, infer creation time, or replace one resource prefix with another. Store IDs as strings even if the underlying database uses another representation.
Common prefixes
| Resource | Prefix | Example |
|---|---|---|
| Store | store | store_... |
| Channel, including a price channel | ch | ch_... |
| Product | product | product_... |
| Product variant | vid | vid_... |
| Product price | price | price_... |
| Category | cat | cat_... |
| Collection | col | col_... |
| Customer | cus | cus_... |
| Customer group | cusgrp | cusgrp_... |
| Cart | cart | cart_... |
| Cart line item | cli | cli_... |
| Order | order | order_... |
| Order line item | oli | oli_... |
| Product discount | pd | pd_... |
| Cart discount | cart_discount | cart_discount_... |
| Cart discount code | cdc | cdc_... |
| Cart discount group | cdg | cdg_... |
| Shipping method | sm | sm_... |
| Shipping method rate | smr | smr_... |
| Shipping zone | sz | sz_... |
| Warehouse | warehouse | warehouse_... |
| Inventory entry | inventory | inventory_... |
| Payment gateway | pg | pg_... |
| Payment | payment | payment_... |
| Transaction | txn | txn_... |
| Media | media | media_... |
| Metafield definition | metafield | metafield_... |
| API key | api | api_... |
The type name used in prose or GraphQL does not always equal its ID prefix. In particular, product variants use vid_, channels use ch_, and customers use cus_.
Passing IDs between operations
The GraphQL scalar is usually ID, but the argument still expects the correct Thor type. For example, priceChannelId expects ch_...; a made-up chn_... or a product ID is invalid.
Application guidance
- Model IDs as opaque strings in TypeScript, databases, URLs, logs, and queues.
- If your language supports branded types, use them to prevent mixing IDs before the request reaches Thor.
- Preserve the ID exactly, including prefix, underscore, payload casing, and length.
- Use IDs rather than mutable names or slugs for durable relationships and predicate targeting.
- A GraphQL
node(id: ...)lookup can resolve several resource types, but a resource-specific mutation input still enforces its expected type. - Never put credentials such as Admin bearer tokens or API keys in an ID field. Authentication values are separate from typed resource IDs.